kraken-portfolio-mcp
MCP server that integrates with Kraken Futures and Spot APIs to track portfolio, compute FIFO cost basis, and generate German crypto tax reports.
README
Kraken Portfolio
A portfolio tracker and tax tool for Kraken day traders in Germany. Connects to the Kraken Futures and Spot APIs, computes FIFO cost basis, and tells you if you owe tax.
What you get
Dashboard at http://localhost:8000 with:
- Cash balance across Futures and Spot accounts
- Tax overview with filing status (single/married) and allowance calculations
- Futures P&L and Spot P&L summaries
- Merged transaction history with source filtering, date range, and pagination
- Positions table with sorting, side filtering (Long/Short), and source filtering
- Everything filterable by year, shareable via URL
MCP Server for AI assistants (Claude Code, Cursor, Codex) to query your portfolio and generate tax reports.
REST API for programmatic access to all your Kraken data.
Quick start
git clone <repo-url> && cd kraken-portfolio-mcp
npm install
Create .env:
KRAKEN_FUTURES_PUBLIC_KEY=your_key
KRAKEN_FUTURES_PRIVATE_KEY=your_key
KRAKEN_SPOT_API_KEY=your_key
KRAKEN_SPOT_API_SECRET=your_key
Run:
npm run dev # dashboard with auto-reload
npm start # production
npm run mcp # MCP server for AI assistants
Open http://localhost:8000 and hit Sync.
Tax reporting
Built for German tax law. The dashboard shows a live tax overview per year. For a detailed report, ask your AI assistant:
Generate my German crypto tax report for 2025
The MCP tool handles everything:
- Spot trades FIFO cost basis, 1-year holding period check, Freigrenze (1,000 EUR)
- Margin positions P&L classified under private sales
- Futures realized P&L + funding fees, Sparerpauschbetrag (1,000/2,000 EUR), 20k loss cap
- Staking rewards at EUR fair market value, 256 EUR Freigrenze
Returns Elster line references and a CSV for WISO Steuer or Taxfix.
API
Futures
| Endpoint | Returns |
|---|---|
GET /futures/balances |
Flex + cash account balances |
GET /futures/positions |
Closed position history with P&L |
GET /futures/transactions |
Realized P&L, funding fees, transfers |
Spot
| Endpoint | Returns |
|---|---|
GET /spots/balances |
All non-zero balances |
GET /spots/positions |
Closed margin positions with P&L |
GET /spots/transactions |
Full history with FIFO cost basis |
Other
| Endpoint | Returns |
|---|---|
GET / |
Dashboard |
GET /sync |
SSE stream for full data sync |
GET /health |
Server status |
MCP setup
Add to your AI client config:
{
"mcpServers": {
"kraken-portfolio": {
"command": "npx",
"args": ["tsx", "/path/to/kraken-portfolio-mcp/src/mcp-server.ts"],
"env": {
"KRAKEN_FUTURES_PUBLIC_KEY": "...",
"KRAKEN_FUTURES_PRIVATE_KEY": "...",
"KRAKEN_SPOT_API_KEY": "...",
"KRAKEN_SPOT_API_SECRET": "..."
}
}
}
}
Available tools
| Tool | What it does |
|---|---|
kraken_tracker_futures_balances |
Futures account balances |
kraken_tracker_futures_positions |
Closed futures positions |
kraken_tracker_futures_transactions |
Futures transaction history |
kraken_tracker_spot_balances |
Spot balances |
kraken_tracker_spot_positions |
Spot margin positions |
kraken_tracker_spot_transactions |
Spot transactions with FIFO |
kraken_tracker_portfolio_summary |
Combined portfolio overview |
kraken_tracker_german_tax_report |
Full German tax report with CSV |
Tech
- TypeScript + Express
- MCP SDK for AI tool integration
- FIFO lot tracking for cost basis
- Server-Sent Events for live sync
- CoinGecko API for crypto icons
- No frontend framework single self-contained HTML page
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
Neon Database
MCP server for interacting with Neon Management API and databases
E2B
Using MCP to run code via e2b.
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.