Documentation
¶
Overview ¶
Package mcp implements a Model Context Protocol (MCP) server over stdio. It exposes cloop functionality as MCP tools so that Claude Desktop, Cursor, and other MCP clients can directly control and query cloop.
Protocol: JSON-RPC 2.0 over newline-delimited stdio. Spec: https://spec.modelcontextprotocol.io
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Request ¶
type Request struct {
JSONRPC string `json:"jsonrpc"`
ID json.RawMessage `json:"id,omitempty"` // nil for notifications
Method string `json:"method"`
Params json.RawMessage `json:"params,omitempty"`
}
Request is an incoming JSON-RPC 2.0 request or notification.
type Response ¶
type Response struct {
JSONRPC string `json:"jsonrpc"`
ID json.RawMessage `json:"id"`
Result any `json:"result,omitempty"`
Error *RPCError `json:"error,omitempty"`
}
Response is an outgoing JSON-RPC 2.0 response.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is an MCP server that reads JSON-RPC requests from r and writes responses to w, exposing cloop functionality as MCP tools.
type TextContent ¶
TextContent is a text content block in a tool result.
type Tool ¶
type Tool struct {
Name string `json:"name"`
Description string `json:"description"`
InputSchema map[string]any `json:"inputSchema"`
}
Tool describes an MCP tool (returned by tools/list).
type ToolResult ¶
type ToolResult struct {
Content []TextContent `json:"content"`
IsError bool `json:"isError,omitempty"`
}
ToolResult is the result returned by tools/call.