Hosts the OpenAPI specification file used by the MCP server to automatically generate tools from the Zerion API endpoints
Zerion MCP Server
A production-ready Model Context Protocol (MCP) server that provides AI assistants with access to the Zerion API for cryptocurrency portfolio management, DeFi positions, NFTs, and market data.
Features
š Auto-generated Tools: Automatically exposes Zerion API endpoints as MCP tools via OpenAPI specification
āļø Flexible Configuration: YAML config files with environment variable overrides
š Structured Logging: JSON and text formats with sensitive data redaction
š”ļø Robust Error Handling: Custom exceptions with detailed context and troubleshooting hints
ā Comprehensive Tests: Unit and integration tests with pytest
š Async HTTP: Non-blocking API calls with httpx
Requirements
Python 3.11 or higher
Zerion API key (Get one here)
Installation
From Source
From PyPI (when published)
Quick Start
1. Set up your API key
2. Run the server
3. Connect with an MCP client
The server will start and listen for MCP protocol connections. You can connect it to AI assistants like Claude Desktop.
Claude Desktop Configuration
Add to your claude_desktop_config.json
:
Configuration
Configuration File
Create a config.yaml
file in your working directory:
See config.example.yaml
for a complete example.
Environment Variables
Environment variables override config file values:
Variable | Description | Default |
| Zerion API key (required) | - |
| Zerion API base URL |
|
| OpenAPI spec URL | GitHub raw URL |
| Path to config.yaml |
|
| Logging level |
|
| Logging format (text/json) |
|
Usage Examples
Once connected to an MCP client (like Claude), you can query Zerion data:
Portfolio Balance
The server exposes tools like getWalletChart
, getWalletPositions
, etc.
DeFi Positions
NFT Collections
All Zerion API endpoints are automatically available as MCP tools. See the Zerion API documentation for available operations.
Development
Setup Development Environment
Running Tests
Code Quality
Troubleshooting
Common Issues
"Configuration error: Missing required configuration: api_key"
Solution: Set the ZERION_API_KEY
environment variable:
"Timeout loading OpenAPI specification"
Solution: Check your internet connection. The server needs to download the OpenAPI spec from GitHub.
"Unauthorized: Invalid or missing API key"
Solution: Verify your API key is correct and includes the "Bearer " prefix:
"Rate limit exceeded"
Solution: Wait for the rate limit window to reset. Check the error message for retry_after_sec
value.
Debug Mode
Enable debug logging for detailed information:
Or in config.yaml
:
Log Interpretation
INFO: Normal operation (startup, requests)
WARN: Potential issues (slow operations)
ERROR: Failures (API errors, network issues)
DEBUG: Detailed traces (request/response bodies)
Architecture
Tech Stack
Python 3.11+: Core language
FastMCP: MCP server framework with OpenAPI integration
httpx: Async HTTP client
PyYAML: Configuration parsing
pytest: Testing framework
Contributing
Contributions are welcome! Please follow these guidelines:
Fork the repository
Create a feature branch:
git checkout -b feature/your-feature
Write tests for your changes
Ensure tests pass:
pytest
Submit a pull request
Development Workflow
Follow PEP 8 style guidelines
Add type hints to function signatures
Write docstrings for modules and functions
Update tests for any code changes
Keep commits focused and atomic
License
MIT License - see LICENSE file for details
Support
Issues: GitHub Issues
Zerion API Docs: developers.zerion.io
MCP Specification: modelcontextprotocol.io
Changelog
See CHANGELOG.md for version history and changes
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Enables AI assistants to access cryptocurrency portfolio management, DeFi positions, NFTs, and market data through the Zerion API. Automatically exposes all Zerion API endpoints as MCP tools for comprehensive crypto asset management.