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
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 MCP config block (security.MCP.Rate / MCP.Burst). 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.
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 {
Create_item(ctx context.Context, params *types.ItemCreateReq) (*types.ItemCreateResp, error)
List_items(ctx context.Context, params *types.ItemListReq) (*types.ItemListResp, 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) Create_item ¶
func (UnimplementedMCPServer) Create_item(_ context.Context, _ *types.ItemCreateReq) (*types.ItemCreateResp, error)
func (UnimplementedMCPServer) List_items ¶
func (UnimplementedMCPServer) List_items(_ context.Context, _ *types.ItemListReq) (*types.ItemListResp, error)