# Connecting Cursor to Treasure AI

Connect Cursor to Treasure AI to query databases, build and manage segments in YAML, and debug workflows from Cursor's agent chat, using your existing Cursor plan. This page covers connecting MCP Server (Platform) for platform operations, MCP Server (Docs) for documentation search, and installing TD Skills.

## Prerequisites

- Cursor installed
- Node.js and npm
- A Treasure AI account with API access


## Connect MCP Server (Platform)

```bash
npm install -g @treasuredata/tdx
tdx auth setup
```

In Cursor, open the command palette (`Command + Shift + P` on macOS, `Ctrl + Shift + P` on Windows/Linux), select "Open MCP settings", then "Add custom MCP". Cursor opens `mcp.json` — add the `tdx` server:

```json
{
  "mcpServers": {
    "tdx": {
      "command": "tdx",
      "args": ["mcp"]
    }
  }
}
```

To roll this out to your team, commit the same configuration to `.cursor/mcp.json` in your repository instead. Each teammate still runs `tdx auth setup` individually to authenticate.

## Connect MCP Server (Docs)

To let Cursor search Treasure AI documentation directly, add a second entry to the same `mcp.json`:

```json
{
  "mcpServers": {
    "td-docs": {
      "url": "https://docs.treasure.ai/mcp"
    }
  }
}
```

## Install TD Skills

```bash
git clone https://github.com/treasure-data/td-skills
mkdir -p ~/.cursor/skills
cp -r td-skills/tdx-skills/* td-skills/sql-skills/* td-skills/workflow-skills/* ~/.cursor/skills/
```

See [TD Skills](/treasure-code/guide/td-skills) for the full skill catalog.

## Try It

In Cursor's agent chat, confirm the connection appears, then ask a question that requires querying your data:

```
> List the databases in my Treasure AI environment
```

Cursor responds with the list of databases from your account, confirming MCP Server (Platform) is connected.

## Next Steps

- [MCP Server (Docs)](/getting-started/ai/mcp-server-docs) — reference for documentation search tools
- [MCP Server (Platform)](/getting-started/ai/mcp-server-platform) — reference for `tdx_run` and `tdx_search`
- [TD Skills](/treasure-code/guide/td-skills)
- Connect a different tool: [Claude Code](/getting-started/ai/claude-code) · [OpenAI Codex](/getting-started/ai/openai-codex) · [VS Code and GitHub Copilot](/getting-started/ai/vscode-github-copilot)
- [Why teams pair Cursor with Treasure AI](https://www.treasure.ai/works-with/spacex-cursor)