Get the FREE Ultimate OpenClaw Setup Guide →

datai

MCP Server of the DATAI API

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio datai-network-datai-mcp-server node /path/to/your/datai-mcp/dist/index.js \
  --env PORT="3099" \
  --env DEBUG="true" \
  --env NODE_ENV="production" \
  --env DATAI_LIMIT="1" \
  --env DATAI_API_KEY="your_api_key_here" \
  --env MCP_DISABLE_PINGS="true" \
  --env DATAI_DEBUG_TRUNCATE="true" \
  --env DATAI_RESPONSE_TIMEOUT="90000" \
  --env DATAI_CONNECTION_TIMEOUT="130000"

How to use

Datai MCP Server provides real-time wallet portfolio data via the Datai API, exposing a set of DeFi-focused tools that can be consumed by any MCP-ready agent like Eliza, Cursor, or Claude. After starting the local MCP server, you can query tools such as get_all_defi_positions to fetch a wallet's entire DeFi footprint, or target specific chains or protocols with get_defi_by_chain, get_defi_by_protocol, and related endpoints. The server is designed to be debug-friendly with an optional data truncation mode to simplify testing and exploration, while offering robust error handling and performance monitoring to help you integrate wallet insights into your AI workflows. You can use this MCP as a backend context provider for AI wallet copilots, portfolios dashboards, or agent prompts that require up-to-date DeFi positions, balances, and protocol exposure across supported chains like Ethereum, Arbitrum, Polygon, and more.

How to install

Prerequisites:

  • Node.js v18+ installed on your machine
  • npm or yarn installed
  • A Datai API key (sign up at the Datai API portal and obtain your key)

Step-by-step:

  1. Clone the repository:
git clone https://github.com/Datai-Network/datai-fastmcp-server.git
cd datai-fastmcp-server
  1. Install dependencies:
npm install
  1. Build the TypeScript project (if applicable):
npm run build
  1. Prepare your MCP client configuration:
  • For local development, use the following example 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"
      }
    }
  }
}
  1. Start the MCP server using your client/ orchestration tool with the above configuration. Ensure the server port (default 3099) is accessible to your agent runtime.

Additional notes

Environment variables:

  • DATAI_API_KEY: Your Datai API key (required)
  • DATAI_LIMIT: API response limit (1-100, default 10)
  • DATAI_DEBUG_TRUNCATE: Enable truncated responses for debugging (true/false)
  • DATAI_CONNECTION_TIMEOUT: Connection timeout in ms (default 130000)
  • DATAI_RESPONSE_TIMEOUT: Response timeout in ms (default 90000)
  • PORT: Server port (default 3099)
  • DEBUG: Enable debug logging (true/false)

Common issues:

  • Ensure your API key is valid and has access to the Datai API endpoints used by the MCP.
  • If you see timeouts, raise DATAI_CONNECTION_TIMEOUT or DATAI_RESPONSE_TIMEOUT accordingly.
  • When using truncation, remember to disable it for production to get full responses.

Tips:

  • Use get_all_defi_positions for a full portfolio scan before drilling into protocol- or chain-specific tools.
  • Combine multiple tools to build a comprehensive wallet story for your AI agent prompts.

Related MCP Servers

Sponsor this space

Reach thousands of developers