# Connect from the Anthropic API

> Call DECA's tools from your own code with the Messages API's MCP connector. Claude runs the tools inside one request.

The Anthropic API's **MCP connector** lets Claude call a remote MCP server inside a single Messages request. You give it DECA's server URL; Claude lists the tools, calls the ones it needs and answers with the result. Your code runs no tool loop.

You need two parts in the request, and the `anthropic-beta: mcp-client-2025-11-20` header:

| Field | What goes in it |
|---|---|
| `mcp_servers` | `[{ "type": "url", "name": "deca", "url": "https://app.decalabs.ai/mcp" }]` |
| `tools` | `[{ "type": "mcp_toolset", "mcp_server_name": "deca" }]`, the same name as above |

## Request

```bash title="cURL"
curl https://api.anthropic.com/v1/messages \
  -H "x-api-key: $ANTHROPIC_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "anthropic-beta: mcp-client-2025-11-20" \
  -H "content-type: application/json" \
  -d '{
  "model": "claude-opus-5-5",
  "max_tokens": 4096,
  "mcp_servers": [{ "type": "url", "name": "deca", "url": "https://app.decalabs.ai/mcp" }],
  "tools": [{ "type": "mcp_toolset", "mcp_server_name": "deca" }],
  "messages": [{ "role": "user", "content": "What product ideas does DECA have in photo apps?" }]
}'
```

```ts title="TypeScript"
import Anthropic from "@anthropic-ai/sdk";

const client = new Anthropic();
const message = await client.beta.messages.create({
  model: "claude-opus-5-5",
  max_tokens: 4096,
  betas: ["mcp-client-2025-11-20"],
  mcp_servers: [{ type: "url", name: "deca", url: "https://app.decalabs.ai/mcp" }],
  tools: [{ type: "mcp_toolset", mcp_server_name: "deca" }],
  messages: [{ role: "user", content: "What product ideas does DECA have in photo apps?" }],
});
```

```python title="Python"
import anthropic

client = anthropic.Anthropic()
message = client.beta.messages.create(
    model="claude-opus-5-5",
    max_tokens=4096,
    betas=["mcp-client-2025-11-20"],
    mcp_servers=[{"type": "url", "name": "deca", "url": "https://app.decalabs.ai/mcp"}],
    tools=[{"type": "mcp_toolset", "mcp_server_name": "deca"}],
    messages=[{"role": "user", "content": "What product ideas does DECA have in photo apps?"}],
)
```

The answer holds `mcp_tool_use` and `mcp_tool_result` blocks for each DECA call, then Claude's text. Each result is the same JSON object the tool returns everywhere; see [Any MCP client](https://app.decalabs.ai/docs/mcp#what-a-tool-returns).

## With an API key

The free tools need no key. To read your own workspace ([`get_my_ideas`](https://app.decalabs.ai/docs/tools/get-my-ideas), [`list_my_tests`](https://app.decalabs.ai/docs/tools/list-my-tests)) or to have calls counted against your key's higher [rate limit](https://app.decalabs.ai/docs/reference/limits), add the key as the server's `authorization_token`. DECA receives it as `Authorization: Bearer`.

```json
{
  "mcp_servers": [{
    "type": "url",
    "name": "deca",
    "url": "https://app.decalabs.ai/mcp",
    "authorization_token": "deca_sk_…"
  }]
}
```

Read the key from your environment; never put it in code you share. See [API keys](https://app.decalabs.ai/docs/reference/authentication).

> **Note** · Paying for a test needs an x402 client that signs a USDC payment, which the MCP connector cannot do. Price tests with `quote_test` here, and pay with [`start_test`](https://app.decalabs.ai/docs/tools/start-test) from code that holds a wallet.

Source: https://app.decalabs.ai/docs/connect/anthropic-api
