td-mcp

Configure and deploy a Treasure Data MCP server for Claude Code.

21|24|Updated Oct 21, 2025
One-click install
npx skills add https://github.com/treasure-data/td-skills --skill td-mcp
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: td-mcp
Source: https://github.com/treasure-data/td-skills/tree/main/sql-skills/td-mcp
Command: npx skills add https://github.com/treasure-data/td-skills --skill td-mcp

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @treasuredata/mcp-server.

What problem does it solve?

This Skill provides expert assistance for connecting Claude Code to Treasure Data via the MCP (Model Context Protocol) server, enabling natural language data exploration and management. It simplifies interacting with TD databases, tables, and even CDP segments and workflows using plain English, making data accessible to more users.

Core Features & Use Cases

  • Natural Language Data Access: Allows users to query TD databases, list tables, describe schemas, and execute SQL using conversational prompts in Claude Code.
  • Secure Integration: Guides on setting up the MCP server with a write-only API key and optional write operations, ensuring secure and controlled access to TD.
  • CDP & Workflow Management: Provides experimental tools for listing and getting details of CDP segments and workflow projects, extending AI capabilities beyond raw data.
  • Use Case: A marketing analyst wants to quickly find out "How many unique users visited the product page yesterday?" without writing SQL. This skill helps them set up the TD MCP server with Claude Code, allowing them to ask natural language questions and get immediate answers, saving time and reducing reliance on data engineers.

Quick Start

Set your TD API key

export TD_API_KEY="your_api_key_here"

Add TD MCP server to Claude Code

claude mcp add td -e TD_API_KEY=$TD_API_KEY -- npx @treasuredata/mcp-server

Then, in Claude Code, you can ask: "List tables in sample_datasets"

Frequently Asked Questions about td-mcp

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I query Treasure Data databases using natural language in Claude Code?

Query Treasure Data using natural language by configuring the MCP server with your API key and running `claude mcp add td`. Claude Code then interprets conversational questions like "List tables in sample_datasets" and executes the equivalent SQL queries against your TD databases automatically.

What setup do I need to connect Claude Code to Treasure Data?

Set environment variables TD_API_KEY and TD_SITE, ensure Node.js 18+ is installed, then add the MCP server via `claude mcp add td -e TD_API_KEY=$TD_API_KEY -- npx @treasuredata/mcp-server`. Claude Code gains immediate access to list, describe, and query your TD databases.

Can I enable write operations when using Treasure Data with Claude Code?

Yes. Set the optional TD_ENABLE_UPDATES environment variable to permit write operations through Claude Code. Use a write-only API key for security; this allows execute and CDP segment updates alongside read-only exploration.

Does Treasure Data MCP support multiple regional deployments?

The MCP server supports regional deployments across us01, jp01, and eu01 by configuring TD_SITE in your environment variables, enabling multi-region data exploration and query execution from Claude Code.

What can I do beyond standard SQL queries with the Treasure Data MCP server?

Beyond data exploration and SQL execution, experimental tools provide CDP segment listing, segment details retrieval, and workflow project management, extending Claude Code's capabilities into audience and workflow orchestration.

Why use natural language queries instead of writing SQL directly?

Natural language queries reduce SQL knowledge requirements, accelerate ad-hoc analysis for non-technical users, and eliminate context switching—ask Claude Code "How many unique users visited yesterday?" and get results without manual query writing.