Documentation
¶
Overview ¶
Package mcp serves Workly's tools to coding agents over the Model Context Protocol, at /mcp.
It implements the part of the protocol a tools-only server needs: the Streamable HTTP transport in its stateless form (one JSON-RPC request per POST, answered with JSON; no sessions and no server-sent events), initialize, ping, tools/list and tools/call. That is small enough to write by hand, which keeps the SDK's dependencies out of the binary.
Tools call the /v1 API in-process, so they share its validation, errors and workspace scoping; the workspace is resolved from the /mcp request's credentials like any /v1 request.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Options ¶
type Options struct {
// API serves /v1 for requests already scoped to a workspace.
API http.Handler
Mode Mode
// ModeFor, if set, can make a request read-only when Mode is Full, e.g.
// for credentials granted only read access; anything but Full is read-only.
// It can't widen Mode.
ModeFor func(*http.Request) Mode
Version string
Logger *slog.Logger
}