Documentation
¶
Overview ¶
Package mcpserver exposes the fetch module as an MCP tool over stdio.
The server is a thin adapter: it decodes the MCP tool call, maps it to a fetch.Params, calls fetch.Fetch, and wraps the result. All logging goes to a file (never stdout, which is the stdio transport — see ADR-0005 row 8).
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Version = "dev"
Version is the server version reported in the MCP initialize handshake. It is a package variable so release builds inject the tag at link time via -ldflags "-X github.com/ChHsiching/agent-web-fetch/internal/mcpserver.Version=vX.Y.Z" (spec #16: a release can never ship reporting a stale version). Builds without that flag (local, CI) report "dev" rather than a hand-edited string.
Functions ¶
func Run ¶
Run starts the MCP server over stdio and blocks until the client disconnects. Logging is configured via the WEB_FETCH_LOG environment variable: when set to a file path, logs go there; otherwise the server is silent. Nothing is written to stdout (the stdio transport) under any circumstance.
A closed stdin (client disconnect / EOF) is the normal shutdown path and returns nil rather than an error.
Types ¶
type Deps ¶
type Deps struct {
Client fetch.HTTPClient
}