Skip to main content
Glama
dcSpark

mcp-server-defillama

by dcSpark

MCP Server for DefiLlama

This repository contains a Model Context Protocol (MCP) server that provides Claude with access to DeFi data via the DefiLlama API. The server enables Claude to perform operations like retrieving protocol TVL data, chain TVL data, token prices, and stablecoin information.

Overview

The MCP server exposes the following tools to Claude:

Protocol Data

  • defillama_get_protocols: List all protocols tracked by DefiLlama

  • defillama_get_protocol_tvl: Get TVL data for a specific protocol

Chain Data

  • defillama_get_chain_tvl: Get TVL data for a specific chain

Token Data

  • defillama_get_token_prices: Get current prices of tokens

  • defillama_get_historical_prices: Get historical prices of tokens

Stablecoin Data

  • defillama_get_stablecoins: List all stablecoins tracked by DefiLlama

  • defillama_get_stablecoin_data: Get data for a specific stablecoin

Prerequisites

  • Node.js (v16 or higher)

Related MCP server: DeFi Llama MCP Server

Running the server

npx @mcp-dockmaster/mcp-server-defillama You can run the MCP server directly without installation using npx: This will download and execute the server directly from npm.

Option 2: Manual Installation

Clone this repository: git clone https://github.com/mcp-dockmaster/mcp-server-defillama.git Install dependencies: npm install Build the project: npm run build

Claude Usage

To configure Claude Desktop to use this MCP server:

Open Claude Desktop, and navigate to Settings>Developer Settings>MCP Servers. There you'll encounter the button to open the configuration JSON file.

Add the MCP server configuration:

{
  "mcpServers": {
    "mcp-server-defillama": {
      "command": "npx",
      "args": [
        "@mcp-dockmaster/mcp-server-defillama"
      ]
    }
  }
}

Alternatively, if you installed the package locally:

{
  "mcpServers": {
    "mcp-server-defillama": {
      "command": "node",
      "args": [
        "/path/to/your/mcp-server-defillama/build/index.js"
      ]
    }
  }
}

Available Tools

7 tools
defillama_get_chain_tvlC

Get TVL data for a specific chain

ParametersJSON Schema
NameRequiredDescriptionDefault
chainYes

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of disclosing behavioral traits. It only implies a read operation ('Get') but does not describe output format, return type, units, pagination, or any rate limits or safety considerations. This is a significant gap for a data-fetching tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence with no irrelevant information. It is front-loaded and scannable, earning its place without padding.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (one parameter, no output schema, no annotations), the description is incomplete. It does not specify what 'TVL data' includes (e.g., current value, historical series, currency units), nor how the chain parameter should be formatted. This leaves critical gaps for the agent to select and invoke the tool correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has one parameter ('chain') with 0% description coverage, and the description does not add any meaning beyond echoing the parameter name. It fails to explain accepted values (e.g., chain IDs, slugs, case sensitivity) or provide examples, making the parameter unusable without additional external knowledge.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb ('Get') and resource ('TVL data') with an explicit scope ('specific chain'), making the tool's purpose immediately clear. This also distinguishes it from sibling tools like defillama_get_protocol_tvl, which target protocols rather than chains.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It does not mention any exclusions, prerequisites, or scenarios where another sibling tool would be more appropriate, leaving the agent to infer usage solely from the name and scope.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

defillama_get_historical_pricesC

Get historical prices of tokens

ParametersJSON Schema
NameRequiredDescriptionDefault
coinsYes
timestampYes

TDQS

