Documentation
¶
Overview ¶
Package mcpgw is Keystone's MCP gateway: clients reach registered MCP servers through /mcp with a KTMS key, and the gateway holds the servers' credentials, enforces each key's allowed_mcp and tool_rpm, and accounts for every tool call.
Index ¶
Constants ¶
const CodeForbidden = -32003
CodeForbidden is the JSON-RPC error of a tool or server the key may not use.
const Separator = "__"
Separator joins a server and a tool name in the /mcp aggregate.
const UserHeader = "X-KTMS-User"
UserHeader names the end user a call is made for, as user_id does on /v1.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Gateway ¶
type Gateway struct {
// contains filtered or unexported fields
}
Gateway serves /mcp and /mcp/{server}.
func New ¶
func New(snaps Snapshots, verifier Verifier, limiter ToolLimiter, recorder Recorder, version string) *Gateway
New builds a gateway; limiter and recorder may be nil.
type Recorder ¶
type Recorder interface {
RecordToolCall(usagereport.ToolCall) error
}
Recorder accounts for tool calls (usagereport.UsageCollectorClient).