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) Admin_action(_ context.Context, _ *types.AdminActionReq) (*types.AdminActionResp, error)
- func (UnimplementedMCPServer) Create_post(_ context.Context, _ *types.PostCreateReq) (*types.PostCreateResp, error)
- func (UnimplementedMCPServer) Search_posts(_ context.Context, _ *types.PostSearchReq) (*types.PostSearchResp, 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 {
Admin_action(ctx context.Context, params *types.AdminActionReq) (*types.AdminActionResp, error)
Create_post(ctx context.Context, params *types.PostCreateReq) (*types.PostCreateResp, error)
Search_posts(ctx context.Context, params *types.PostSearchReq) (*types.PostSearchResp, 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) Admin_action ¶
func (UnimplementedMCPServer) Admin_action(_ context.Context, _ *types.AdminActionReq) (*types.AdminActionResp, error)
func (UnimplementedMCPServer) Create_post ¶
func (UnimplementedMCPServer) Create_post(_ context.Context, _ *types.PostCreateReq) (*types.PostCreateResp, error)
func (UnimplementedMCPServer) Search_posts ¶
func (UnimplementedMCPServer) Search_posts(_ context.Context, _ *types.PostSearchReq) (*types.PostSearchResp, error)