Datai MCP Server

by datai-network

Not rated
GitHub

About

Provides real-time wallet portfolio data, including DeFi, token, and NFT holdings, using the Datai API.

Details

Author
datai-network
Categories
Database, Other, Finance

Production Configuration Npx Coming Soon

{ "mcpServers": { "datai-fastmcp-server": { "command": "npx", "args": ["-y", "datai-mcp-server@1.0.3"], "env": { "DATAI_API_KEY": "your_api_key_here", "DATAI_LIMIT": "1", "DATAI_DEBUG_TRUNCATE": "true", "DATAI_CONNECTION_TIMEOUT": "130000", "DATAI_RESPONSE_TIMEOUT": "90000", "PORT": "3099", "DEBUG": "true", "NODE_ENV": "production", "MCP_DISABLE_PINGS": "true" } } } }

WhenDATAI_DEBUG_TRUNCATEis set to"true", the server will intelligently truncate API responses to prevent memory issues during development and testing. This provides:

- Minimal Output: Reduces 1000+ line responses to ~15 lines
- Structure Preservation: Shows data types, array lengths, object keys
- Sample Data: First few items/values for verification
- Clear Status: Indicates when truncation is active

{ "__debug_truncated": true, "__summary": { "type": "array", "length": 25, "item_types": ["object"], "first_item_keys": ["chain", "name", "commonName", "logo", "site"] }, "__sample_data": { "chain": "eth", "name": "uniswap3", "commonName": "Uniswap V3" }, "__message": "✅ Tool working - data truncated for debugging" }

To connect to the MCP server from Claude Desktop:
- Open Claude Desktop and go to Settings
- Click on "Developer" in the left sidebar
- Click the "Edit Config" Button
- Add the configuration to theclaude_desktop_config.jsonfile
- Save the file and restart Claude Desktop

- Node.jsv18 or higher
-
npmoryarn
- Datai API key -
sign up hereto obtain your API key, email address required

git clone https://github.com/Datai-Network/datai-fastmcp-server.git cd datai-fastmcp-server

-

Configure your MCP client with the local configuration shown above

Start using the tools in your MCP-compatible client!

- npm run build: Build the TypeScript project
- npm run dev: Build and watch for changes
- npm run test: Run test suite (coming soon)

This server integrates with the Datai API to provide real-time wallet portfolio data:

- Base URL:https://api-v1.mymerlin.io
- Authentication: API key-based
- Rate Limiting: Configurable viaDATAI_LIMIT
- Timeout Handling: Configurable connection and response timeouts
- Error Handling: Comprehensive error transformation and logging

