Treasure Data MCP Server

by knishioka

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

# Install from source git clone https://github.com/yourusername/td-mcp-server.git cd td-mcp-server pip install -e .

Authentication

The client requires a Treasure Data API key for authentication. You can provide this in two ways:

  1. Set the TD_API_KEY environment variable:
    export TD_API_KEY="your-api-key"
  2. Pass it directly to the command:
    python -m td_mcp_server --api-key="your-api-key" list-databases

Usage

Command Line Interface

The package provides a simple command-line interface for common operations:

List all databases
# Show databases in table format (default) python -m td_mcp_server list-databases # Get JSON output python -m td_mcp_server list-databases --format=json # Specify a different region endpoint python -m td_mcp_server --endpoint=api.treasuredata.co.jp list-databases
Get information about a specific database
# Get JSON output (default) python -m td_mcp_server get-database my_database_name # Get table output python -m td_mcp_server get-database my_database_name --format=table

Python API

You can also use the client directly in your Python code:

from td_mcp_server.api import TreasureDataClient # Initialize client with API key from environment variable client = TreasureDataClient() # Or provide API key directly client = TreasureDataClient(api_key="your-api-key") # Get all databases databases = client.get_databases() for db in databases: print(f"Database: {db.name}, Tables: {db.count}") # Get information about a specific database db = client.get_database("my_database_name") if db: print(f"Found database: {db.name}") else: print("Database not found")

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:

client = TreasureDataClient(endpoint="api.treasuredata.co.jp")
python -m td_mcp_server --endpoint=api.treasuredata.co.jp list-databases

MCP Server Configuration

This server implements the Model Context Protocol (MCP) to provide Claude with access to Treasure Data API functionality.

Running the MCP Server

You can run the MCP server in several ways:

# Using uv run (recommended) uv run mcp # Using Python module python -m td_mcp_server --mcp-server # Using the installed script mcp

The server requires a Treasure Data API key, which should be provided via the TD_API_KEY environment variable.

Setting up with Claude Code

To configure this MCP server for use with Claude Code:

  1. Install the server
    git clone https://github.com/yourusername/td-mcp-server.git cd td-mcp-server pip install -e .
  2. Set your Treasure Data API key as an environment variable
    export TD_API_KEY="your-api-key"
  3. Create a .claude/plugins.json file in your project directory with the following content:
    { "plugins": [ { "name": "td-mcp", "description": "Treasure Data API plugin for database management", "command": { "args": ["uv", "run", "mcp"], "env": { "TD_API_KEY": "${TD_API_KEY}" } } } ] }
  4. When using Claude Code in a project with this configuration, you'll have access to the following MCP tools:
    • mcp__td_list_databases: List all databases in your Treasure Data account
    • mcp__td_get_database: Get information about a specific database

Setting up with Claude Desktop

To configure this MCP server for use with Claude Desktop:

  1. Install the server as described above
  2. In Claude Desktop, create a new MCP tool configuration:
    • Go to Settings > MCP Tools > Add New Tool
    • Name: Treasure Data API
    • Command: uv run mcp
    • Environment variables: Add your TD_API_KEY
  3. Save the configuration and restart Claude Desktop
  4. 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:

/mcp td_list_databases

or

/mcp td_get_database my_database_name

Development

To set up the development environment:

# Clone the repository git clone https://github.com/yourusername/td-mcp-server.git cd td-mcp-server # Install dev dependencies pip install -e ".[dev]" # Run tests pytest
-
security - not tested
F
license - not found
-
quality - not tested

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.

  1. Installation
    1. Authentication
      1. Usage
        1. Command Line Interface
        2. Python API
      2. API Endpoints
        1. MCP Server Configuration
          1. Running the MCP Server
          2. Setting up with Claude Code
          3. Setting up with Claude Desktop
          4. Using MCP Tools in Claude
        2. Development

          Related MCP Servers

          • A
            security
            A
            license
            A
            quality
            An 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 -
            7
            87
            15
            TypeScript
            MIT License
          • A
            security
            A
            license
            A
            quality
            An 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 -
            7
            18
            4
            TypeScript
            MIT License
            • Apple
            • Linux
          • A
            security
            F
            license
            A
            quality
            An MCP server implementation that enables interaction with the Unstructured API, providing tools to list, create, update, and manage sources, destinations, and workflows.
            Last updated -
            39
            26
            • Apple
          • -
            security
            F
            license
            -
            quality
            An MCP server that connects to Backlog API, providing functionality to search, retrieve, and update issues through natural language commands.
            Last updated -
            24
            1
            JavaScript
            • Apple

          View all related MCP servers

          ID: pk97hytjgc