MCP server

Beta MCP spec 2025-06-18

Lets an AI agent inspect the financial state of accounts you've assigned to it — balances, transactions, cards, direct debits, standing orders — under the policy you define. Any MCP-compliant client can connect.

https://mcp.agentis.capital/mcp

# Overview

The agentis MCP server implements Model Context Protocol over Streamable HTTP. See the setup guide for per-client integration steps.

Every session is bound to exactly one agent identity. All tool calls execute against that agent's policy.

The current toolset is read-only. Payment tools will ship soon with Agent Accounts.

# Connection

PropertyValue
Base URLhttps://mcp.agentis.capital
MCP endpointPOST /mcp, GET /mcp, DELETE /mcp
TransportStreamable HTTP (MCP spec 2025-06-18)
Content-Typeapplication/json on requests
Acceptapplication/json, text/event-stream — both required (server may stream)
CORSNot enabled. Browser calls aren't supported — proxy through your own backend.

# Sessions

Sessions follow the MCP Streamable HTTP spec (created on initialize, identified by the Mcp-Session-Id header). Agentis-specific behavior:

  • One agent identity per session; concurrent tool calls are permitted within a session
  • Sessions are ephemeral; clients should re-initialize on 404 from /mcp (session unknown or expired)

# Authentication

Two flows are supported. Both terminate at the same resource — a Bearer token bound to a single agent identity.

# OAuth 2.0 (Authorization Code + PKCE)

For interactive clients. Standard Authorization Code flow with PKCE (RFC 6749 + 7636); Dynamic Client Registration per RFC 7591.

EndpointPurpose
GET /.well-known/oauth-authorization-serverAuthorization-server metadata (RFC 8414)
GET /.well-known/oauth-protected-resourceProtected-resource metadata
POST /registerDynamic Client Registration (RFC 7591)
GET /authorizeresponse_type=code, code_challenge_method=S256
POST /tokengrant_type=authorization_code or refresh_token
POST /oauth/revokeToken revocation (RFC 7009)

Supported scopes: mcp. Token endpoint auth method: none.

Unauthenticated requests to /mcp return 401 Unauthorized with a WWW-Authenticate header that points compliant clients at the protected-resource metadata:

401 Unauthorized
WWW-Authenticate: Bearer resource_metadata="https://mcp.agentis.capital/.well-known/oauth-protected-resource"

Token response

POST /token returns the standard OAuth 2.0 token response:

200 OK
{
  "access_token":  "agts_oat_live_…",
  "token_type":    "Bearer",
  "expires_in":    3600,
  "refresh_token": "agts_ort_live_…",
  "scope":         "mcp"
}

Token lifetimes

TokenLifetimeNotes
access_token60 minutesRotated by exchanging the refresh token at /token.
refresh_token (idle)90 daysSliding window; resets on each rotation.
refresh_token (absolute)180 daysHard ceiling regardless of activity. Matches PSD2 SCA renewal cadence; the user re-authorizes at most every 180 days.

Token-endpoint errors follow RFC 6749 §5.2. Only authorization_code and refresh_token grants are accepted.

# Bearer API key

For non-interactive clients. Issue an agent API key from the dashboard and pass it as a Bearer token on every request.

HTTP header
Authorization: Bearer $AGENTIS_API_KEY

Key prefixes

API keys and OAuth tokens carry structured prefixes:

PrefixKindNotes
agts_agent_live_…Agent keyProduction
agts_agent_test_…Agent keyDevelopment
agts_oat_live_…OAuth access tokenIssued by /token; 60-minute lifetime
agts_ort_live_…OAuth refresh tokenIssued by /token

Agent keys do not expire automatically. Revoke or rotate from the dashboard — a revoked key returns 401 on the next call.

# Tools

# Conventions

Tool inputs and outputs are described by JSON schemas returned by tools/list. The reference below covers what each tool is for and when to call it; for the exact request and response shape your agent will see, call tools/list against the live server.

  • Tools return an MCP CallToolResult. On success the typed payload is in structuredContent (and serialized as JSON text in content[0].text); on failure isError: true and content[0].text carries the error string — see Errors.
  • All monetary amounts are major currency units as decimal strings ("45.50" = EUR 45.50). Currency is a separate ISO 4217 code.
  • Dates are YYYY-MM-DD; timestamps are RFC 3339.
  • IDs are prefixed ULIDs: agent_…, org_…, pol_…, bnk_…, pay_…, aud_….
  • All current tools are idempotent, but every call is a real bank read; banks may rate-limit. The rate_limited structured error (see Errors) is the canonical signal — agents should route on it rather than assume a fixed quota.
  • account always defaults to the agent's default bank connection when omitted.
  • Fields may be omitted from a response when the agent's data_access policy masks them (e.g. iban, account_holder_name).

# Self-knowledge

view_identity read

Returns the authenticated agent's identity. Use to confirm which agent the session is bound to before acting, or to surface the agent's name to the user.

view_policy read

Returns the full policy governing this agent: spending limits, beneficiary rules, time windows, escalation thresholds, and data-access settings. Use to check what the agent is allowed to do, or to explain to the user why an operation may be restricted. Policies are authored in the dashboard.

# Accounts

list_accounts read

