MCP Integration

Connect AI clients to DoubleM through the built-in MCP server.

DoubleM ships its own MCP server at /api/mcp, on the same deployment as the app and the REST API. Tools are thin wrappers over the REST routes, so every call keeps the same validation, user scoping, and financial side-effect rules.

What Is MCP?

Model Context Protocol, or MCP, is a standard way for AI clients to discover and call external tools. Instead of manually teaching an assistant every DoubleM API route, the MCP server advertises typed tools such as list_expenses, create_expense, and record_bill_payment.

MCP endpoint

The server endpoint is https://finance-tracker.0xdd.cloud/api/mcp. It is part of the DoubleM app itself — there is no separate MCP deployment to configure or keep in sync.

Transport

Remote Streamable HTTP over JSON-RPC, protocol version 2025-06-18 (older revisions are negotiated on initialize). The server is stateless and issues no session id. Stdio-only clients should bridge with mcp-remote.

Authentication

Send a DoubleM API key as Authorization: Bearer dmk_PUBLICKEY_SECRETKEY. Clients that cannot set an Authorization header may send the key as X-DoubleM-API-Key instead.

Scoped tools

tools/list returns only the tools your key can actually call, so an assistant never sees a tool it will be denied on.

How MCP Helps Finance Tracking

MCP lets Codex, Claude, Cursor, and other compatible clients work with your finance data through a tool layer rather than raw prompts. The assistant can read the current state first, choose the right tool, and ask for confirmation before making records that affect balances, statements, bills, or loans.

  • Ask for a dashboard summary, report, bill briefing, or credit-card status without opening the app.
  • Let the assistant list accounts, cards, categories, bills, loans, and statements before choosing a target.
  • Create expenses, income rows, card charges, account transactions, and categories from plain-language requests.
  • Record bill, loan, and credit-card statement payments while preserving backend side-effect rules.
  • Adjust account balances or split expenses after the assistant shows exactly what will change.

Connect From Claude.ai (OAuth)

The claude.ai Connectors UI cannot attach a static Authorization header, so it uses OAuth. Add the endpoint as a custom connector and DoubleM handles the rest — no API key needed:

https://finance-tracker.0xdd.cloud/api/mcp

Claude discovers the server through RFC 9728 metadata, registers itself with dynamic client registration, then sends you to a DoubleM consent screen. Sign in, review the permissions, and approve. Tokens are scoped to what you approve there, expire after an hour, and refresh automatically.

Discovery

/.well-known/oauth-protected-resource and /.well-known/oauth-authorization-server describe the resource and the authorization server.

Registration

Dynamic client registration lives at /api/oauth/register. A client id alone grants nothing — every token needs your approval on the consent screen.

Authorization

Authorization code with PKCE (S256 required). Codes are single-use and expire in 60 seconds.

Tokens

Opaque bearer tokens, stored only as hashes. Access tokens last one hour; refresh tokens rotate on every use.

OAuth connections are Pro-only and are granted mcp:connect automatically. Use an API key instead when your client can set headers, or when you want a long-lived credential for a server-side integration.

Create An API Key

MCP uses the same API key as the REST API. External API-key access is a Pro feature.

  1. Open DoubleM settings and go to the API Keys tab.
  2. Create a key and tick Connect via MCP. Without it the server refuses the session with a 403.
  3. Tick the data scopes the assistant needs. Read Finance Data is the usual baseline; add write scopes only for the actions you want the assistant to be able to take.
  4. Copy the token. It looks like dmk_PUBLICKEY_SECRETKEY and is shown only once.

Keep the API key private. Do not commit it to code, paste it into prompts, or put it in shared MCP config unless the value is injected from a secret store or local environment variable.

Scopes And Tool Access

A key's scopes decide which tools appear in tools/list and which calls succeed. A domain write scope also grants reads on that same domain, so a write-only integration can read back what it just wrote.

ScopeUnlocks
mcp:connectRequired to open an MCP session at all. Grants no data access on its own.
finance:readEvery read tool, including the dashboard summary and reports.
expenses:writecreate_expense, update_expense, delete_expense, split_expense
income:writecreate_income
accounts:writecreate_account_transaction, update_account_transaction, adjust_account_balance
bills:writerecord_bill_payment
loans:writerecord_loan_payment
credit_cards:writecreate_credit_card_transaction, record_credit_card_soa_payment
settings:writecreate_category, update_budget_thresholds

Selecting every scope stores all, which grants everything including mcp:connect.

Available Tools

Read tools

get_dashboard_summaryget_reportlist_expensesget_expenseget_expense_form_optionsget_expense_summarylist_incomeget_incomelist_accountslist_account_transactionslist_credit_cardslist_credit_card_soasget_credit_card_soalist_unbilled_transactionslist_installment_plansget_installment_planget_credit_card_metricslist_billsget_bills_summarylist_bill_templatesget_bill_templatelist_bill_paymentsget_bill_form_optionslist_loansget_current_month_loan_dueslist_categoriesget_app_settingsget_budget_thresholds

