Rebasely Beta: data may be purged

examples/MCP-tools Public

Limit tool calls per client with a Durable Object #1

Changed files

21 files changed335 additions21 deletionssince main at fcaf000

System

1 component added, 1 changed, 1 connection added, 1 view changed, 2 dataflows changed

  • Added
  • Changed
  • Removed
What this pull request changes in the system: 6 components, 5 connections mcp-server to tools (import)mcp-server to mcp-sdk (import)mcp-server to usage (kv)mcp-server to rate-limiter (rpc): addedtools to zod (import)importimportkvrpcimportmcp-server (changed)mcp-serverWorker · changedrate-limiter (added)rate-limiterDurable Object · addedtoolstoolsLibraryusageusageKV namespacemcp-sdkmcp-sdkExternalzodzodExternal

The system at the head of this pull request, with what it adds, changes and removes from the merge base fcaf000. Select a component for what changed in it.

rate-limiter

One object per client IP holding a token bucket: 30 tool calls in a burst, one more every two seconds. Runs one call at a time, so the limit is exact. Clears itself once full.

Added by this pull request.

Connections: mcp-server → rate-limiter added.

Takes part in A client over its rate limit, An agent calling a tool.

Changes

Knowledge base

Back to the conversation