Lists bank accounts assigned to this agent. Use first to discover the available accounts and pick the right bnk_… ID for downstream tools.

check_account_balance read

Returns available and current balance. Use when the user asks how much money is in an account, or to check spending power before committing to a purchase. available reflects pending transactions, holds, and overdraft; current is the settled ledger balance.

Parameters
accountBank connection ID.
string · optional
list_account_transactions read

Returns transactions for a bank account, filtered by date range and the agent's data-access policy. Use to answer “where did the money go?”, reconcile a specific charge, or summarize spend over a window. Bank consent windows expire periodically under PSD2 SCA rules — fetching older history may require the user to re-authorize the bank connection in the dashboard (a fresh SCA).

Parameters
fromStart date YYYY-MM-DD.
string · optional
toEnd date YYYY-MM-DD.
string · optional
accountBank connection ID.
string · optional
list_account_direct_debits read

Returns direct-debit mandates as exposed by the bank. Use to surface recurring outgoings the user may have forgotten, or to verify whether a vendor's mandate is still active. Coverage varies; banks that don't expose mandates return a data_not_retrievable structured error (see Errors).

Parameters
accountBank connection ID.
string · optional
list_account_standing_orders read

Returns standing orders as exposed by the bank. Use to surface scheduled outbound transfers (rent, payroll, subscriptions) for cash-flow planning. Same coverage limitation as direct debits.

Parameters
accountBank connection ID.
string · optional

# Cards

list_cards read

Lists all credit and debit cards linked to a bank connection. Use to discover available cards and pick a card_id for card-scoped tools.

Parameters
accountBank connection ID.
string · optional
check_card_balance read

Returns balance, credit limit, and payment information for a card. Use when the user asks how much they can still charge to a card, or when the bill is due.

Parameters
card_idCard account ID from list_cards.account_id.
string required
accountBank connection ID.
string · optional
list_card_transactions read

Returns transactions for a specific card. Use to reconcile a card charge, audit card spend, or break down what was bought on a card over a window.

Parameters
card_idCard account ID.
string required
fromStart date YYYY-MM-DD.
string · optional
toEnd date YYYY-MM-DD.
string · optional
accountBank connection ID.
string · optional

# Payments

Payment tools will ship soon with Agent Accounts.

# Errors

A tool failure returns an MCP CallToolResult with isError: true. The text in content[0].text takes one of two shapes:

  • Short formError [code]: message. Used for simple, deterministic failures (e.g. invalid_request, forbidden).
  • Structured error object — JSON with the fields below. Used when the failure has a recommended remediation (rate-limit waits, expired consent, transient bank errors).

# Structured error object

FieldDescription
reasonClosed enum (see below).
string
actionRecommended next action; closed enum (see below).
string
retry_after_secondsWait before retrying. Omitted when no retry is recommended.
integer · optional
hintPlain-language explanation, suitable for surfacing to a human.
string
correlation_idReserved for support workflows; empty today.
string · optional

The structured error rides inside the standard MCP CallToolResult. A full tools/call response carrying a rate-limit error looks like:

Response · isError
{
  "jsonrpc": "2.0",
  "id": 3,
  "result": {
    "content": [
      { "type": "text",
        "text": "{\"reason\":\"rate_limited\",\"action\":\"wait_then_retry\",\"retry_after_seconds\":21600,\"hint\":\"The bank's rate limit on this account has been reached. Suggested wait: ~6 hours before retrying.\"}" }
    ],
    "isError": true
  }
}

# reason and action

Current values listed below. Additions are backwards-compatible; renames or removals trigger a version bump. Route on action to decide the retry strategy; reason tells you why.

ReasonTypical actionMeaning
rate_limitedwait_then_retryPer-org or upstream-bank rate limit exceeded. Wait retry_after_seconds before retrying.
transient_bank_errorretry_with_backoffBank had a transient error or timed out. Retry with exponential backoff starting at retry_after_seconds.
account_unavailablewait_then_retryThe specific account is temporarily unavailable; retry later.
internal_errorretry_with_backoffUnhandled error on the agentis side. Safe to retry.
invalid_requestcorrect_and_retryMalformed parameters. Fix the input and retry — the same input will fail again.
consent_revokedescalateThe bank consent has been revoked. Surface to the admin; re-authorization required.
session_expiredescalateThe bank session has expired (PSD2 SCA renewal cadence). Admin re-authorization required.
psu_action_requiredescalateThe bank requires user action (re-consent, new terms, …) before further reads succeed.
policy_deniedescalateThe agent's policy disallowed the operation (e.g. masked field, account not assigned).
data_not_retrievablegive_upThe bank doesn't expose the requested resource (e.g. mandates). Permanent for this resource.

# HTTP status codes

Tool-level failures arrive inside CallToolResult with isError: true and a 200 transport status. The transport statuses below have MCP-specific behavior worth handling explicitly — other codes follow RFC 9110.

StatusMeaning
401Missing, invalid, revoked, or expired Bearer token. WWW-Authenticate header points compliant clients at the protected-resource metadata.
404Session ID unknown or expired. Re-initialize and retry.
429Rate limit exceeded. Retry-After header carries the wait in seconds; body carries a rate_limited structured error.
Use reason + action as the routing keys for retries and escalations. hint is human-facing and may change wording without notice.