> ## Documentation Index
> Fetch the complete documentation index at: https://docs.abacuslabs.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# MCP server

> The same calls as MCP tools, hosted at https://mcp.abacuslabs.ai/mcp. Setup for Claude Code, Cursor, the Claude and OpenAI APIs, Claude Desktop and your own agent.

**URL:** `https://mcp.abacuslabs.ai/mcp` (streamable HTTP; `https://mcp.abacuslabs.ai` works too).
**Auth:** the header `Authorization: Bearer <key>`, with the same key as the REST API. Get one with `POST /v1/keys` ([Keys and limits](https://docs.abacuslabs.ai/authentication.md)). Every client must send this header: there is no OAuth sign-in yet, so connectors that only sign in with OAuth (claude.ai, the ChatGPT app) cannot connect today.

## Tools

| Tool | REST call | Notes |
| - | - | - |
| `abacus_analyze` | `POST /v1/analyze` | `question` is required. |
| `abacus_propose` | `POST /v1/proposals` | Waits up to 20 s. If `status` is `running`, call `abacus_get_proposal`. |
| `abacus_get_proposal` | `GET /v1/proposals/{id}` | `proposal_id` is required. Returns at once (no wait). |
| `abacus_check_trades` | `POST /v1/trades/check` | |
| `abacus_commit` | `POST /v1/commits` | `idempotency_key` is a required argument (any unique string). |
| `abacus_get_commit` | `GET /v1/commits/{id}` | `commit_id` is required. |
| `abacus_create_account`, `abacus_get_account`, `abacus_patch_account`, `abacus_list_accounts`, `abacus_delete_account` | `/v1/accounts` | `abacus_create_account` takes the account as `account`. The others take `account_id`; `abacus_patch_account` also takes `changes`. `abacus_list_accounts` takes `saved` (true: saved accounts only). |
| `abacus_get_holdings` | `GET /v1/accounts/{id}/holdings` | `account_id` is required. 1 credit. |
| `abacus_save_account` | `POST /v1/accounts/{id}/save` | `account_id` is required. |
| `abacus_list_benchmarks` | `GET /v1/benchmarks` | 1 credit. |
| `abacus_resolve_benchmark` | `POST /v1/benchmarks/resolve` | `benchmark` is required. 1 credit. |

Arguments are the REST body fields, at the top level of the tool call, with these differences: `abacus_commit` takes `idempotency_key` as a required argument (the REST header) and has no `on_stale`; `abacus_analyze`, `abacus_propose`, `abacus_check_trades` and `abacus_create_account` take an optional `idempotency_key` (a retry with the same key returns the first result with `idempotent_replay: true` and `credits_charged: 0`; a key used over REST and over MCP counts as two requests); `abacus_get_proposal` returns at once (no wait), so pause a few seconds between polls; `abacus_create_account` takes the POST body as `account`; `abacus_patch_account` takes the PATCH body as `changes`; ids that are in the REST path (`proposal_id`, `commit_id`, `account_id`) are arguments. Results are the REST JSON. Credits are the same as REST; read `credits_charged` in the result (MCP has no response headers).

**Errors.** An API error is a tool result with `isError: true`. Its text is `Error executing tool <name>: ` followed by the REST [error JSON](https://docs.abacuslabs.ai/errors.md), so parse the JSON from the first `{`:

```
Error executing tool abacus_get_commit: {"error": {"code": "not_found", "type": "not_found", "message": "commit cmt_nope not found for this key", "doc_url": "https://docs.abacuslabs.ai/errors#not-found", "request_id": null, "http_status": 404}}
```

Over MCP, `request_id` is `null`. A missing or wrong argument type is caught by the MCP layer first: its text is a plain validation message, not JSON (`1 validation error for abacus_get_commitArguments commit_id Field required ...`).

## Claude Code

```bash theme={null}
claude mcp add --transport http abacus https://mcp.abacuslabs.ai/mcp \
  --header "Authorization: Bearer $ABACUS_API_KEY"
```

`claude mcp list` then shows `abacus: https://mcp.abacuslabs.ai/mcp (HTTP) - ✔ Connected`.

## Claude API (MCP connector)

```python theme={null}
import anthropic

client = anthropic.Anthropic()
response = client.beta.messages.create(
    model="claude-opus-5",
    max_tokens=4000,
    betas=["mcp-client-2025-11-20"],
    mcp_servers=[{"type": "url", "url": "https://mcp.abacuslabs.ai/mcp", "name": "abacus",
                  "authorization_token": ABACUS_API_KEY}],
    tools=[{"type": "mcp_toolset", "mcp_server_name": "abacus"}],
    messages=[{"role": "user", "content": "How risky is my account acct_demo_concentrated?"}],
)
```

## OpenAI Responses API

```python theme={null}
from openai import OpenAI

client = OpenAI()
response = client.responses.create(
    model="gpt-5",
    tools=[{"type": "mcp", "server_label": "abacus", "server_url": "https://mcp.abacuslabs.ai/mcp",
            "headers": {"Authorization": f"Bearer {ABACUS_API_KEY}"}, "require_approval": "never"}],
    input="How risky is my account acct_demo_concentrated?",
)
```

Use `"require_approval": "always"` (or approve `abacus_commit` yourself) if a person must confirm each commit.

## Cursor

In `~/.cursor/mcp.json` (or `.cursor/mcp.json` in a project):

```json theme={null}
{ "mcpServers": { "abacus": { "url": "https://mcp.abacuslabs.ai/mcp",
                              "headers": { "Authorization": "Bearer abacus_sk_test_..." } } } }
```

## Claude Desktop and claude.ai

Custom connectors in claude.ai and the Claude apps sign in with OAuth, which Abacus Labs does not offer yet, so claude.ai cannot connect today. In Claude Desktop, use the `mcp-remote` bridge (needs Node.js) in `claude_desktop_config.json`, then restart Claude Desktop:

```json theme={null}
{ "mcpServers": { "abacus": { "command": "npx",
    "args": ["-y", "mcp-remote", "https://mcp.abacuslabs.ai/mcp", "--header", "Authorization:${ABACUS_AUTH}"],
    "env": { "ABACUS_AUTH": "Bearer abacus_sk_test_..." } } } }
```

## ChatGPT

ChatGPT connectors also sign in with OAuth, so the ChatGPT app cannot connect yet. From code, use the [OpenAI Responses API](#openai-responses-api) above.

> [!NOTE]
>
> Verified on 2026-11-14: Claude Code, the Claude API MCP connector and the OpenAI Responses API. The MCP Python SDK example below was run again on 2026-11-15 (SDK 2.3.0). Not verified by us: Cursor and the Claude Desktop bridge (both follow those tools' documented formats).

## Your own MCP client

Any streamable HTTP client works. With the official Python SDK:

```python theme={null}
import asyncio
from mcp import ClientSession
from mcp.client.streamable_http import streamable_http_client, create_mcp_http_client

async def main():
    http = create_mcp_http_client(headers={"Authorization": f"Bearer {ABACUS_API_KEY}"})   # default timeouts: 300 s read
    async with http, streamable_http_client("https://mcp.abacuslabs.ai/mcp", http_client=http) as (read, write, *_):
        async with ClientSession(read, write) as session:
            await session.initialize()
            tools = await session.list_tools()
            print([t.name for t in tools.tools])
            result = await session.call_tool("abacus_analyze", {"account": {"id": "acct_demo_concentrated"},
                                                                "question": "How risky is this account?"})
            print(result.content[0].text)

asyncio.run(main())
```

It prints the 11 tool names, then the analysis JSON. In SDK 2.x a failed call has `result.is_error == True`.

`GET https://api.abacuslabs.ai/mcp.json` returns the tool list and a client config snippet: use its `hosted` entry. (Its `stdio` and `start_http` entries are for running the server from the Abacus Labs source, which is not public.)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.