Documentation
¶
Overview ¶
Package mcp is a Model Context Protocol server that exposes a Miabi control panel to AI agents (Claude Desktop, Claude Code, Cursor, …). It is a thin protocol wrapper over internal/api: every tool call is one authenticated request to the panel's public /api/v1, so the agent inherits the operator's token, workspace scoping, and RBAC. No model inference happens here.
The server speaks JSON-RPC 2.0 over stdio (newline-delimited messages) or over the Streamable HTTP transport (see http.go). It implements the initialize handshake plus tools, resources, and prompts. Kept dependency-free — only the standard library — to match the CLI's thin footprint.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Options ¶
type Options struct {
Client *api.Client
// FallbackWorkspace is the workspace name used when a call omits the
// "workspace" argument (typically the CLI's active/bound workspace). May be
// empty, in which case calls require an explicit workspace unless the token
// can see exactly one.
FallbackWorkspace string
// AllowWrite enables the mutating tools (deploy, restart, rollback, …). When
// false the server is strictly read-only and those tools are not advertised.
AllowWrite bool
Version string
// Logf sinks diagnostics. On stdio the protocol owns stdout, so logs must go
// to stderr (or nowhere); never to stdout.
Logf func(format string, args ...any)
}
Options configures a Server.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server serves MCP over a stdio pair or HTTP. It holds one API client and a resolved fallback workspace (the CLI's active/bound workspace, used when a tool or resource omits a workspace).