Get the FREE Ultimate OpenClaw Setup Guide →

mcp -defillama

MCP server from dcSpark/mcp-server-defillama

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio dcspark-mcp-server-defillama npx @mcp-dockmaster/mcp-server-defillama

How to use

This MCP server exposes tools that give Claude access to DefiLlama data through a simple, structured API. It includes protocol-level data (listing protocols and TVL per protocol), chain-level TVL data, token price data (current and historical), and stablecoin information. You can invoke tools such as defillama_get_protocols, defillama_get_protocol_tvl, defillama_get_chain_tvl, defillama_get_token_prices, defillama_get_historical_prices, defillama_get_stablecoins, and defillama_get_stablecoin_data to retrieve the specific data you need from DefiLlama.

To use the server with Claude, configure an MCP server entry in Claude’s MCP settings. The recommended run mode is via npx, which fetches and runs the server directly from npm. If you prefer a local install, you can run the package after cloning and building, pointing Claude to the built index.js file. The server then exposes the tools so Claude can query TVLs, prices, and stablecoin data in natural language workflows.

How to install

Prerequisites:

  • Node.js v16 or higher
  • Git (for cloning the repository)

Installation steps:

  1. Prerequisite check

    • Ensure Node.js is installed: node -v and npm -v should show a 16.x or newer version.
  2. Install via npx (recommended)

    • No local installation is required. Use: npx @mcp-dockmaster/mcp-server-defillama
  3. Optional: Manual installation and build

  4. Run locally (alternative to npx)

    • If you built locally, start the server (example): node build/index.js
  5. Claude configuration

    • In Claude, add an MCP server entry pointing to the npx invocation or to the local node invocation, as shown in the example configurations.

Additional notes

Notes and tips:

  • If you encounter rate limits from DefiLlama, consider caching strategies or using historical prices where supported.
  • When using the npx approach, ensure you have network access to fetch the package from npm at runtime.
  • If you install locally, keep the build output in a stable location and point Claude to the built index.js path.
  • The available tools cover protocol-level data, chain-level data, token pricing (current and historical), and stablecoin data. Use the specific tool that aligns with the data you need (e.g., defillama_get_protocol_tvl for a particular protocol’s TVL).
  • If environment variables are needed for API keys or rate limiting, add them under the environment section of the MCP server configuration.

Related MCP Servers

Sponsor this space

Reach thousands of developers