Rotki MCP Server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Rotki MCP Server Show me my portfolio overview"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Rotki MCP Server
A Model Context Protocol (MCP) server that provides seamless integration with Rotki portfolio tracker. This server exposes Rotki's functionality through intuitive, jobs-to-be-done tools for AI assistants like Claude.
Author
Dennison Bertram (@dennisonbertram) Email: dennison@dapphero.io
Related MCP server: finanze-mcp
Features
7 Production-Ready Tools for portfolio management
Real-time crypto prices (BTC, ETH, stablecoins, etc.)
Portfolio overview with net worth and allocation
Transaction history with flexible filtering
Resource endpoints for portfolio summaries
Input validation using Zod schemas
Comprehensive error handling
stdio transport for Claude Desktop/Code integration
Prerequisites
Node.js 18+
pnpm 10+
A running Rotki instance (default:
http://127.0.0.1:4242)
Installation
# Clone the repository
git clone https://github.com/dennisonbertram/mcp-rotki.git
cd mcp-rotki
# Install dependencies
pnpm install
# Build the server
pnpm buildConfiguration
Environment Variables
ROTKI_MCP_BASE_URL- Rotki API base URL (default:http://127.0.0.1:4242/api/1)ROTKI_MCP_TIMEOUT_MS- HTTP timeout in milliseconds (default:120000)ROTKI_MCP_USER- Optional: Rotki username for auto-loginROTKI_MCP_PASSWORD- Optional: Rotki password for auto-loginROTKI_MCP_ALLOW_LOGIN_TOOL- Enable login tool (default:false)
Claude Desktop/Code Integration
Add to your Claude configuration file:
macOS: ~/.config/claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"rotki-mcp": {
"type": "stdio",
"command": "node",
"args": ["/absolute/path/to/mcp-rotki/dist/server.js"],
"env": {
"ROTKI_MCP_BASE_URL": "http://127.0.0.1:4242/api/1",
"ROTKI_MCP_TIMEOUT_MS": "120000"
}
}
}
}Important:
Replace
/absolute/path/to/mcp-rotkiwith your actual pathRestart Claude Desktop/Code after updating the config
Ensure Rotki is running and unlocked
Available Tools
Portfolio Management
get_portfolio_overview
Get a complete portfolio snapshot with net worth, allocation, and top positions.
Parameters:
currency(optional): Target currency (default: "USD")
Example:
"Show me my portfolio overview"get_positions
View open positions across exchanges and blockchain networks.
Parameters:
include_protocols(optional): Include DeFi protocol positions
Example:
"What are my current positions?"get_prices
Fetch real-time asset prices.
Parameters:
assets(required): Array of asset identifiers (e.g., ["BTC", "ETH"])currency(optional): Target currency (default: "USD")at_time_ms(optional): Historical timestamp
Example:
"Get current prices for BTC and ETH"Transaction History
list_transactions
List recent transactions within a time window.
Parameters:
window_days(optional): Days to look back (1-365, default: 30)limit(optional): Max results (1-500, default: 200)offset(optional): Pagination offset
Example:
"Show me transactions from the last 7 days"find_transactions
Search transactions with specific filters and time range.
Parameters:
from_ts_ms(required): Start timestamp in millisecondsto_ts_ms(required): End timestamp in millisecondslimit(optional): Max resultsoffset(optional): Pagination offsettx_hashes(optional): Filter by transaction hashescounterparties(optional): Filter by counterparties
Example:
"Find transactions between January 1st and February 1st"explain_transaction
Get detailed information about a specific transaction.
Parameters:
txhash(required): Transaction hash
Example:
"Explain transaction 0x123..."Analytics
counterparty_summary
View aggregated activity by counterparty.
Parameters:
from_ts_ms(optional): Start timestampto_ts_ms(optional): End timestamptop_n(optional): Return top N counterparties (1-100)
Example:
"Show me my top counterparties"Resources
rotki://user/summary
Portfolio summary resource with totals, allocation, and recent PnL.
Format: application/json
Prompts
summarize_portfolio
Guided prompt to analyze portfolio risk and allocations.
Parameters:
horizon(optional): Time horizon (e.g., "30d", "90d", "1y")
Development
# Run in development mode
pnpm dev
# Build for production
pnpm build
# Type check
pnpm typecheckTesting
Manual stdio Testing
# Test initialize
echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1.0.0"}}}' | node dist/server.js
# Test tool call
echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1.0.0"}}}
{"jsonrpc":"2.0","method":"notifications/initialized","params":{}}
{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"get_prices","arguments":{"assets":["BTC","ETH"]}}}' | node dist/server.jsUsing the Test Scripts
# SDK-based test
pnpm exec tsx scripts/test-stdio.ts
# Bash-based test
./scripts/test-stdio-bash.shArchitecture
Design Philosophy
This server follows a jobs-to-be-done approach, providing high-level tools that abstract Rotki's REST API complexity:
Single tools compose multiple API calls when needed
Clear input validation with descriptive error messages
Consistent response formats
Proper error handling with
isErrorflags
File Structure
mcp-rotki/
├── src/
│ ├── server.ts # MCP server with tool/resource registration
│ ├── rotki.ts # Thin REST client for Rotki API
│ └── types.ts # TypeScript type definitions
├── scripts/
│ ├── test-stdio.ts # SDK-based test
│ └── test-stdio-bash.sh # Bash-based test
├── dist/ # Compiled output
├── package.json
├── tsconfig.json
└── README.mdSecurity
Never commit secrets: Use environment variables for credentials
Read-only by default: Server only queries data, no modifications
Local-first: Designed for local Rotki instances
Validated inputs: All parameters validated with Zod schemas
Troubleshooting
Server not appearing in Claude
Check config path: Ensure the path to
dist/server.jsis absoluteRestart Claude: Configuration is only loaded on startup
Check logs: Look for MCP connection errors in Claude's logs
Verify build: Run
pnpm buildto ensure server is compiled
Rotki connection errors
Is Rotki running? Check
http://127.0.0.1:4242/api/1/pingIs Rotki unlocked? Some endpoints require authentication
Check base URL: Verify
ROTKI_MCP_BASE_URLenvironment variableCheck timeout: Increase
ROTKI_MCP_TIMEOUT_MSif needed
Tool validation errors
All tools use strict Zod validation. Common issues:
Empty arrays: Some parameters require at least 1 item (e.g.,
assets)Missing required fields: Check the tool's
inputSchemafor required parametersInvalid ranges: Some numbers have min/max constraints (e.g.,
window_days: 1-365)
Roadmap
Add WebSocket support for real-time updates
Implement resource subscriptions
Add more advanced DeFi protocol integrations
Support for historical PnL calculations
Multi-user support
Contributing
Contributions are welcome! Please:
Fork the repository
Create a feature branch
Make your changes with tests
Submit a pull request
License
MIT License - See LICENSE file for details
Related Projects
Rotki - Open source portfolio tracker
Model Context Protocol - MCP specification
Claude Desktop - AI assistant with MCP support
Support
Issues: GitHub Issues
Rotki Docs: rotki.readthedocs.io
MCP Docs: modelcontextprotocol.io
Built with ❤️ for the Rotki and MCP communities
Available Tools
7 toolscounterparty_summaryCounterparty SummaryB
Get aggregated volume and counts by counterparty
Inputs: top_n, to_ts_ms, from_ts_ms.
explain_transactionExplain TransactionA
Get a human-readable explanation and structured event list for a transaction
Inputs: txhash (required).
find_transactionsFind TransactionsC
Find transactions within a specific time range with optional filters
Inputs: to_ts_ms (required), from_ts_ms (required), limit, offset, +2 more.
get_portfolio_overviewPortfolio OverviewB
Get net worth, allocation, and top positions snapshot.
Inputs: currency.
get_positionsGet PositionsB
Get open positions across exchanges and chains
Inputs: include_protocols.
get_pricesGet Asset PricesA
Get latest or historical prices for specified assets
Inputs: assets (required), currency, at_time_ms.
list_transactionsList Recent TransactionsC
List recent transactions within a time window
Inputs: limit, offset, window_days.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
list_transactions and find_transactions are nearly identical in scope, differing only by framing and optional filters, which will cause selection confusion. get_portfolio_overview and get_positions also overlap around positions, so several tools have unclear boundaries.
Most tools follow a get_/list_/find_/explain_ verb_noun pattern, but counterparty_summary is a bare noun and uses a different style. The inconsistency is minor and the naming remains predictable overall.
Seven tools is well within the ideal range and each maps to a meaningful facet of the Rotki domain: overview, transactions, positions, prices, and counterparties. There is no feeling of bloat or excessive fragmentation.
The set covers core portfolio tracking needs: overview, positions, transactions, prices, and counterparty aggregation. Minor gaps exist, such as asset metadata or per-transaction lookup, but these do not seriously block common workflows.
Maintenance
Related MCP Connectors
Read-only access to your own crypto portfolio across 11+ exchanges and 20+ chains: holdings, full history, FIFO cost basis and P&L, fees and income. Ask Claude or ChatGPT about your portfolio; the connector can never trade, move funds or act as a login.
Connect brokerage accounts to AI assistants: holdings, orders, asset lookup, and approved trading.
Connect your portfolio to Claude, ChatGPT, or Codex to analyze it and make smarter investments.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables AI agents to retrieve real-time data on wallet DeFi positions, token balances, and NFT holdings across multiple blockchains. It supports hundreds of protocols and provides specialized tools for chain-specific or protocol-specific portfolio analysis.824 npm3MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to read and query a Finanze self-hosted portfolio manager using natural language, including net worth, positions, and financial calculations.MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI assistants to access live blockchain data across multiple networks, including wallet holdings, payment verification, token prices, swaps, and scam checks.MIT
- AlicenseNot gradedqualityAmaintenanceExposes 250+ financial data tools to AI assistants, enabling access and analysis of stocks, company fundamentals, ETFs, crypto, forex, commodities, economic indicators, and market insights.624 npmApache 2.0