- Home
- MCP servers
- Datai
Datai
- typescript
3
GitHub Stars
typescript
Language
4 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"datai-network-datai-mcp-server": {
"command": "node",
"args": [
"/path/to/your/datai-mcp/dist/index.js"
],
"env": {
"PORT": "3099",
"DEBUG": "true",
"NODE_ENV": "production",
"DATAI_LIMIT": "1",
"DATAI_API_KEY": "your_api_key_here",
"MCP_DISABLE_PINGS": "true",
"DATAI_DEBUG_TRUNCATE": "true",
"DATAI_RESPONSE_TIMEOUT": "90000",
"DATAI_CONNECTION_TIMEOUT": "130000"
}
}
}
}Datai MCP Server provides real-time wallet portfolio data and DeFi insights to AI agents and developer stacks. By connecting to the Datai API, you can query DeFi positions, token balances, and chain-specific data to power copilots, plugins, and autonomous agents with accurate, up-to-date wallet context.
How to use
You integrate Datai MCP Server with your MCP-ready client (for example, Eliza, Cursor, or Claude) to fetch wallet portfolio data on demand. Connect a user’s wallet address, then issue tool calls to retrieve DeFi positions, balances, and chain-specific metrics. Use the full portfolio tool to scan across chains, or target a single chain or protocol to narrow results. The server handles data retrieval, error handling, and timing so you can focus on agent logic and prompts.
How to install
Prerequisites: ensure you have Node.js v18 or higher and npm or yarn installed. You also need a Datai API key to access the data pipeline.
Step by step setup and run flow for local development and integration with your MCP client:
# 1) Clone the MCP server repository
git clone https://github.com/Datai-Network/datai-fastmcp-server.git
cd datai-fastmcp-server
# 2) Install dependencies
npm install
# 3) Build the TypeScript project
npm run build
# 4) Start using the tools in your MCP-compatible client by configuring your local MCP server as shown in the local config snippet below
Additional sections
Environment variables you can configure for the MCP server are listed below. These values control API access, timing, and debugging. Use secure handling for your API key and other sensitive data.
Configuration and environment
The MCP server can be run in local development mode with a direct Node command or via NPX for a quick, centralized setup. The configuration snippets below show how to attach environment variables and start the server in each mode.
Security and notes
Protect your API key and use secure environment management. All inputs are validated and errors are sanitized. Expect that extremely large responses may occur with wallets holding many tokens or interacting across multiple chains. Consider truncation for debugging and testing.
Tools and data flow overview
You can retrieve portfolio data using a set of tools that cover DeFi positions, balances, and overall wallet metrics across one or more chains. Use the full portfolio fetch for a comprehensive view, or narrow queries by chain or protocol to optimize prompts and reasoning.
Available tools and endpoints
The server exposes a collection of tools to access a wallet’s DeFi positions and balances across supported chains and protocols.
Local development configurations
Use the following local development configuration to connect Cursor or another MCP client to your running MCP server on your machine.
{
"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 with NPX
If you prefer running the MCP server via NPX for quick trials, use the following production configuration. This starts the server using a published MCP package.
{
"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"
}
}
}
}
Environment variables
Key variables and their purposes are listed here so you can tailor the server to your environment.
DATAI_API_KEY: Your Datai API key (required)
DATAI_LIMIT: API response limit (1-100) – default 10
DATAI_DEBUG_TRUNCATE: Enable data truncation for debugging
DATAI_CONNECTION_TIMEOUT: Connection timeout in ms
DATAI_RESPONSE_TIMEOUT: Response timeout in ms
DEBUG: Enable debug logging
PORT: Server port (default 3099)
Available tools
get_all_defi_positions
Get all DeFi positions across all supported chains
get_defi_by_chain
Get DeFi positions for a specific blockchain
get_defi_multi_chains
Get DeFi positions across multiple chains
get_defi_by_protocol
Get DeFi positions for a specific protocol
get_defi_balances_by_chain
Get DeFi protocol balances by chain
get_overall_balance_all_c
Get overall balance across all chains
get_overall_balance_by_chain
Get overall balance for a specific chain
get_wallet_balances_by_chain
Get token balances for a specific chain