Connect an AI Agent
Connect any Model Context Protocol (MCP) compatible agent to your portfolio. Agents call our MCP server with your own personal API key, the same key you use for the Consumer API.
Last reviewed
What Is the MCP Server?
A standard agent interface, backed by the same data your REST API uses.
The Portfolio MCP server exposes a small set of read-only tools that wrap our Consumer API endpoints. AI agents that speak the Model Context Protocol can list your holdings, fetch transactions, summarise analytics, and read your watchlists, using the same authentication as the REST API and an allowance of their own at the same hourly rate your plan grants the REST API.
The endpoint is POST https://orchard72.com/api/v1/mcp/. Authenticate with your personal API key: Authorization: Bearer twai_…
Your data, your call
Step 1: Create a Personal API Key
- Open the Developer Page and select Create key.
- Give the key a recognisable name (e.g. “AI agent on laptop”).
- Choose portfolio:read only. Every agent tool is read-only, so portfolio:write adds nothing an agent can use and only widens what a leaked key could do.
- Tick estate:read or residency:read only if you want the agent to see your estate status or your residency day counts (see the tools below). Neither is included unless you tick it, and no other scope grants them.
- Set an expiry date. Six to twelve months is a sensible starting point. You can rotate the key earlier at any time.
- Copy the key (it starts with
twai_) and store it in your agent’s configuration. The raw key is shown once. We never store it in plaintext.
Step 2: Configure Your Agent
MCP-compatible AI agents
Add the following block to your MCP client’s configuration file (typically a JSON config in your home directory on macOS/Linux, or the equivalent on Windows). Check your agent’s documentation for the exact path. Replace twai_… with the key you created in Step 1.
{
"mcpServers": {
"thewill-portfolio": {
"transport": "http",
"url": "https://orchard72.com/api/v1/mcp/",
"headers": {
"Authorization": "Bearer twai_..."
}
}
}
}Other MCP clients
Any client that supports the MCP streamable HTTP transport can connect. Point the client at https://orchard72.com/api/v1/mcp/ and send your key in the Authorization header as a Bearer token.
Discovery document
Agents that look servers up for themselves can read https://orchard72.com/.well-known/mcp.json. It names the endpoint, the MCP protocol version, the authentication scheme, the error codes below and the address of the published tool catalogue.
Available Tools (v1)
All v1 tools are read-only and share one agent rate limit, separate from your REST API allowance.
- list_holdings: aggregated portfolio holdings with their most recent prices.
- list_transactions: buys, sells, dividends, and transfers, newest first. Filter with
account_id,security_id(both account and security identifiers),date_fromanddate_to(inclusive, YYYY-MM-DD) andlimit(1 to 500). Filtering is applied server side, and a value the server cannot read is rejected rather than ignored. - get_analytics_summary: combined sector/currency allocation and performance for a chosen period (default 1y).
- list_watchlists: watchlists and their items.
- get_estate_status (needs
estate:read): which estate documents you have (will, powers of attorney and similar), the status of each, and a suggested next step as a link into TheWILL.ai. Statuses only: never the content of a document, the people named in it or its file names. - get_residency_day_counts (needs
residency:read): days present per country betweendate_fromanddate_to(YYYY-MM-DD, at least 28 days and at most three years apart), with how close each country’s day-count threshold is, from Expat183. Counts only: never your location history, and never a conclusion about where you are resident.
Every agent tool is read-only, and that is a deliberate choice: recording a transaction needs a confirmation step an agent connection cannot show you. Changes to your portfolio are made in the app or through the Consumer API, and an agent moves your will or residency tracking forward only by handing you a link to open yourself.
Privacy and Safety
- Agents connect using your own key. We never share your portfolio with a third-party AI provider without your explicit approval. That is a promise we apply across the platform.
- Use a read-only key with an expiry for agent work. Keep any
portfolio:writekey for your own integrations, never for an agent. - MCP traffic has its own hourly allowance, at the same rate your plan grants the Consumer API but counted separately, so an agent cannot use up the allowance your own integrations rely on. It has the same one-hour sliding window and per-minute burst cap, and every response reports it in the
X-RateLimit-Limit,X-RateLimit-RemainingandX-RateLimit-Resetheaders. Rotate keys whenever you suspect compromise. - You can revoke a key at any time from the Developer Page. Agents using a revoked key receive HTTP 401 immediately.
When a Call Is Refused
Each refusal has its own JSON-RPC error code, so an agent can tell waiting from asking you.
- -32001: the key is missing, invalid, revoked or expired. The agent should ask you for a valid key.
- -32002: the key lacks the scope the tool needs. Retrying will not help; create a key with that scope.
- -32003: your plan does not include the feature the tool needs.
- -32004: the agent allowance is spent. The agent should wait the number of seconds given, then retry.
- -32010: the tool itself failed. A later retry may succeed.
Related Topics
Can’t find what you’re looking for?
Our support team is here to help. Contact us and we’ll get back to you as soon as possible.
Contact Support
