ServerProxier provides an abstraction to communicate with MCP Servers regardless of their transport. The ServerProxier is expected to, at least, fetch any available MCP tools.
| 9 | // ServerProxier provides an abstraction to communicate with MCP Servers regardless of their transport. |
| 10 | // The ServerProxier is expected to, at least, fetch any available MCP tools. |
| 11 | type ServerProxier interface { |
| 12 | // Init initializes the proxier, establishing a connection with the upstream server and fetching resources. |
| 13 | Init(context.Context) error |
| 14 | // Gracefully shut down connections to the MCP server. Session management will vary per transport. |
| 15 | // See https://modelcontextprotocol.io/specification/2025-06-18/basic/transports#session-management. |
| 16 | Shutdown(ctx context.Context) error |
| 17 | |
| 18 | // ListTools lists all known tools. These MUST be sorted in a stable order. |
| 19 | ListTools() []*Tool |
| 20 | // GetTool returns a given tool, if known, or returns nil. |
| 21 | GetTool(id string) *Tool |
| 22 | // CallTool invokes an injected MCP tool |
| 23 | CallTool(ctx context.Context, name string, input any) (*mcp.CallToolResult, error) |
| 24 | } |
| 25 | |
| 26 | // TODO: support HTTP+SSE. |
no outgoing calls
no test coverage detected