Documentation
¶
Overview ¶
Package mcpserver assembles the MCP server behind `fizzy mcp`: the hand-written Fizzy tool catalog served through the shared toolkit's gateway, dispatching real API calls through the CLI's authenticated, account-scoped SDK client.
The generic machinery — domain gateway tools, the {"action", "params"} calling convention, read-only filtering, the in-band describe action — lives in the shared toolkit at github.com/basecamp/mcp. The catalog in internal/mcpserver/catalog is deliberately duplicated from its sibling in fizzy-mcp-server (synced by scripts/sync-mcp-catalog.sh, provenance recorded). This package supplies the CLI's half: wiring the catalog to the gateway and the dispatcher that turns catalog operations into fizzy-sdk requests.
Index ¶
Constants ¶
const Name = "fizzy-cli"
Name identifies the server in the MCP initialize handshake. The version is the CLI's own: `fizzy mcp` is the CLI serving MCP, not a separate product.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API interface {
Get(ctx context.Context, path string) (*fizzy.Response, error)
Post(ctx context.Context, path string, body any) (*fizzy.Response, error)
Put(ctx context.Context, path string, body any) (*fizzy.Response, error)
Patch(ctx context.Context, path string, body any) (*fizzy.Response, error)
Delete(ctx context.Context, path string) (*fizzy.Response, error)
}
API is the slice of the fizzy-sdk client the dispatcher drives. Both *fizzy.Client and *fizzy.AccountClient satisfy it; the SDK carries auth, retry, and base URL resolution — the AccountClient adds account-slug scoping — so the dispatcher only assembles paths and bodies.
type Config ¶
type Config struct {
// ReadOnly drops every write action from the catalog and refuses write
// dispatch outright. The served default, matching fizzy-mcp-server's
// posture: writes are an explicit opt-in, paired with a Read+Write
// token — the token's permission is the server-side enforcement, this
// filter is the client-side surface.
ReadOnly bool
// Domains narrows the served domains by key ("boards", "cards", ...).
// Empty means all. Unknown keys are a startup error — fail closed.
Domains []string
// Version is the CLI version reported in the initialize handshake.
Version string
}
Config selects the served tool surface.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server wraps the toolkit gateway serving the catalog, dispatching through the CLI's SDK clients.
func New ¶
New validates the catalog and hands it to the gateway, which applies the config's domain and read-only filters. Tool calls dispatch through account (account-scoped operations) and root (the few unscoped ones, like get_identity).
func (*Server) BuildMCPServer ¶
BuildMCPServer constructs the SDK MCP server with one gateway tool per served domain.