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 code | What /mcp asks for |
|---|---|
| Off | Nothing. Anyone who can reach the port can read your portfolio. |
| On | An 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.
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
-
Create an access token with the /mcp, for Claude Desktop scope.
-
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"]}}} -
Paste it into
claude_desktop_config.json, merging it with any servers already listed there. -
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.
| Tool | What it answers |
|---|---|
list_positions | What you hold now, per account and security: quantity, cost, price, unrealised gain |
get_portfolio_totals | The portfolio on its latest day: value, cash, net contributions, money-weighted and time-weighted returns |
get_portfolio_history | Value and return day by day over a window (one year by default) |
list_accounts | Each account with its latest figures, to compare accounts and see how you are spread |
list_events | Your ledger, newest first, optionally for one security |
get_investment_rhythm | How much you buy in a month and how often, over the last 12 months |
get_benchmark_comparison | The same money, on the same days, put in your reference fund, against what you did |
simulate_sale | What selling a number of units of one holding would raise, net of the tax your taxation model projects |
get_profile | The facts about you that you confirmed in the app, and your projects |
propose_profile_fact | Proposes a fact you stated, such as your tax rate; you confirm it in the app |
propose_events | Proposes 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
| Symptom | What to check |
|---|---|
401 Unauthorized | The 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 connect | Open 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 server | Check that npx runs on that computer, and that the JSON is valid. Restart Claude Desktop. |
| Figures are empty | The app has no figure yet: the base currency is not set, or the history is still being rebuilt. See Rebuild and resolution. |