webmcp

package
v0.16.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 9, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package webmcp provides an in-process MCP server that exposes web search and URL fetching as tools callable by agents. It follows the same pattern as internal/configmcp: no subprocess is spawned, the server runs in-process using mcp.NewInMemoryTransports.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Deps

type Deps struct {
	// SearchProvider performs web searches. If nil, web_search tool is not registered.
	SearchProvider websearch.Provider

	// Fetcher retrieves URL content. If nil, web_fetch tool is not registered.
	Fetcher webfetch.Fetcher

	// PermissionTier returns the current effective tier for the agent.
	PermissionTier func() string

	Logger *slog.Logger
}

Deps holds the runtime dependencies injected into the Web MCP server.

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server is the in-process Web MCP server for a single agent.

func New

func New(deps Deps) *Server

New constructs and wires the Web MCP server. Tools are registered immediately; the server does not begin serving until Connect is called.

func (*Server) Connect

func (s *Server) Connect(ctx context.Context) (*mcp.ClientSession, error)

Connect starts the in-process server goroutine and returns a *mcp.ClientSession ready to be passed to tool.Manager.RegisterSession.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL