Skip to main content

MCP Server

Erdo exposes a Model Context Protocol (MCP) server that lets AI assistants and applications query your datasets, ask data questions, and run SQL queries — all using your existing Erdo permissions. Use it to:
  • Connect AI assistants like Claude Desktop, Cursor, or Windsurf to your data
  • Build AI-powered apps that query and visualize your data using any MCP client library
  • Integrate with any LLM via Vercel AI SDK, LangChain, or direct MCP client connections

Quick Start

1. Get an API Key

Click your profile in the bottom-left corner of Erdo and go to API Keys. Create a new key and copy the token.

2. Connect to the MCP Server

The MCP endpoint is https://api.erdo.ai/mcp using Streamable HTTP transport. Any MCP-compatible client can connect. The organization is inferred from your API key automatically.
Add to your claude_desktop_config.json:
{
  "mcpServers": {
    "erdo": {
      "url": "https://api.erdo.ai/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_API_KEY"
      }
    }
  }
}

3. Start Using It

Once connected, the MCP client can discover and call Erdo tools. In AI assistants, try asking:
  • “List my datasets in Erdo”
  • “What columns does the sales dataset have?”
  • “How many orders were placed last month?” (uses the Data Question Answerer agent)
  • “Run a SQL query on my customers dataset to find the top 10 by revenue”

Available Tools

erdo_list_datasets

List all datasets in your organization with name, type, description, and status.

erdo_get_dataset_schema

Get detailed schema for a dataset including column names, types, statistics, and sample data.

erdo_gather_dataset_context

Get detailed context for multiple datasets at once — schemas, column types, statistics, descriptions, and sample data. Useful for understanding your data landscape before asking questions. Parameters:
ParameterTypeDescription
dataset_slugsstring[]Optional. Specific dataset IDs or slugs. Empty returns all.
limitnumberOptional. Max datasets to return (default 10).

erdo_search_data

Search across all datasets using natural language. Returns matching records with source information. Parameters:
ParameterTypeDescription
querystringSearch text
limitnumberOptional. Max results (default 20).

erdo_ask_data_question

Ask a natural language question about your data. This invokes Erdo’s Data Question Answerer agent, which analyzes datasets, writes and executes code, and returns a text answer. To visualize results, use erdo_render_chart or erdo_render_table.
This tool can take 30 seconds to 2 minutes for complex questions, as it runs a full AI analysis pipeline.
Parameters:
ParameterTypeDescription
questionstringThe data question to answer
dataset_slugsstring[]Optional. Dataset slugs to scope the question to.
timezonestringOptional. User timezone (e.g. America/New_York).
Returns: A thread ID (for follow-up in the Erdo UI) and the agent’s text answer.

erdo_render_chart

Render a data visualization chart. Supports bar, line, pie, histogram, and scatter chart types. The chart fetches data directly from the dataset — no embedded data needed. Parameters:
ParameterTypeDescription
chart_typestringChart type: bar, line, pie, histogram, or scatter
chart_titlestringTitle for the chart
x_axisobjectX-axis configuration (label, key, format, value_type)
y_axesobject[]Y-axis configurations
seriesobject[]Data series, each with dataset_slug, key, sql_query, resource_key
data_reductionobjectData reduction strategy (none, sample, aggregate, bin)
stackedbooleanWhether to stack bars (for bar charts)
sortobject[]Sort conditions

erdo_render_table

Render a data table. The table fetches data directly from the dataset. Parameters:
ParameterTypeDescription
table_titlestringTitle for the table
dataset_slugstringDataset slug
columnsobject[]Column definitions (column_name, key, format, value_type)
sql_querystring | nullOptional SQL query to filter/transform data
resource_keystring | nullRequired for file datasets (CSV/Excel)

erdo_query_data

Query a dataset using natural language. Describe what data you want and Erdo will generate and execute the SQL query for you. Parameters:
ParameterTypeDescription
questionstringNatural language question, e.g. “show top 10 customers by revenue”
dataset_slugstringDataset UUID or slug to query
Returns: The generated SQL query and the results.

erdo_run_query

Run a raw SQL query directly against a dataset and return rows and columns. Use this when you already know the exact SQL you want to run. The SQL dialect depends on the dataset’s storage backend (PostgreSQL, ClickHouse, or DuckDB for file-based datasets). Parameters:
ParameterTypeDescription
dataset_slugstringDataset UUID or slug to query
querystringSQL query to execute
limitnumberOptional. Max rows to return (default 100).

erdo_list_threads

List conversation threads with name, creation date, and visibility.

erdo_get_thread_messages

Get all messages from a conversation thread including content and metadata.

REST API

All MCP tools are also available as REST endpoints for direct HTTP integration:
MCP ToolREST EndpointMethod
erdo_list_datasets/v1/datasetsGET
erdo_get_dataset_schema/v1/datasets/:id/schemaGET
erdo_gather_dataset_context/v1/dataset-contextGET
erdo_search_data/v1/searchPOST
erdo_ask_data_question/v1/askPOST
erdo_render_chart/v1/render/chartPOST
erdo_render_table/v1/render/tablePOST
erdo_query_data/v1/datasets/:slug/query-nlPOST
erdo_run_query/v1/datasets/:slug/queryPOST
erdo_list_threads/v1/threadsGET
erdo_get_thread_messages/v1/threads/:id/messagesGET
Authentication: Pass Authorization: Bearer YOUR_API_KEY header. The organization is inferred from your API key. Base URL: https://api.erdo.ai

Example

curl -X POST https://api.erdo.ai/v1/ask \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "X-Organization-ID: YOUR_ORG_ID" \
  -H "Content-Type: application/json" \
  -d '{"question": "What were total sales last quarter?"}'

Building Apps with Erdo MCP

Beyond AI assistants, you can integrate Erdo’s MCP server into your own applications:
  • Vercel AI SDK — Connect any LLM to Erdo tools with rich chart and table rendering in React
  • REST API (above) — Direct HTTP integration without MCP
  • Any MCP client — Use the Custom App tab above to connect from TypeScript, Python, Go, or any language with an MCP client library