mcpField
D
defillama-mcp

defillama-mcp

Local
github.com/GlebenjoyFinance0Updated 21w ago

About defillama-mcp

defillama-mcp is an MCP server for agents and MCP clients that need live DeFi data from DefiLlama. It covers TVL, token prices, yields, and stablecoin supply without an API key.

Key features

  1. 01Rank chain TVL
  2. 02Search protocols by TVL
  3. 03Inspect protocol TVL and changes
  4. 04Look up token prices
  5. 05Filter yield pools
  6. 06Review stablecoin supply

Use cases

  1. 01Compare TVL across blockchains
  2. 02Check a protocol’s TVL trend
  3. 03Find high-APY pools by chain and TVL
  4. 04Review stablecoins by circulating supply

MCP support

Exposes DefiLlama data through tools for MCP clients, including chain and protocol TVL, prices, yield pools, and stablecoins. Uses the public API without requiring an API key.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"glebenjoy-defillama": {
"command": "npx",
"args": [
"-y",
"defillama-mcp"
]
}
}
}
Run commandnpx -y defillama-mcp

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
npmdefillama-mcp1.0.2

Tools

6

Saved tool list · updated 3w ago

ParameterTypeRequiredDescription
limitintegerNoHow many chains to return (default 20)

Details

From the project README

DefiLlama MCP

An MCP server that gives Claude, Cursor, and any MCP-compatible agent live DeFi data from DefiLlama — chain and protocol TVL, token prices, yield/farming pools, and stablecoin supply.

No API key. No signup. The public DefiLlama API is free.

Most "MCP for X" repos are half-finished and break on the second request. This one ships with tests and graceful error handling so an agent can actually rely on it.

What your agent can do

Ask things like:

  • "Which chains have the most TVL right now?"
  • "What's Aave's TVL and how did it move this week?"
  • "Find the highest-APY stablecoin pools on Ethereum with at least $10M TVL."
  • "Price of BTC and ETH?" (coingecko:bitcoin,coingecko:ethereum)
  • "List the biggest stablecoins by circulating supply."

Tools

ToolWhat it does
get_chains_tvlTVL across all blockchains, ranked
search_protocolsSearch protocols by name / symbol / category, ranked by TVL
get_protocolTVL, 1d/7d change, chains, category for one protocol
get_token_pricesCurrent USD price for one or more tokens (DefiLlama coin ids)
get_yield_poolsTop yield pools by APY, filter by chain / project / min TVL
get_stablecoinsLargest stablecoins by circulating supply + peg type

Install

No install needed. It runs straight from npm via npx.

Claude Desktop

Add to claude_desktop_config.json:

{
  "mcpServers": {
    "defillama": {
      "command": "npx",
      "args": ["-y", "defillama-mcp"]
    }
  }
}
Cursor

Add to .cursor/mcp.json:

{
  "mcpServers": {
    "defillama": {
      "command": "npx",
      "args": ["-y", "defillama-mcp"]
    }
  }
}

Restart the client and the defillama tools appear.

Coin ids for prices

get_token_prices uses DefiLlama coin ids, comma-separated:

  • By CoinGecko id: coingecko:bitcoin, coingecko:ethereum
  • By contract: chain:0xcontract, e.g. ethereum:0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2 (WETH)

Develop

npm install
npm run dev     # run from TypeScript source over stdio
npm test        # run the unit tests
npm run build   # compile to dist/

License

MIT — see LICENSE.


Hire me

I build custom MCP servers and AI systems (multi-agent, RAG, automation). Need a connector for your own API, or a full AI integration?

Built by Gleb.

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.