Skip to content
DataLayer
Developers
On this page

MCP server

DataLayer ships a Model Context Protocol server so AI assistants (Claude Desktop, Claude Code, IDE agents) can query the warehouse directly.

The server is a thin, read-only bridge to the REST API. It holds no database credentials: every tool call is an HTTPS request made with your own API key, so the same tier limits, SQL sandbox and logging apply.

Tools

ToolDescription
get_statusIndexer health, freshness, coverage
get_statsHeadline statistics
get_schemaData dictionary (optionally one table)
run_sqlRun one read-only DuckDB query
askNatural-language question → SQL → result
search_tokensSearch and sort tokens
get_token / get_token_tradesToken profile and trades
get_walletWallet positions and PnL
get_developerCreator profile
get_feedLatest trades

Resource: datalayer://schema (JSON data dictionary).

Install

The server is part of the DataLayer Python package (services/ in the repository):

pip install -r services/requirements.txt

Configure (stdio)

{
  "mcpServers": {
    "datalayer": {
      "command": "python",
      "args": ["-m", "datalayer.mcp.server"],
      "env": {
        "PYTHONPATH": "/path/to/datalayer/services",
        "DATALAYER_API_URL": "https://datalayer.fun/api/v1",
        "DATALAYER_API_KEY": "dl_..."
      }
    }
  }
}

Streamable HTTP

python -m datalayer.mcp.server --http --host 127.0.0.1 --port 8765

Tested

The repository's test suite starts the MCP server over stdio with a real MCP client, lists the tools, runs SQL through it, and checks that write statements are rejected.