[Sign up hereto obtain your Datai API Key, email address required.

- API Key Protection: Never commit API keys to version control
- Environment Variables: Use secure environment variable management
- Input Validation: All inputs are validated using Zod schemas
- Error Sanitization: Sensitive information is filtered from error messages
- Timeout Protection: Prevents hanging requests with configurable timeouts

Datai MCP lets your AI agent understand a wallet’s DeFi, token, and NFT holdings in seconds.

Whether you're building with Eliza OS, Cursor, or any local agent stack — simply plug in a wallet address, and the MCP server delivers clean, real-time context powered by the Datai API.

Perfect for AI agents, LLM plugins, and devs needing agentic access to wallet data.

Datai MCP is a TypeScript-based MCP server that enables seamless interaction with a wallet's portfolio data through AI-powered interfaces, powered by the same API behindDatai Network's analytics engine.

- 8 Comprehensive DeFi Tools: Complete coverage of a wallet's DeFi positions and token balance analysis
- Multi-Chain Support: Ethereum, Arbitrum, Polygon, Avalanche, BSC, Base, Optimism, and more to come
- Multi-Protocol Support– Hundreds of DeFi protocols
- Fast Setup– Just plug in your wallet address, and the MCP delivers fresh on-chain data
- Built for AI Devs– Integrates with any MCP-ready agent framework (Eliza, Cursor, Claude)
- Real-Time Data– Powered by Datai’s API wallet data pipeline
- Debug-Friendly– Truncated responses for dev testing and memory-safe exploration
- Error Handling: Comprehensive error management and validation
- Performance Monitoring: Request timing and execution tracking

Example Use Case: Building an AI Wallet Copilot

You're creating an AI agent that helps users understand their crypto portfolio. With Datai MCP:
- Your user connects their wallet.
- Your agent usesget_all_defi_positionsto fetch their DeFi strategy.
- The agent summarizes key holdings, flags risk exposure, and recommends actions.

All without you needing to build a blockchain indexer.

Retrieve a wallet's portfolio data using the following tools:

Tip: Useget_all_defi_positionsfor a full portfolio scan, or chain/protocol-specific tools for targeted prompts.

- eth- Ethereum
- arb- Arbitrum
- matic- Polygon
- avax- Avalanche
- bsc- Binance Smart Chain
- base- Base
- op- Optimism
- And more to come...
access Datai's supported chains list

- Uniswap (V2, V3, V4)
- Aave (V2, V3)
- Compound
- Balancer
- SushiSwap
- Curve
- MakerDAO
- And many more...
access Datai's supported protocols list

To connect to the MCP server from Cursor:
- Open Cursor and go to Settings (gear icon in the top right)
- Click on "MCP" in the left sidebar
- Click "Add new global MCP server"
- Enter the following configuration:

{ "mcpServers": { "datai-fastmcp-server-local": { "command": "node", "args": ["/path/to/your/datai-mcp/dist/index.js"], "env": { "DATAI_API_KEY": "your_api_key_here", "DATAI_LIMIT": "1", "DATAI_DEBUG_TRUNCATE": "true", "DATAI_CONNECTION_TIMEOUT": "130000", "DATAI_RESPONSE_TIMEOUT": "90000", "PORT": "3099", "DEBUG": "true", "NODE_ENV": "production", "MCP_DISABLE_PINGS": "true" } } } }

Production Configuration (NPX - Coming Soon)

{ "mcpServers": { "datai-fastmcp-server": { "command": "npx", "args": ["-y", "datai-mcp-server@1.0.3"], "env": { "DATAI_API_KEY": "your_api_key_here", "DATAI_LIMIT": "1", "DATAI_DEBUG_TRUNCATE": "true", "DATAI_CONNECTION_TIMEOUT": "130000", "DATAI_RESPONSE_TIMEOUT": "90000", "PORT": "3099", "DEBUG": "true", "NODE_ENV": "production", "MCP_DISABLE_PINGS": "true" } } } }

WhenDATAI_DEBUG_TRUNCATEis set to"true", the server will intelligently truncate API responses to prevent memory issues during development and testing. This provides:

- Minimal Output: Reduces 1000+ line responses to ~15 lines
- Structure Preservation: Shows data types, array lengths, object keys
- Sample Data: First few items/values for verification
- Clear Status: Indicates when truncation is active

{ "__debug_truncated": true, "__summary": { "type": "array", "length": 25, "item_types": ["object"], "first_item_keys": ["chain", "name", "commonName", "logo", "site"] }, "__sample_data": { "chain": "eth", "name": "uniswap3", "commonName": "Uniswap V3" }, "__message": "✅ Tool working - data truncated for debugging" }

To connect to the MCP server from Claude Desktop:
- Open Claude Desktop and go to Settings
- Click on "Developer" in the left sidebar
- Click the "Edit Config" Button
- Add the configuration to theclaude_desktop_config.jsonfile
- Save the file and restart Claude Desktop

- Node.jsv18 or higher
-
npmoryarn
- Datai API key -
sign up hereto obtain your API key, email address required

git clone https://github.com/Datai-Network/datai-fastmcp-server.git cd datai-fastmcp-server

-

Configure your MCP client with the local configuration shown above

Start using the tools in your MCP-compatible client!

- npm run build: Build the TypeScript project
- npm run dev: Build and watch for changes
- npm run test: Run test suite (coming soon)

This server integrates with the Datai API to provide real-time wallet portfolio data:

- Base URL:https://api-v1.mymerlin.io
- Authentication: API key-based
- Rate Limiting: Configurable viaDATAI_LIMIT
- Timeout Handling: Configurable connection and response timeouts
- Error Handling: Comprehensive error transformation and logging

Sign up hereto obtain your Datai API Key, email address required.

- API Key Protection: Never commit API keys to version control
- Environment Variables: Use secure environment variable management
- Input Validation: All inputs are validated using Zod schemas
- Error Sanitization: Sensitive information is filtered from error messages
- Timeout Protection: Prevents hanging requests with configurable timeouts

Important Note on Response Size and Agent Compatibility

The Datai MCP is designed to enrich AI agents with real-time wallet portfolio data (token balances, DeFi positions). However, certain wallets can generate very large responses, especially when:

- Holding dozens or hundreds of tokens
- Engaging with multiple DeFi protocols
- Using many chains simultaneously

As of this version, responses are not summarized. The full dataset is returned by default, unless truncated. This may lead to issues in agent environments, such as:

- Exceeding LLM context limits (resulting in cut-off or ignored data)
- Slower performance or longer reasoning time
- Memory or token quota overruns in hosted environments
- Confusing or degraded agent behavior due to input overload

Until summarization and modular querying are available, we recommend:

- Using lightweight wallets for testing and debugging
- Manually filtering or summarizing MCP responses before injecting into your agent
- Keeping response size in mind when designing prompts or managing memory
- Opening an issue or contacting us if you'd like early access to summary endpoints

We are actively improving the agent compatibility layer - including modular endpoints and data summarization options in upcoming releases.

We welcome contributions! Please ensure:
- All code follows TypeScript best practices
- Comprehensive error handling is implemented
- Input validation is present for all tools
- Logging is FastMCP compliant
- Tests are included for new features

This project is licensed under the MIT License - see theLICENSEfile for details.

Datai is building the agentic data layer for Web3. We provide high-quality, real-time data pipelines powering agents, AI copilots, and smart protocols. The Datai MCP is one step in our journey to make wallet data accessible, actionable, and agent-ready.

We’re building this for the agent dev community and highly appreciate your input:

- Create an issue in the GitHub repository
- Check the documentation for common solutions
- Review the debug output whenDATAI_DEBUG_TRUNCATE=true

Interact with the Aptos blockchain, supporting both testnet and mainnet for AI applications.

Real-time DeFi lending rates across 14+ protocols (Aave, Morpho, Spark, Compound, Venus, etc). Query borrow/supply rates, c ompare platforms, calculate looping strategies on 6 chains (Ethereum, Arbitrum, Base, BSC, Solana, HyperEVM).

Lyra Registry is a standalone API service that catalogs, scores, and serves metadata for all tools in the Lyra ecosystem. It enables discovery, evaluation, and integration of 800+ crypto, blockchain, DeFi, memecoin, NFT, metaverse, trading tools, MCP tools.

Access blockchain transaction data in natural language, providing human-readable descriptions for AI assistants.

Interact with the Solana blockchain to check balances, send SOL, and airdrop SOL.

Provides comprehensive access to Solana blockchain data using 21 essential RPC methods.

Provides comprehensive DeFi analytics and data for the Algorand ecosystem through the Vestige API.

MCP to interface with multiple blockchains, staking, DeFi, swap, bridging, wallet management, DCA, Limit Orders, Coin Lookup, Tracking and more.

Interact with NAVI DeFi protocol on Sui blockchain for market data and transactions.

Zen7 Payment Agent is the first implementation project of DePA (Decentralized Payment Agent), pioneers next-generation intelligent payment infrastructure.

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.