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.
Claude Desktop
Claude Code
Cursor
Custom App
Add to your claude_desktop_config.json:{
"mcpServers": {
"erdo": {
"url": "https://api.erdo.ai/mcp",
"headers": {
"Authorization": "Bearer YOUR_API_KEY"
}
}
}
}
claude mcp add erdo \
--transport http \
--url https://api.erdo.ai/mcp \
--header "Authorization: Bearer YOUR_API_KEY"
Add to your .cursor/mcp.json:{
"mcpServers": {
"erdo": {
"url": "https://api.erdo.ai/mcp",
"headers": {
"Authorization": "Bearer YOUR_API_KEY"
}
}
}
}
Connect from any MCP client library (TypeScript, Python, Go, etc.):import { StreamableHTTPClientTransport } from '@modelcontextprotocol/sdk/client/streamableHttp.js';
import { Client } from '@modelcontextprotocol/sdk/client/index.js';
const client = new Client({ name: 'my-app', version: '1.0.0' });
await client.connect(new StreamableHTTPClientTransport(
new URL('https://api.erdo.ai/mcp'),
{
requestInit: {
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
},
},
},
));
// List available tools
const { tools } = await client.listTools();
// Call a tool
const result = await client.callTool({
name: 'erdo_list_datasets',
arguments: {},
});
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”
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:
| Parameter | Type | Description |
|---|
dataset_slugs | string[] | Optional. Specific dataset IDs or slugs. Empty returns all. |
limit | number | Optional. Max datasets to return (default 10). |
erdo_search_data
Search across all datasets using natural language. Returns matching records with source information.
Parameters:
| Parameter | Type | Description |
|---|
query | string | Search text |
limit | number | Optional. 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:
| Parameter | Type | Description |
|---|
question | string | The data question to answer |
dataset_slugs | string[] | Optional. Dataset slugs to scope the question to. |
timezone | string | Optional. 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:
| Parameter | Type | Description |
|---|
chart_type | string | Chart type: bar, line, pie, histogram, or scatter |
chart_title | string | Title for the chart |
x_axis | object | X-axis configuration (label, key, format, value_type) |
y_axes | object[] | Y-axis configurations |
series | object[] | Data series, each with dataset_slug, key, sql_query, resource_key |
data_reduction | object | Data reduction strategy (none, sample, aggregate, bin) |
stacked | boolean | Whether to stack bars (for bar charts) |
sort | object[] | Sort conditions |
erdo_render_table
Render a data table. The table fetches data directly from the dataset.
Parameters:
| Parameter | Type | Description |
|---|
table_title | string | Title for the table |
dataset_slug | string | Dataset slug |
columns | object[] | Column definitions (column_name, key, format, value_type) |
sql_query | string | null | Optional SQL query to filter/transform data |
resource_key | string | null | Required 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:
| Parameter | Type | Description |
|---|
question | string | Natural language question, e.g. “show top 10 customers by revenue” |
dataset_slug | string | Dataset 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:
| Parameter | Type | Description |
|---|
dataset_slug | string | Dataset UUID or slug to query |
query | string | SQL query to execute |
limit | number | Optional. 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 Tool | REST Endpoint | Method |
|---|
erdo_list_datasets | /v1/datasets | GET |
erdo_get_dataset_schema | /v1/datasets/:id/schema | GET |
erdo_gather_dataset_context | /v1/dataset-context | GET |
erdo_search_data | /v1/search | POST |
erdo_ask_data_question | /v1/ask | POST |
erdo_render_chart | /v1/render/chart | POST |
erdo_render_table | /v1/render/table | POST |
erdo_query_data | /v1/datasets/:slug/query-nl | POST |
erdo_run_query | /v1/datasets/:slug/query | POST |
erdo_list_threads | /v1/threads | GET |
erdo_get_thread_messages | /v1/threads/:id/messages | GET |
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