C2.4/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the core behavior (fetching historical prices) but reveals nothing about the format of coins, the timestamp unit, possible limitations, rate limits, or what the response looks like. This is minimal transparency beyond the bare functionality.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is one short sentence, with no fluff and front-loaded information. However, it is under-specified, missing essential context about the parameters and expected behavior. This is acceptable conciseness for a simple sentence but not enough to earn a higher score.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has two required parameters, no output schema, and no annotations, the description is incomplete. It does not explain the coin identifier format, timestamp semantics, return structure, or error scenarios. A user would need significant external knowledge to invoke this tool correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has two parameters ('coins' as an array of strings and 'timestamp' as a number) with 0% schema description coverage. The tool description does not mention either parameter or add any meaning to them. It does not explain what 'coins' should look like (e.g., chain:address format) or what 'timestamp' represents (e.g., Unix seconds).

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Get historical prices of tokens' uses a specific verb ('get') and resource ('historical prices of tokens'), clearly distinguishing it from the sibling tool 'defillama_get_token_prices' which presumably returns current prices. However, it does not explicitly mention alternatives, so it stops short of a 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No usage guidance is provided. The description does not indicate when to use this tool over the sibling 'defillama_get_token_prices' or any other tool, nor does it mention any prerequisites or constraints. The only implicit signal is the word 'historical' in the name and description, but this is not sufficient guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

defillama_get_protocolsA

List all protocols tracked by DefiLlama

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A3.7/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description must disclose behavioral traits. It only states that it lists protocols, without mentioning any limitations, pagination, or the nature of the output. While 'list' suggests a read-only operation, there is no explicit statement about side effects or data volume.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single concise sentence with no unnecessary words. It front-loads the action and resource clearly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description is simple and adequate for a parameterless list tool, but it does not describe the structure of the returned data. With no output schema, a brief mention of what constitutes a 'protocol' (e.g., ID, name, chain) would improve completeness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has zero parameters, so the schema already fully documents the input. The description adds no parameter information, but none is needed. Baseline for 0 params is 4.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses the specific verb 'list' and identifies the resource as 'all protocols tracked by DefiLlama', which clearly distinguishes it from sibling tools that focus on TVL, prices, or stablecoins.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies the tool is for retrieving the full protocol list, but it does not explicitly state when to use this tool over alternatives such as defillama_get_protocol_tvl or defillama_get_chain_tvl. The purpose clarity indirectly suggests usage, but there is no explicit guidance or exclusion.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

defillama_get_protocol_tvlB

Get TVL data for a specific protocol

ParametersJSON Schema
NameRequiredDescriptionDefault
protocolYes

TDQS

B3.3/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It only says 'Get TVL data' with no disclosure of return format, time range, units, error handling, or rate limits. This is minimal behavioral context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a short, front-loaded sentence with no wasted words. It is appropriately sized for the tool's simplicity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool is simple, but with no output schema and no annotations, the description is too sparse. It does not explain what the returned TVL data contains (e.g., current vs historical, units, structure), leaving the agent uncertain about the output.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema has one 'protocol' string with no description (0% coverage). The description adds 'specific protocol', which clarifies it takes a single protocol identifier, but it does not specify format, valid values, or examples, leaving ambiguity.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's function with a specific verb ('Get') and resource ('TVL data' for a specific protocol). It distinguishes from siblings like defillama_get_protocols (listing protocols) and defillama_get_chain_tvl (TVL by chain).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The phrase 'for a specific protocol' implies when to use this tool, but there is no explicit guidance on when not to use it or alternatives. The sibling names help, but the description itself lacks direct usage rules.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

defillama_get_stablecoin_dataC

Get data for a specific stablecoin

ParametersJSON Schema
NameRequiredDescriptionDefault
assetYes

TDQS

C2.6/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description must disclose behavioral aspects itself. It only states that it gets data, without mentioning return format, potential limitations, rate limits, or any side effects. This is insufficient for an unannotated tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single short sentence, making it concise and front-loaded. However, it is so minimal that it borders on under-specification, lacking substance beyond the basic action.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (one parameter, no output schema, no annotations), the description is still incomplete. It does not explain what data will be returned or how the parameter should be used, leaving the agent with insufficient information for reliable invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema has one required parameter 'asset' with no description, and schema coverage is 0%. The description hints that the parameter identifies a specific stablecoin but does not clarify the expected format (e.g., symbol, address, or ID) or provide any additional semantic meaning.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly identifies a specific stablecoin as the target resource, using a concrete verb ('Get'). It also distinguishes from the sibling tool 'defillama_get_stablecoins' by emphasizing 'specific' versus the plural list. However, it lacks detail on what 'data' entails, so it is not as informative as it could be.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'defillama_get_stablecoins' or 'defillama_get_token_prices'. There is no context about suitable scenarios, prerequisites, or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

