---
title: "It's an MCP · Tempo AI Platform docs"
description: "How the MCP server serves every route as a tool, with the same prices and data, paid from a key or over MPP."
url: "https://gateway.tempo-dev.workers.dev/docs/guides/mcp"
---

> Every page of the Tempo AI Platform is Markdown at its URL with .md, or with Accept: text/markdown. The index of every page is https://gateway.tempo-dev.workers.dev/llms.txt, the API https://gateway.tempo-dev.workers.dev/openapi.json and the MCP server https://gateway.tempo-dev.workers.dev/mcp.

# It's an MCP

POST /mcp serves every capability of the platform as an MCP tool, for Claude Code, Codex or any client that speaks MCP over HTTP. A tool is a thin adapter over the same function as its /v1 route, so it is validated, priced, paid and scoped exactly like the route, and it reads and writes the same data.

[Get your Tempo Key](https://gateway.tempo-dev.workers.dev/key.md) · [MCP tools reference](https://gateway.tempo-dev.workers.dev/docs/mcp.md)

## Architecture

```text
Claude Code, Codex, any client         a cloud agent's cell
POST /mcp, streamable HTTP              tools.mcp__gateway__kv_set(...)
  Bearer sk-tempo-..., or no key          in process, its key attached
  |                                       |
  v                                       v
Mcp.handle: a new server for each request, no session to keep
  kv_set -> validate -> pay -> Kv.set(env, tenant, input)
                                 |
                  the same function as POST /v1/kv/set:
                  the same price, the same checks, the same data
```

Two ways in, one server: an outside client over HTTP and an agent's cell in process both reach the function the /v1 route calls.

## How a tool call runs

1. The client posts a JSON-RPC request to `/mcp`. The server is stateless: each request builds it afresh, so there is no MCP session to keep and any instance of the Worker serves any call.
2. The tool's arguments are checked against its schema before payment, so a malformed call fails and costs nothing.
3. A paid tool pays as its route would, at the route's price: from the Tempo Key the client sent, or with MPP over MCP.
4. The tool runs the route's own function with the tenant: the wallet that paid and the app the `app` argument names, the request's `Gateway-App` or `default`. A value `kv_set` writes is the value `POST /v1/kv/get` reads.

## Three ways to pay

- **A Tempo Key**\
  With `Authorization: Bearer sk-tempo-…`, every paid tool is paid from the key, through the same payment path as a bearer request. An unknown, revoked or expired key answers 401 for every method, `initialize` and `tools/list` included.
- **MPP over MCP**\
  With no key, an unpaid call answers JSON-RPC `-32042` carrying the MACH and OUSD session challenges, and the client calls again with its credential in `_meta["org.paymentauth/credential"]`. The tools act on the wallet that paid. nanocode-mpp registers the server this way as its built-in `gateway` server, so every wallet's agent has storage and sandboxes.
- **Inside a cloud agent**\
  The server is the session's `gateway` MCP server, reached in process with the agent's key attached, so a cell calls `tools.mcp__gateway__kv_set(...)` with no network hop and no credential. The agent's app is fixed; `owner` reaches items another wallet shared with it.

## Finding what a tool costs

The free tool `capabilities` maps every tool to the operation it is priced as and lists every price and limit, as `GET /v1/capabilities` does. `send_feedback` reaches the people who run the platform, and `public_read` reads another wallet's public items, both free.

## Try it

**Claude Code**

```sh
claude mcp add --transport http tempo https://gateway.tempo-dev.workers.dev/mcp --header "authorization: Bearer $TEMPO_KEY"
```

**Codex**

```sh
curl -fsSL https://gateway.tempo-dev.workers.dev/codex | sh
```

**any client**

```text
POST https://gateway.tempo-dev.workers.dev/mcp
Authorization: Bearer sk-tempo-…
Accept: application/json, text/event-stream
```

## Go deeper

- [MCP tools](https://gateway.tempo-dev.workers.dev/docs/mcp.md): every tool, and how to set up each client.
- [Code Mode](https://gateway.tempo-dev.workers.dev/docs/guides/code-mode.md): calling the tools from a cell.
- [Pricing](https://gateway.tempo-dev.workers.dev/docs/pricing.md): what each tool costs.

[<- It's an API](https://gateway.tempo-dev.workers.dev/docs/guides/api.md) · [It's an MPP service ->](https://gateway.tempo-dev.workers.dev/docs/guides/mpp.md)
