
A stateless streamable HTTP MCP server for interacting with the official source of government spending data.

An MCP server that bridges AI agents to the Toshl Finance API, exposing financial data such as accounts, categories, tags, budgets and entries.
Toshl Finance MCP server is cataloged as an MCP server attributed to hktari. An MCP server that bridges AI agents to the Toshl Finance API, exposing financial data such as accounts, categories, tags, budgets and entries. It is categorized under finance crypto. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.
Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.
Catalog license label: MIT. Check the source repository's current license and terms before using, modifying or distributing this software.
Capability definitions are not reviewed. Unreviewed imports are not exposed as trusted interfaces.
No reviewed records to display. This does not establish that upstream lacks this capability.
No reviewed records to display. This does not establish that upstream lacks this capability.
No reviewed records to display. This does not establish that upstream lacks this capability.
Email delivery is not connected. This page does not collect email addresses or create subscriptions.
Browse the registry for current listings instead.
Reviews for Toshl Finance MCP server are not available yet
Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.
Yes. It requires a Toshl Finance API token, passed via the TOSHL_API_TOKEN environment variable; the server can also support multi-user sign-in with Toshl OAuth.
Yes. stdio is the default, but it can be switched to Streamable HTTP for clients that cannot spawn a local process.
README.md · 7c0eb8a24b21 · Fetched 2026-11-13 10:47:57 UTC
Original upstream text, without AI rewriting. Scripts, forms and unsafe links are filtered for safety.
Showing the last retrieved documentation snapshot; check the source for current changes.
An MCP (Model Context Protocol) server for integrating Toshl Finance with AI agents.
The Toshl MCP Server provides a bridge between AI agents and the Toshl Finance API. It allows AI agents to access financial data from Toshl, analyze it, and provide insights and advice based on the data.
READ access to Toshl Finance API endpoints:
MCP Resources:
MCP Tools:
git clone https://github.com/hktari/toshl-mcp-server.git
cd toshl-mcp-server
npm install
.env file based on the .env.example file:cp .env.example .env
.env file and add your Toshl API token:TOSHL_API_TOKEN=your_api_token
Build the project:
npm run build
Start the server:
npm start
The server speaks MCP over stdio. Point your client at dist/index.js and pass
TOSHL_API_TOKEN in its environment — step-by-step instructions for Claude Code,
OpenCode, and Codex CLI are in docs/mcp-clients.md.
For any other client that takes a generic mcpServers config:
{
"mcpServers": {
"toshl": {
"command": "node",
"args": ["/absolute/path/to/toshl-mcp-server/dist/index.js"],
"env": {
"TOSHL_API_TOKEN": "your-token"
}
}
}
}
stdio is the default and needs nothing below. To reach the server from clients that can't spawn a local process (web and mobile apps, a server you run elsewhere), switch it to Streamable HTTP:
MCP_TRANSPORT=http MCP_AUTH_TOKEN="$(openssl rand -hex 32)" TOSHL_API_TOKEN=your-token npm start
It serves:
| Path | Methods | Checks | Purpose |
|---|---|---|---|
/mcp | POST, GET, DELETE | Host, Origin, bearer token (static or OAuth) | MCP endpoint, one session per client |
/healthz | GET, HEAD | Host | Liveness check. Returns {"status":"ok"} and nothing else |
/.well-known/oauth-*, /oauth/* | see Sign-in with OAuth | Host | Only when OAuth is on |
| Variable | Default | Meaning |
|---|---|---|
MCP_TRANSPORT | stdio | stdio or http |
MCP_HTTP_HOST | 127.0.0.1 | Interface to bind |
MCP_HTTP_PORT | 3000 | Port to bind |
MCP_AUTH_TOKEN | unset | /mcp requires Authorization: Bearer <token>. At least 32 characters. Required in HTTP mode unless OAuth is on or MCP_ALLOW_NO_AUTH=true |
MCP_ALLOW_NO_AUTH | unset | true (exactly) lets HTTP mode start without MCP_AUTH_TOKEN. Only for a proxy that authenticates every request |
MCP_ALLOWED_HOSTS | unset | Comma-separated Host names accepted besides localhost, 127.0.0.1 and [::1] |
MCP_ALLOWED_ORIGINS | unset | Comma-separated origins (https://host[:port]) accepted in an Origin header on /mcp |
Anyone who can get a request through to /mcp can read and change your Toshl data.
Each layer below closes a different path to it:
MCP_AUTH_TOKEN or the built-in OAuth server, which is how
claude.ai connectors sign in. To use an authenticating proxy in front instead, set
MCP_ALLOW_NO_AUTH=true. The server then logs a
SECURITY WARNING at error level on every start. Never expose /mcp without
authentication, and don't count on an unguessable URL to protect it.Host must be loopback or listed in
MCP_ALLOWED_HOSTS. That stops a web page you visit from pointing its own name at
127.0.0.1 and driving a local server. A proxy usually forwards the public name as
Host, so list that name./mcp validates Origin. Requests without
one are accepted, because native clients, CLIs and server-side connectors don't send it.
A present Origin, including the opaque null, must be listed in MCP_ALLOWED_ORIGINS
or the request gets 403, before authentication is even checked. The list is empty by
default, so no browser page can call /mcp unless you allow it.# Caddyfile: automatic TLS, forwards Host unchanged
example.com {
reverse_proxy 127.0.0.1:3000
}
MCP_ALLOWED_HOSTS=example.com
claude.ai connectors (on the web, Desktop, mobile and Cowork) sign in with OAuth rather
than a fixed header. The server has a small OAuth 2.1 authorization server of its own for
that. There is a single user, and approving a client means typing a passphrase you set.
Add https://<your host>/mcp as a custom connector in Claude and leave the OAuth client
on "Use Claude's published identity".
| Variable | Meaning |
|---|---|
MCP_PUBLIC_URL | Public origin, e.g. https://example.com, without a path. The MCP URL is <MCP_PUBLIC_URL>/mcp. Its host is added to MCP_ALLOWED_HOSTS automatically |
MCP_OAUTH_PASSPHRASE | Typed on the sign-in page to approve a client. At least 20 characters |
MCP_OAUTH_SIGNING_KEY | Signs access tokens and sign-in forms. At least 32 characters (openssl rand -hex 32) |
MCP_OAUTH_SIGNING_KEY_PREVIOUS | Optional. A retired key that still verifies, for rotation without signing everyone out |
MCP_OAUTH_STATE_DIR | Where refresh-token hashes are kept. Must survive restarts (/app/state in the image) |
MCP_TRUST_PROXY | true to rate-limit by the client address the proxy appends to X-Forwarded-For. Turn it on behind a proxy, where otherwise every client shares the proxy's address and one IP's lockout locks out everyone. Leave it off when clients can reach the port directly, because they could then forge the header |
MCP_CLIENT_IP_HEADER | A header the proxy in front overwrites with the client address, e.g. x-real-ip on Railway. Used for rate limiting instead of the last X-Forwarded-For entry, which behind Railway is one of Railway's own hops and changes per request. Needs MCP_TRUST_PROXY=true |
OAuth turns on when the passphrase and signing key are set. It works alongside
MCP_AUTH_TOKEN, so Claude Code or a script can keep using a static token.
How it behaves:
https://claude.ai/api/mcp/auth_callback) and Claude
Code (loopback callbacks on localhost and 127.0.0.1, any port, RFC 8252) are
accepted. Both are pinned by their published client IDs. The server never fetches the
metadata documents, so it still contacts no host but the Toshl API. Dynamic client
registration is not offered.resource parameter must name this server, and
tokens are bound to it.MCP_OAUTH_SIGNING_KEY and not
stored anywhere. Changing the key without keeping the old one as _PREVIOUS
invalidates every access token at once.MCP_OAUTH_STATE_DIR/refresh-tokens.json.
The passphrase mode above serves one person. With a Toshl OAuth app, one hosted server serves
anyone with a Toshl account: they add https://<your host>/mcp as a custom connector in Claude,
click Connect, sign in to Toshl and approve. No personal token, no passphrase.
https://<your host>/oauth/toshl/callback and the scopes the tools need
(user:r, entries:rw, accounts:r, budgets:r, categories:rw, tags:rw). Until Toshl
approves the app for other users, only your own account can sign in.TOSHL_OAUTH_CLIENT_ID and TOSHL_OAUTH_CLIENT_SECRET instead of MCP_OAUTH_PASSPHRASE,
alongside MCP_PUBLIC_URL, MCP_OAUTH_SIGNING_KEY and MCP_OAUTH_STATE_DIR. Leave
TOSHL_API_TOKEN and MCP_AUTH_TOKEN unset; the server refuses to start with either.How it works: Claude's sign-in is handed to Toshl's, and our callback stores the user's Toshl
tokens in <MCP_OAUTH_STATE_DIR>/toshl-tokens.json, encrypted (AES-256-GCM, key derived from
MCP_OAUTH_SIGNING_KEY). Every /mcp request runs as the user its access token names: that
user's Toshl token (refreshed before it expires), that user's cache entries, and only sessions that
user opened. If Toshl revokes the grant, the user's tokens are deleted and Claude asks them to
connect again. Design notes: docs/superpowers/specs/2026-11-13-sign-in-with-toshl-design.md.
Toshl issues OAuth apps on request only; developer.toshl.com/apps
offers personal tokens. Until an OAuth app exists, set MCP_SIGN_IN=personal-token instead of the
Toshl client variables. The consent page then asks each person to create a personal token in
Toshl and paste it once. The server checks it against Toshl's /me, stores it encrypted under
that user, and everything else works as in Sign in with Toshl: per-user requests, cache and
sessions. Wrong tokens count towards the sign-in lockout. Deleting the token in Toshl disconnects
the user; Claude then asks them to connect again. Each connection is logged with the number of
connected users.
A server that holds other people's financial data should say who runs it. Set MCP_OPERATOR_NAME
(and optionally MCP_OPERATOR_URL, MCP_TERMS_URL, MCP_PRIVACY_URL, all https) and the consent
page shows "Run by …", states that the service is independent of Toshl and Anthropic, and that
connecting means agreeing to the terms of use.
Sessions are held in memory. A session with no request for 30 minutes is closed, and the
client opens a new one on its next call. SIGTERM and SIGINT close every session
before exiting.
The Dockerfile builds an image that starts in HTTP mode, listening on port 3000 as the
unprivileged node user. Inside the container it binds 0.0.0.0 so the published port
can reach it. Publish that port on loopback only, and pass secrets at run time; the image
contains none:
docker build -t toshl-mcp-server .
docker run -d --restart unless-stopped \
-p 127.0.0.1:3000:3000 \
--env-file /path/outside/the/repo/toshl-mcp.env \
toshl-mcp-server
The env file holds TOSHL_API_TOKEN, MCP_ALLOWED_HOSTS, and either MCP_AUTH_TOKEN or
the OAuth settings. Without any of them the container exits at startup unless
MCP_ALLOW_NO_AUTH=true. Make the file readable only by its owner (chmod 600).
.dockerignore keeps every .env* file out of the build context.
With OAuth on, mount a volume at /app/state (writable by uid 1000) so sign-ins survive
redeploys, e.g. -v /srv/toshl-mcp/state:/app/state.
Run the server in development mode:
npm run dev
toshl-mcp-server/
├── src/
│ ├── index.ts # Entry point
│ ├── server/ # MCP server implementation
│ │ └── server.ts # Main server class
│ ├── api/ # Toshl API client
│ │ ├── toshl-client.ts # Base API client
│ │ ├── auth.ts # Authentication module
│ │ └── endpoints/ # Endpoint-specific clients
│ │ ├── accounts.ts # Accounts API client
│ │ ├── categories.ts # Categories API client
│ │ ├── tags.ts # Tags API client
│ │ ├── budgets.ts # Budgets API client
│ │ ├── entries.ts # Entries API client
│ │ ├── me.ts # User API client
│ │ └── planning.ts # Planning API client
│ ├── resources/ # MCP resource handlers
│ │ ├── account-resources.ts # Account resources
│ │ ├── category-resources.ts# Category resources
│ │ ├── tag-resources.ts # Tag resources
│ │ ├── budget-resources.ts # Budget resources
│ │ └── user-resources.ts # User resources
│ ├── tools/ # MCP tool handlers
│ │ ├── account-tools.ts # Account tools
│ │ ├── category-tools.ts # Category tools
│ │ ├── tag-tools.ts # Tag tools
│ │ ├── budget-tools.ts # Budget tools
│ │ ├── user-tools.ts # User tools
│ │ └── analysis-tools.ts # Financial analysis tools
│ └── utils/ # Utility functions
│ ├── cache.ts # Caching utilities
│ ├── error-handler.ts # Error handling utilities
│ ├── logger.ts # Logging utilities
│ └── types.ts # TypeScript type definitions
├── dist/ # Compiled JavaScript files
├── .env # Environment variables
├── .env.example # Example environment variables
├── package.json # Project dependencies
├── tsconfig.json # TypeScript configuration
└── README.md # Project documentation
The server can be configured using environment variables:
TOSHL_API_TOKEN: Your Toshl API tokenTOSHL_API_BASE_URL: The base URL for the Toshl API (default: https://api.toshl.com)MCP_SERVER_NAME: The name of the MCP server (default: toshl-mcp-server)MCP_SERVER_VERSION: The version of the MCP server (default: 0.1.0)CACHE_TTL: Time to live for cached data in seconds (default: 3600)CACHE_ENABLED: Whether caching is enabled (default: true)LOG_LEVEL: Logging level (default: info)MCP_TRANSPORT, MCP_HTTP_HOST, MCP_HTTP_PORT, MCP_AUTH_TOKEN, MCP_ALLOW_NO_AUTH,
MCP_ALLOWED_HOSTS, MCP_ALLOWED_ORIGINS:
see Remote use (Streamable HTTP)MIT
Claim this server with your GitHub account to request manual ownership verification.
Link to the catalog listing for Toshl Finance MCP server from your README. This badge does not certify ownership, compatibility or security.
[](https://awesome-mcp.com/servers/toshl-mcp-server)Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.
Separate sources, scopes and periods. Never combined or treated as installations, active users or security reviews.
No reviewed package or image identity; download statistics are not listed yet.
Alternative and complementary servers in the same category

A stateless streamable HTTP MCP server for interacting with the official source of government spending data.

A hosted, remote MCP server for Fortnox that lets AI assistants answer questions from a company's bookkeeping and propose changes for approval before writing them.

OptimistFi is a read-only remote MCP server that provides perpetual futures market data, perps prop firm rules and pricing, and US equity investment research.