defillama_get_stablecoinsA

List all stablecoins tracked by DefiLlama

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A3.5/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the burden of behavioral disclosure. The phrase 'List all stablecoins' implies a read-only, non-destructive action, which is safe. However, it does not disclose potential limitations such as pagination, data format, or rate limits, which could be relevant for a full list endpoint.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence that is clear, front-loaded, and contains no filler. Every word earns its place, making it highly concise and well-structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a trivial zero-parameter list tool, the description provides adequate completeness. It states what is returned (a list of stablecoins) and the source (DefiLlama). Since there is no output schema, it could specify fields, but this is a minor gap given the tool's simplicity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has zero parameters, and the schema covers 100% (vacuously). Per the guideline, a baseline of 4 is appropriate since there is nothing to explain beyond the empty parameter list.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb ('List') and resource ('all stablecoins'), clearly stating the tool's function. It does not explicitly differentiate from sibling tools like defillama_get_stablecoin_data, but the distinction is reasonably clear from the names and description.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool vs alternatives. It only states the action, leaving the agent to infer usage context. There is no mention of exclusions, prerequisites, or complementary tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

defillama_get_token_pricesC

Get current prices of tokens

ParametersJSON Schema
NameRequiredDescriptionDefault
coinsYes

TDQS

C2.1/5.0
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden of behavioral disclosure, but it merely says 'Get current prices of tokens'. It does not mention return format, error behavior, rate limits, or underlying data source, offering no insight into how the tool behaves.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness2/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely brief, essentially restating the tool name. While it is concise, it lacks structure and substantive information, making it under-specified rather than efficiently compact.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations and no output schema, the description needed to provide comprehensive context for correct invocation. It fails to explain what the tool returns, how to populate the 'coins' parameter, or any limitations, leaving a critical gap for an agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema defines 'coins' as an array of strings with 0% description coverage, and the description does not explain the expected format (e.g., symbols, addresses, chain-qualified IDs). Thus, the description adds no meaning beyond the bare schema definition.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool retrieves current token prices, using the verb 'get' and resource 'current prices of tokens'. The word 'current' distinguishes it from the sibling tool 'defillama_get_historical_prices', but it doesn't specify the expected identifier format.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives, such as whether to prefer it for spot prices over historical data. It lacks any context on prerequisites, exclusions, or typical use cases.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 7 tool updatesv1.0.0
    • First observeddefillama_get_chain_tvl
    • First observeddefillama_get_historical_prices
    • First observeddefillama_get_protocol_tvl
    • First observeddefillama_get_protocols
    • First observeddefillama_get_stablecoin_data
    • First observeddefillama_get_stablecoins
    • First observeddefillama_get_token_prices

TDQS

B3.3/5.0
Disambiguation5/5

Each tool targets a distinct data type (protocols, protocol TVL, chain TVL, token prices, historical prices, stablecoins, stablecoin data). There is no overlap that would confuse an agent selecting a tool.

Naming Consistency5/5

All tools follow the exact same verb_noun pattern: defillama_get_<entity>. Naming is uniformly snake_case and descriptive.

Tool Count5/5

With 7 tools, the server is well-scoped for a read-only DeFi data API. Each tool covers a core data category without unnecessary bloat.

Completeness4/5

The toolset covers the main DefiLlama data categories: protocols, chains, tokens, and stablecoins. Minor gaps exist such as lack of historical TVL or yield/fee data, but the core read operations are present.

Maintenance

ActivityInactive
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/dcSpark/mcp-server-defillama'

If you have feedback or need assistance with the MCP directory API, please join our Discord server