Write tools

create_expenseupdate_expensedelete_expensesplit_expensecreate_incomeupdate_incomedelete_incomecreate_account_transactionupdate_account_transactionadjust_account_balancecreate_credit_card_transactionrecord_credit_card_soa_paymentadd_soa_transactionconvert_transaction_to_installmentcancel_installment_planlink_transaction_to_soaupdate_credit_card_soarecord_bill_paymentcreate_bill_templateupdate_bill_templatedelete_bill_templateupdate_bill_instanceupdate_bill_statusdelete_bill_paymentrecord_loan_paymentcreate_categoryupdate_budget_thresholds

Connect In Claude Desktop Or Claude Code

Claude Code supports remote HTTP MCP servers directly:

claude mcp add --transport http double-m-finance https://finance-tracker.0xdd.cloud/api/mcp \
  --header "Authorization: Bearer dmk_PUBLICKEY_SECRETKEY"

Claude Desktop uses stdio MCP config. Bridge to the remote endpoint with mcp-remote:

{
  "mcpServers": {
    "double-m-finance": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote",
        "https://finance-tracker.0xdd.cloud/api/mcp",
        "--header",
        "Authorization: Bearer dmk_PUBLICKEY_SECRETKEY"
      ]
    }
  }
}

Restart the Claude client after editing its MCP configuration.

Connect In Codex

If your Codex version supports remote HTTP MCP servers, add the endpoint directly and configure the bearer token. The exact header setting depends on the Codex client version.

codex mcp add double-m-finance --url https://finance-tracker.0xdd.cloud/api/mcp
Authorization: Bearer dmk_PUBLICKEY_SECRETKEY

After connecting, ask Codex: List the available DoubleM finance tools, then get my dashboard summary.

Connect In Cursor Or Generic HTTP Clients

If your client supports remote Streamable HTTP MCP servers with custom headers, configure the URL and bearer header directly:

{
  "mcpServers": {
    "double-m-finance": {
      "url": "https://finance-tracker.0xdd.cloud/api/mcp",
      "headers": {
        "Authorization": "Bearer dmk_PUBLICKEY_SECRETKEY"
      }
    }
  }
}

If the client cannot attach HTTP headers to remote MCP servers, use mcp-remote as shown above. If the client does not support MCP at all, integrate the REST API and expose your own tools through that provider's tool-calling interface.

Verify The Connection

Any MCP client speaks plain JSON-RPC over HTTP, so you can check the endpoint with curl before wiring it up:

curl -X POST "https://finance-tracker.0xdd.cloud/api/mcp" \
  -H "Authorization: Bearer dmk_PUBLICKEY_SECRETKEY" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "tools/list",
    "params": {}
  }'

The response lists exactly the tools your key's scopes allow. If the list is shorter than expected, the key is missing a scope rather than the server missing a tool.

Example Prompts

List the available DoubleM finance tools, then get my dashboard summary.

What changed in my spending this week compared with last week?

List unpaid bills this month and tell me which one is overdue.

Record a 450 cash expense for lunch today under Food.

Add my UnionBank credit-card payment and mark the matching statement paid.

Split yesterday's grocery expense into Food, Household, and Pet Supplies.

Show my active loans and the next installment due for each.

Safety Rules For Finance Tools

  • Use read tools first to identify accounts, cards, statements, bills, loan installments, and categories.
  • Ask the user to confirm before write tools, especially payments, deletes, splits, and balance adjustments.
  • Do not retry payment or balance tools blindly after network failures. Read the latest state first.
  • Use canonical payment methods only: Cash, Account Debit, and Credit Card.
  • For Account Debit, provide an active account_id.
  • For Credit Card, provide an active credit_card_id where supported.
  • Grant only the write scopes an integration actually needs, so a mistaken tool call cannot reach other domains.
  • Rotate the API key immediately if it appears in logs, screenshots, commits, or prompt history.

The server sends these rules to the client as MCP instructions on initialize, and marks destructive tools with destructiveHint so clients can prompt before running them.

Troubleshooting

  • Confirm the MCP URL ends with /api/mcp on the main app domain. The previous standalone MCP host has been retired.
  • Confirm the client sends Authorization: Bearer dmk_PUBLICKEY_SECRETKEY, or X-DoubleM-API-Key if it cannot set an Authorization header.
  • A 401 mentioning the retired format means the key is an old <public_key>.<secret_key> token. Create a replacement key in settings; new tokens start with dmk_.
  • A 402 means the account is not on the Pro plan. A 403 means the key is missing mcp:connect.
  • A tool missing from tools/list means the key lacks that tool's scope.
  • If reads work but writes fail, check required fields, YYYY-MM-DD dates, active source IDs, and the returned finance API error message.
  • If you need more help, please Contact Support