What is the Mandate MCP server?
The@mandate.md/mcp-server package is a Model Context Protocol server built on Cloudflare Workers. It exposes two tools: search (look up Mandate schemas and examples) and execute (call the Mandate API for validation, registration, and status checks). Any MCP-compatible client can connect to it via SSE transport.
The server uses @cloudflare/agents v0.0.16 and extends McpAgent<Env>.
Tools
| Tool | Description |
|---|---|
search | Look up Mandate schemas, policy fields, and example payloads. Use this before calling execute to understand the correct request format. Query examples: "validate schema", "register schema", "policy fields". |
execute | Call the Mandate API. Actions: validate (check if a transaction is allowed), register (create a new agent), status (get intent status). |
Deploy to Cloudflare Workers
Clone the package, install dependencies, set secrets, and deploy.MANDATE_API_URL defaults to https://app.mandate.md in wrangler.toml. Override it if you run a self-hosted Mandate instance.
Local development
http://localhost:8787. The SSE endpoint is at /sse and the MCP endpoint is at /mcp.
Environment variables
| Variable | Required | Default | Description |
|---|---|---|---|
MANDATE_RUNTIME_KEY | Yes | - | Mandate runtime key. Set via wrangler secret put. |
MANDATE_API_URL | No | https://app.mandate.md | Mandate API base URL. |
Client configuration
Claude Desktop
Codex CLI
Cursor / Windsurf
Add the SSE URL in your editor’s MCP settings. The server uses standard SSE transport, so any MCP-compatible editor works.Testing with MCP Inspector
Use the MCP Inspector to test your deployed server interactively.https://your-worker.workers.dev/sse) and test the search and execute tools directly.
Alternative: CLI MCP mode
If you do not need a Cloudflare Workers deployment, the Mandate CLI includes a built-in MCP server that runs locally via stdio transport.search, execute) over stdio. Use it for local development or when your MCP client supports stdio but not SSE.
The Workers MCP server does not store any state. Every
execute call is a stateless API request to the Mandate backend. Your runtime key is stored as a Cloudflare secret and never exposed to clients.Next Steps
CLI MCP Flag
Run Mandate MCP locally with the CLI’s —mcp flag.
Integrations Overview
Compare all Mandate integration options.
Validate Transactions
Understand the validate flow that the execute tool calls.