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

# Other MCP clients

> Connect any MCP client with an API key and call check_trades.

An MCP client that supports streamable HTTP and custom request headers can ask which of your rules a change would put outside range. Allocait cannot approve, stop or place an order. Your own code decides what happens next.

Illustrative example. The figures are hypothetical, not a recommendation.

Before you start, create an API key: in Allocait, go to **Settings > API keys** and select **Create API key** (see [Create a key](https://docs.allocait.app/api/authentication.md#create-a-key)). A **Read only** key is enough, because the check only reads. Then add the server to your client with the key in the `x-api-key` header. Field names vary by client. This shape is an example; see your client's documentation for its own. If your client signs in with OAuth instead, see [Connect an agent](https://docs.allocait.app/connect-an-agent.md).

```json theme={null}
{ "mcpServers": { "allocait": { "type": "http", "url": "https://api.allocait.app/functions/v1/mcp",
  "headers": { "x-api-key": "YOUR_API_KEY" } } } }
```

Call `list_portfolios` for the `portfolio_id`, then `check_trades`:

```json theme={null}
{ "name": "check_trades", "arguments": {
  "portfolio_id": "YOUR_PORTFOLIO_ID",
  "trades": [ { "symbol": "ALFA", "side": "BUY", "shares": 40 } ],
  "prices": { "ALFA": 181.5, "BRAV": 94.2, "GOLF": 62.3 } } }
```

`prices` covers every held and every changed symbol, except a held option with a stored mark. Allocait supplies none. A missing one fails with `PRICES_INCOMPLETE` and `missing`.

Read these fields in the result:

* `newly_or_further_outside_count`: how many rules the change puts outside range or leaves further outside.
* `rules_judged_count`: how many rules the check judged. If it is 0, nothing was checked, so a count of 0 means nothing.
* `not_covered`: symbols no rule judged.
* `within_rules` and `cash.sufficient`: whether the book stays inside its rules and cash stays at or above 0.

A bot that proceeds only when the change adds no violation checks that the count is 0 and `rules_judged_count` is above 0, and decides for itself what to do about `not_covered`. A failed call is no result.

In a loop, send each proposed basket in one call: `trades` takes up to 50 changes and checks them together against the book as recorded. Compare the count and log `positions_updated_at` with each result. If the portfolio has no active scenario, pass `scenario_id` from `list_portfolios`.

Allocait offers a `check_a_change` prompt, which tells the agent to report rule facts only. Whether a client shows prompts is up to the client.

## Next steps

* [Check result](https://docs.allocait.app/concepts/check-result.md): what each field of the result means.
* [Check a change](https://docs.allocait.app/guides/check-before-you-trade.md): the job and what to send.
* [Use an API key](https://docs.allocait.app/claude/connect-with-api-key.md): connect Claude Code with a key.
* [MCP tools](https://docs.allocait.app/claude/tools.md): every MCP tool.
* [Check from a script](https://docs.allocait.app/recipes/run-a-check-from-a-script.md): the same check over REST.


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