Rebasely Beta: data may be purged

examples/MCP-tools Public

Markdown · 20 lines · 1.0 KiB · at dae155a

# mcp-tools knowledge basemcp-tools is a small MCP server on Cloudflare Workers. Three read-only tools (`convert_units`, `time_in_zone`, `text_stats`) answer from their input alone; the Worker serves them over Streamable HTTP at `/mcp` and counts calls in KV.## How it works- [[tool-design]]: what every tool has (name, description for the model, schemas, structured output) and how failures reach the model.- [[http-transport]]: how a POST to `/mcp` becomes an MCP response, and what the Worker does around it.- [[usage-counts]]: what `/stats` counts, where, and how far to trust it.## Why it is this way- [[0001-stateless-streamable-http]]: a fresh server per request, no sessions.- [[0002-tool-errors-are-results]]: failures come back as tool results the model can read.- [[0003-usage-counts-in-kv]]: approximate counters in KV rather than a Durable Object.## How to- [[adding-a-tool]]: from a new file in `src/tools/` to a passing test.- [[connecting-a-client]]: Claude Desktop, the MCP Inspector, or curl.