Integrations
Supports loading Treasure Data API credentials from a .env file as an alternative to environment variables.
Treasure Data MCP Server
A Model Context Protocol (MCP) server that provides Treasure Data API integration for Claude Code and Claude Desktop, allowing for database management and listing functionality.
Installation
Authentication
The client requires a Treasure Data API key for authentication. You can provide this in two ways:
- Set the
TD_API_KEY
environment variable:Copy - Pass it directly to the command:Copy
Usage
Command Line Interface
The package provides a simple command-line interface for common operations:
List databases
Get information about a specific database
List tables in a database
Python API
You can also use the client directly in your Python code:
API Endpoints
By default, the client uses the US region endpoint (api.treasuredata.com
). If you need to use the Japan region, specify the endpoint:
MCP Server Configuration
This server implements the Model Context Protocol (MCP) to provide Claude with access to Treasure Data API functionality. It uses the FastMCP library with mcp.run(transport='stdio')
approach for standard MCP communication.
Running the MCP Server
You can run the MCP server in two ways:
The server requires a Treasure Data API key, which should be provided via the TD_API_KEY
environment variable or with the --api-key
option:
For development or debugging, you can run the server with verbose logging:
FastMCP Implementation
Under the hood, this server uses the FastMCP library, which provides an easy-to-use framework for building MCP servers. The implementation:
- Creates a FastMCP server instance with the name "treasure-data"
- Uses function decorators (
@mcp.tool()
) to register tools for database operations - The tools are implemented as async functions with proper type annotations
- Uses
mcp.run(transport='stdio')
to start the server with standard I/O communication - Handles MCP requests and responses automatically through the FastMCP library
The implementation follows the standard pattern recommended in the Model Context Protocol documentation for Python servers, making it compatible with Claude Desktop and other MCP clients.
Setting up with Claude Code
To configure this MCP server for use with Claude Code:
- Install the serverCopy
- Set your Treasure Data API key as an environment variableCopy
- Add the MCP server using the Claude Code CLIThis will create or update the necessary configuration in your project'sCopy
.claude/plugins.json
file. - When using Claude Code in a project with this configuration, you'll have access to the following MCP tools:
mcp__td_list_databases
: List databases in your Treasure Data account (only names by default, addverbose=True
for full details, with pagination optionslimit
,offset
, andall_results
)mcp__td_get_database
: Get information about a specific databasemcp__td_list_tables
: List tables in a specific database (only names by default, addverbose=True
for full details, with pagination optionslimit
,offset
, andall_results
)
Setting up with Claude Desktop
To configure this MCP server for use with Claude Desktop:
- Install the server as described above
- Method 1: Using the Claude Desktop UI
- Go to Settings > MCP Tools > Add New Tool
- Name: Treasure Data API
- Command:
uv run td-mcp
- Environment variables: Add your
TD_API_KEY
- Method 2: Using claude_desktop_config.json (recommended)
- Create or update your claude_desktop_config.json file:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
- Windows:
%APPDATA%\Claude\claude_desktop_config.json
- macOS:
- Add the following configuration:Copy
- Replace
your-api-key
with your actual Treasure Data API key
- Create or update your claude_desktop_config.json file:
- Save the configuration and restart Claude Desktop
- You can now use the Treasure Data API tools in your Claude Desktop conversations
Using MCP Tools in Claude
Once configured, you can use commands like:
Development
Setting Up the Development Environment
Running Tests
This project uses pytest for unit testing. To run the tests:
Type Checking
You can run static type checking with mypy:
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
An MCP server for interacting with Treasure Data API, allowing users to retrieve database information and check server status through natural language queries.
Related MCP Servers
- AsecurityAlicenseAqualityAn MCP server implementation that integrates Claude with Salesforce, enabling natural language interactions with Salesforce data and metadata for querying, modifying, and managing objects and records.Last updated -78715TypeScriptMIT License
- AsecurityAlicenseAqualityAn MCP server implementation that integrates Claude with Salesforce, enabling natural language interactions with Salesforce data and metadata for querying, modifying, and managing objects and records.Last updated -7184TypeScriptMIT License
- AsecurityFlicenseAqualityAn MCP server implementation that enables interaction with the Unstructured API, providing tools to list, create, update, and manage sources, destinations, and workflows.Last updated -3926
- -securityFlicense-qualityAn MCP server that connects to Backlog API, providing functionality to search, retrieve, and update issues through natural language commands.Last updated -531JavaScript