Documentation
¶
Overview ¶
Package mcpbridge serves MemSpace's MCP tools to a local agent over stdio, forwarding every call to the server's streamable HTTP endpoint.
Agents then only need a command in their configuration (`memspace mcp stdio`): the bridge reads the device's credentials itself, so no token is written into agent configs or the shell environment, and a rotated token or a moved server needs no change on the agent side.
Both legs use the MCP SDK, so each negotiates its own protocol version and headers; the bridge mirrors the server's tools and instructions as they are when it starts.
Index ¶
Constants ¶
const ConnectTimeout = 8 * time.Second
ConnectTimeout bounds reaching the server at start-up. Agents give MCP servers only a few seconds to start.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Options ¶
type Options struct {
// URL is the server's MCP endpoint, e.g. http://host:8765/mcp.
URL string
// Token is sent as a bearer token (the device's read-only MCP token).
Token string
// Transport carries the HTTP requests (e.g. one that skips proxies for
// private hosts). Nil means http.DefaultTransport.
Transport http.RoundTripper
// Version is reported to both sides.
Version string
}
Options configure a bridge.