Documentation
¶
Overview ¶
Code generated by apic; DO NOT EDIT.
Index ¶
- Variables
- func HandleMCPHTTP(w http.ResponseWriter, r *http.Request)
- func HandleMCPWS(w http.ResponseWriter, r *http.Request)
- func NewTools(srv MCPServerInterface) map[string]mcpx.Tool
- func Register(srv MCPServerInterface)
- func ServeSTDIO() error
- func ToolDescriptors() []mcpx.ToolDescriptor
- type MCPServerInterface
- type UnimplementedMCPServer
- func (UnimplementedMCPServer) Add_endpoint(_ context.Context, _ *types.AddEndpointParams) (jsontext.Value, error)
- func (UnimplementedMCPServer) Add_mcp_tool(_ context.Context, _ *types.AddMCPToolParams) (jsontext.Value, error)
- func (UnimplementedMCPServer) Add_schema(_ context.Context, _ *types.AddSchemaParams) (jsontext.Value, error)
- func (UnimplementedMCPServer) Add_websocket(_ context.Context, _ *types.AddWebsocketParams) (jsontext.Value, error)
- func (UnimplementedMCPServer) Generate(_ context.Context, _ *types.GenerateParams) (jsontext.Value, error)
- func (UnimplementedMCPServer) Get_config(_ context.Context, _ *types.ConfigPathParams) (jsontext.Value, error)
- func (UnimplementedMCPServer) Get_schema(_ context.Context, _ *types.GetSchemaParams) (jsontext.Value, error)
- func (UnimplementedMCPServer) List_endpoints(_ context.Context, _ *types.ConfigPathParams) (jsontext.Value, error)
- func (UnimplementedMCPServer) List_mcp_tools(_ context.Context, _ *types.ConfigPathParams) (jsontext.Value, error)
- func (UnimplementedMCPServer) List_schemas(_ context.Context, _ *types.ConfigPathParams) (jsontext.Value, error)
- func (UnimplementedMCPServer) List_websockets(_ context.Context, _ *types.ConfigPathParams) (jsontext.Value, error)
- func (UnimplementedMCPServer) Remove_endpoint(_ context.Context, _ *types.RemoveEndpointParams) (jsontext.Value, error)
- func (UnimplementedMCPServer) Remove_mcp_tool(_ context.Context, _ *types.RemoveItemParams) (jsontext.Value, error)
- func (UnimplementedMCPServer) Remove_schema(_ context.Context, _ *types.RemoveItemParams) (jsontext.Value, error)
- func (UnimplementedMCPServer) Remove_websocket(_ context.Context, _ *types.RemoveWebsocketParams) (jsontext.Value, error)
- func (UnimplementedMCPServer) Validate_config(_ context.Context, _ *types.ConfigPathParams) (jsontext.Value, error)
Constants ¶
This section is empty.
Variables ¶
var ErrNotImplemented = errors.New("not implemented")
ErrNotImplemented is returned by UnimplementedMCPServer methods.
var MCPHandler http.Handler
MCPHandler is an http.Handler for MCP JSON-RPC. Set by Register.
var MCPSTDIOFunc func() error
MCPSTDIOFunc starts the MCP stdio JSON-RPC loop. Set by Register.
var MCPWSHandler http.Handler
MCPWSHandler is an http.Handler for MCP over WebSocket. Set by Register.
Functions ¶
func HandleMCPHTTP ¶
func HandleMCPHTTP(w http.ResponseWriter, r *http.Request)
HandleMCPHTTP is an http.Handler for MCP JSON-RPC. Call Register first.
func HandleMCPWS ¶
func HandleMCPWS(w http.ResponseWriter, r *http.Request)
HandleMCPWS is an http.Handler for MCP over WebSocket. Call Register first.
func NewTools ¶
func NewTools(srv MCPServerInterface) map[string]mcpx.Tool
NewTools builds the MCP tool map backed by srv.
func Register ¶
func Register(srv MCPServerInterface)
Register configures the MCP tools with the given server implementation. Call this during application startup before serving.
GEN-2026-05-29-06: the rate/burst arguments to mcpx.SetToolBuckets are derived from the operator's top-level "mcp" config block (mcp.rate / mcp.burst) -- the block is bound at the config root, not under "security". When the config leaves them unset the generator emits the historic defaults (100 rps / 20 burst) so existing consumers keep working unchanged; operators who need a tighter ceiling for a sensitive MCP surface can now configure it at codegen time:
{"mcp": {"rate": 60, "burst": 60}}
func ServeSTDIO ¶
func ServeSTDIO() error
ServeSTDIO starts the MCP stdio JSON-RPC loop. Call Register first.
func ToolDescriptors ¶
func ToolDescriptors() []mcpx.ToolDescriptor
ToolDescriptors returns the MCP tools/list metadata for every generated tool: name, optional title/description, and the inputSchema (a JSON Schema object that is the union of the tool's body, path, and query parameters). Register passes these to mcpx.SetToolDescriptors so tools/list advertises a spec-compliant descriptor for each tool.
Types ¶
type MCPServerInterface ¶
type MCPServerInterface interface {
Add_endpoint(ctx context.Context, params *types.AddEndpointParams) (jsontext.Value, error)
Add_mcp_tool(ctx context.Context, params *types.AddMCPToolParams) (jsontext.Value, error)
Add_schema(ctx context.Context, params *types.AddSchemaParams) (jsontext.Value, error)
Add_websocket(ctx context.Context, params *types.AddWebsocketParams) (jsontext.Value, error)
Generate(ctx context.Context, params *types.GenerateParams) (jsontext.Value, error)
Get_config(ctx context.Context, params *types.ConfigPathParams) (jsontext.Value, error)
Get_schema(ctx context.Context, params *types.GetSchemaParams) (jsontext.Value, error)
List_endpoints(ctx context.Context, params *types.ConfigPathParams) (jsontext.Value, error)
List_mcp_tools(ctx context.Context, params *types.ConfigPathParams) (jsontext.Value, error)
List_schemas(ctx context.Context, params *types.ConfigPathParams) (jsontext.Value, error)
List_websockets(ctx context.Context, params *types.ConfigPathParams) (jsontext.Value, error)
Remove_endpoint(ctx context.Context, params *types.RemoveEndpointParams) (jsontext.Value, error)
Remove_mcp_tool(ctx context.Context, params *types.RemoveItemParams) (jsontext.Value, error)
Remove_schema(ctx context.Context, params *types.RemoveItemParams) (jsontext.Value, error)
Remove_websocket(ctx context.Context, params *types.RemoveWebsocketParams) (jsontext.Value, error)
Validate_config(ctx context.Context, params *types.ConfigPathParams) (jsontext.Value, error)
}
MCPServerInterface defines the business logic contract for generated MCP tools. Embed UnimplementedMCPServer and override only the tools you implement. The ctx is the request-scoped context threaded from the MCP transport (HTTP/WS carry the auth-verifier-enriched context; STDIO passes context.Background()).
type UnimplementedMCPServer ¶
type UnimplementedMCPServer struct{}
UnimplementedMCPServer returns ErrNotImplemented for every MCP tool.
func (UnimplementedMCPServer) Add_endpoint ¶
func (UnimplementedMCPServer) Add_endpoint(_ context.Context, _ *types.AddEndpointParams) (jsontext.Value, error)
func (UnimplementedMCPServer) Add_mcp_tool ¶
func (UnimplementedMCPServer) Add_mcp_tool(_ context.Context, _ *types.AddMCPToolParams) (jsontext.Value, error)
func (UnimplementedMCPServer) Add_schema ¶
func (UnimplementedMCPServer) Add_schema(_ context.Context, _ *types.AddSchemaParams) (jsontext.Value, error)
func (UnimplementedMCPServer) Add_websocket ¶
func (UnimplementedMCPServer) Add_websocket(_ context.Context, _ *types.AddWebsocketParams) (jsontext.Value, error)
func (UnimplementedMCPServer) Generate ¶
func (UnimplementedMCPServer) Generate(_ context.Context, _ *types.GenerateParams) (jsontext.Value, error)
func (UnimplementedMCPServer) Get_config ¶
func (UnimplementedMCPServer) Get_config(_ context.Context, _ *types.ConfigPathParams) (jsontext.Value, error)
func (UnimplementedMCPServer) Get_schema ¶
func (UnimplementedMCPServer) Get_schema(_ context.Context, _ *types.GetSchemaParams) (jsontext.Value, error)
func (UnimplementedMCPServer) List_endpoints ¶
func (UnimplementedMCPServer) List_endpoints(_ context.Context, _ *types.ConfigPathParams) (jsontext.Value, error)
func (UnimplementedMCPServer) List_mcp_tools ¶
func (UnimplementedMCPServer) List_mcp_tools(_ context.Context, _ *types.ConfigPathParams) (jsontext.Value, error)
func (UnimplementedMCPServer) List_schemas ¶
func (UnimplementedMCPServer) List_schemas(_ context.Context, _ *types.ConfigPathParams) (jsontext.Value, error)
func (UnimplementedMCPServer) List_websockets ¶
func (UnimplementedMCPServer) List_websockets(_ context.Context, _ *types.ConfigPathParams) (jsontext.Value, error)
func (UnimplementedMCPServer) Remove_endpoint ¶
func (UnimplementedMCPServer) Remove_endpoint(_ context.Context, _ *types.RemoveEndpointParams) (jsontext.Value, error)
func (UnimplementedMCPServer) Remove_mcp_tool ¶
func (UnimplementedMCPServer) Remove_mcp_tool(_ context.Context, _ *types.RemoveItemParams) (jsontext.Value, error)
func (UnimplementedMCPServer) Remove_schema ¶
func (UnimplementedMCPServer) Remove_schema(_ context.Context, _ *types.RemoveItemParams) (jsontext.Value, error)
func (UnimplementedMCPServer) Remove_websocket ¶
func (UnimplementedMCPServer) Remove_websocket(_ context.Context, _ *types.RemoveWebsocketParams) (jsontext.Value, error)
func (UnimplementedMCPServer) Validate_config ¶
func (UnimplementedMCPServer) Validate_config(_ context.Context, _ *types.ConfigPathParams) (jsontext.Value, error)