Skip to main content
Version: v5

Connect your own agent

SuiviBourse runs an MCP server. Connect Claude Desktop, Claude Code or any other MCP client to it, and the client can read your portfolio's figures. The built-in agent uses the same tools.

The address​

The server runs inside the app, on the same port:

http://<your-host>:8080/mcp

It uses the Streamable HTTP transport. If you publish the app on another port or behind a reverse proxy, use that address with /mcp at the end.

Who can reach it​

Access codeWhat /mcp asks for
OffNothing. Anyone who can reach the port can read your portfolio.
OnAn access token with the /mcp, for Claude Desktop scope, sent as Authorization: Bearer <token>. Without it the server answers 401.

Access tokens exist only while an access code is set. Create one in Settings → Security, under Access tokens. The token is shown once. Turning the access code off deletes every token. See Secure access.

warning

Over plain HTTP, the token travels unencrypted. To reach the app from outside your network, put it behind a VPN or a reverse proxy with TLS. See Configuration.

Configure your client​

Claude Desktop​

  1. Create an access token with the /mcp, for Claude Desktop scope.

  2. Copy the configuration shown under the token. It looks like this:

    {
    "mcpServers": {
    "suivi-bourse": {
    "command": "npx",
    "args": [
    "mcp-remote",
    "http://localhost:8080/mcp",
    "--header",
    "Authorization: Bearer sb_1a2b3c4d_xxxxxxxxxxxx"
    ]
    }
    }
    }
  3. Paste it into claude_desktop_config.json, merging it with any servers already listed there.

  4. Restart Claude Desktop.

This configuration needs Node.js on the computer that runs Claude Desktop. Without an access code, remove the --header line, the line after it, and the comma after the address.

Claude Code​

claude mcp add --transport http suivi-bourse http://localhost:8080/mcp \
--header "Authorization: Bearer sb_1a2b3c4d_xxxxxxxxxxxx"

Type /mcp in Claude Code to check that the server is connected.

Another client​

Give the client the address and, if the access code is on, the header Authorization: Bearer <token>. Choose the HTTP or Streamable HTTP transport.

Tools​

The client chooses among these tools by itself.

ToolWhat it answers
list_positionsWhat you hold now, per account and security: quantity, cost, price, unrealised gain
get_portfolio_totalsThe portfolio on its latest day: value, cash, net contributions, money-weighted and time-weighted returns
get_portfolio_historyValue and return day by day over a window (one year by default)
list_accountsEach account with its latest figures, to compare accounts and see how you are spread
list_eventsYour ledger, newest first, optionally for one security
get_investment_rhythmHow much you buy in a month and how often, over the last 12 months
get_benchmark_comparisonThe same money, on the same days, put in your reference fund, against what you did
simulate_saleWhat selling a number of units of one holding would raise, net of the tax your taxation model projects
get_profileThe facts about you that you confirmed in the app, and your projects
propose_profile_factProposes a fact you stated, such as your tax rate; you confirm it in the app
propose_eventsProposes ledger events you stated, on accounts that exist; you review them in the import preview

Amounts are in your base currency, except the price list_positions also gives in the security's own currency. A missing figure comes back empty, never as zero.

What it cannot do​

  • No tool writes an event, an account or a setting. A simulated sale records nothing.
  • No tool confirms a proposal. Proposed facts and events wait for you in the app, and expire after 7 days. If a client says it recorded a purchase, it did not.
  • No tool looks up a security outside your portfolio, so the server cannot answer requests for stock tips.

Your figures leave your machine once a client reads them. If the client runs on a hosted model, your holdings and ledger go to that model's provider.

Troubleshooting​

SymptomWhat to check
401 UnauthorizedThe access code is on and the token is missing, wrong, revoked, expired, or lacks the /mcp scope. Create or regenerate a token.
The client cannot connectOpen http://<your-host>:8080/health from the same computer. If it does not answer, the port is not reachable from there.
Claude Desktop shows no serverCheck that npx runs on that computer, and that the JSON is valid. Restart Claude Desktop.
Figures are emptyThe app has no figure yet: the base currency is not set, or the history is still being rebuilt. See Rebuild and resolution.