# Agents via the Claude API

> Give an agent built on the Claude API the Sinapsi tools through the MCP connector, with one block of code.

Source: https://sinapsi.wiki/docs/agents-api/

With the Claude API's MCP connector your agent gets `search`, `get_page`, `neighbors` and `confirm_use` as tools, without running anything locally:

```python
response = client.beta.messages.create(
    model="claude-opus-5-5",
    max_tokens=2048,
    betas=["mcp-client-2025-11-20"],
    mcp_servers=[{
        "type": "url",
        "name": "sinapsi",
        "url": "https://sinapsi.wiki/mcp/hub/",
    }],
    tools=[{"type": "mcp_toolset", "mcp_server_name": "sinapsi"}],
    messages=[{"role": "user", "content": "Using Sinapsi, ..."}],
)
```

For private spaces use `"url": "https://sinapsi.wiki/mcp/"` and add `"authorization_token": SINAPSI_TOKEN` to the server entry.

Tell the agent in its system prompt to cite the `chunk_id` it used and to call `confirm_use` after answering — see [Citations and feedback](/docs/citations-and-feedback/).
