- Home
- MCP servers
- Treasure Data
Treasure Data
- typescript
3
GitHub Stars
typescript
Language
3 months ago
First Indexed
3 weeks ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"treasure-data-td-mcp-server": {
"command": "npx",
"args": [
"@treasuredata/mcp-server"
],
"env": {
"TD_SITE": "us01",
"TD_API_KEY": "your_api_key",
"TD_DATABASE": "sample_datasets",
"TD_ENABLE_UPDATES": "false"
}
}
}
}Treasure Data MCP Server lets you query Treasure Data data sources through a secure, read-only interface that AI assistants can use. It provides convenient tools to list databases and tables, run read-only SQL queries, switch contexts, and monitor workflows, all with auditability and safe defaults.
How to use
You connect an MCP client to the Treasure Data MCP Server and interact with Treasure Data through tool commands that map to common data actions. Start by listing databases, then drill into tables, describe schemas, or run read-only queries. You can switch the active database context, monitor CDP-related data, and even inspect workflow executions. All actions are designed to be safe by default, with read-only mode enabled unless you explicitly enable updates.
How to install
Prerequisites: you need Node.js version 18.0.0 or higher. If you don’t have Node.js installed, obtain the LTS build from the Node.js site. The installer includes npm and npx so you can run MCP commands directly.
# Ensure you have Node.js v18.x or newer
node --version
npx --version
# Run the MCP server without a local installation
npx @treasuredata/mcp-server
# Optional: install a global npm package if you prefer a traditional install
npm install -g @treasuredata/mcp-server
Configuration
Configure your MCP client to point to the Treasure Data MCP Server by providing an MCP server entry. The configuration uses a standard structure where the MCP server is invoked via npx with environment variables for authentication and defaults.
{
"mcpServers": {
"treasuredata": {
"command": "npx",
"args": ["@treasuredata/mcp-server"],
"env": {
"TD_API_KEY": "your_api_key",
"TD_SITE": "us01",
"TD_ENABLE_UPDATES": "false",
"TD_DATABASE": "sample_datasets"
}
}
}
}
Security and defaults
Security-first by default means read-only access is the default mode. Write operations require an explicit enablement flag. All queries are validated before execution, and all actions are audited for security monitoring. Automatic row limiting is applied to queries to avoid large responses. You can monitor and control workflows and view detailed logs and statuses.
CDP and workflow monitoring (experimental)
Experimental CDP tools let you list parent segments, fetch segment details, and derive SQL for segments. Workflow tools give visibility into Digdag workflow projects, sessions, attempts, and task logs, with controls to retry or cancel when needed.
Usage examples with Claude Code integration
Claude Code can add the Treasure Data MCP Server as a connected source and automatically expose the available tools for querying and analysis. You configure Claude Code to run the MCP server and pass your API key securely to access Treasure Data.
Available tools
list_databases
List all databases in your Treasure Data account.
list_tables
List all tables in a specific database or in the current database context.
describe_table
Get schema information for a specific table including columns and types.
query
Execute read-only SQL queries (SELECT, SHOW, DESCRIBE) with optional row-limiting to support large responses in LLM contexts.
execute
Execute write operations (UPDATE, INSERT, DELETE) - requires explicit TD_ENABLE_UPDATES=true.
use_database
Switch the current database context for subsequent queries.
current_database
Return the current active database context.
list_parent_segments
List all parent segments in your CDP account (experimental).
get_parent_segment
Get details for a specific parent segment by ID.
list_segments
List all segments under a specific parent segment.
list_activations
List activations for a given CDP segment.
get_segment
Get detailed information about a segment including its rules and metadata.
parent_segment_sql
Get the SQL query defining a parent segment.
segment_sql
Get the SQL for a segment with filters applied to the parent segment.
list_projects
List all Digdag workflow projects (experimental).
list_workflows
List workflows with optional project filtering (experimental).
list_sessions
List workflow sessions with filtering options (experimental).
get_session_attempts
Get all attempts for a specific workflow session (experimental).
get_attempt_tasks
List all tasks within an attempt and their status (experimental).
get_task_logs
Retrieve logs for a specific task within an attempt (experimental).
kill_attempt
Request cancellation of a running attempt (experimental).
retry_session
Retry a workflow session from the beginning or a specific task (experimental).
retry_attempt
Retry a specific attempt with resume options (experimental).