1.1 KiB
1.1 KiB
packages/mcp-server
Scope
- This package is the MCP/JSON-RPC adapter over the API server.
src/protocol/tools.tsdefines tool schemas.src/protocol/handler.tsmaps tool calls to API requests and JSON-RPC responses.src/protocol/metadata.tsexposes discovery metadata and protocol versioning.
Keep In Sync
- Tool definitions, handler argument mapping, and server metadata must stay consistent.
- When adding or renaming a tool, update
tools.tsandhandler.tstogether. - If protocol version or server-card details change, update both
metadata.tsand initialize responses inhandler.ts.
Protocol Rules
- Use MCP/JSON-RPC error codes and response envelopes, not ad-hoc API-style payloads.
- Keep this layer transport-focused. Marketplace behavior belongs in
packages/core; HTTP semantics belong inpackages/api-server. - Preserve the current tool result shape unless the protocol contract is being changed deliberately: text content with JSON-stringified API results.
Verify
bun test packages/mcp-server/testbun run --cwd packages/mcp-server buildbun run ci