Skip to main content

A Model Context Protocol (MCP) server that enables secure interaction with IoTDB databases. This server allows AI assistants to list tables, read data, and execute SQL queries through a controlled interface, making database exploration and analysis safer and more structured.

Project description

IoTDB MCP Server

smithery badge

Overview

A Model Context Protocol (MCP) server implementation that provides database interaction and business intelligence capabilities through IoTDB. This server enables running SQL queries.

Components

Resources

The server doesn't expose any resources.

Prompts

The server doesn't provide any prompts.

Tools

The server offers different tools for IoTDB Tree Model and Table Model. You can choose between them by setting the "IOTDB_SQL_DIALECT" configuration to either "tree" or "table".

Tree Model

  • metadata_query
    • Execute SHOW/COUNT queries to read metadata from the database
    • Input:
      • query_sql (string): The SHOW/COUNT SQL query to execute
    • Returns: Query results as array of objects
  • select_query
    • Execute SELECT queries to read data from the database
    • Input:
      • query_sql (string): The SELECT SQL query to execute
    • Returns: Query results as array of objects

Table Model

Query Tools
  • read_query
    • Execute SELECT queries to read data from the database
    • Input:
      • query (string): The SELECT SQL query to execute
    • Returns: Query results as array of objects
Schema Tools
  • list_tables

    • Get a list of all tables in the database
    • No input required
    • Returns: Array of table names
  • describe-table

    • View schema information for a specific table
    • Input:
      • table_name (string): Name of table to describe
    • Returns: Array of column definitions with names and types

Claude Desktop Integration

Prerequisites

  • Python with uv package manager
  • IoTDB installation
  • MCP server dependencies

Development

# Clone the repository
git clone https://github.com/apache/iotdb-mcp-server.git
cd iotdb_mcp_server

# Create virtual environment
uv venv
source venv/bin/activate  # or `venv\Scripts\activate` on Windows

# Install development dependencies
uv sync

Configure the MCP server in Claude Desktop's configuration file:

MacOS

Location: ~/Library/Application Support/Claude/claude_desktop_config.json

Windows

Location: %APPDATA%/Claude/claude_desktop_config.json

You may need to put the full path to the uv executable in the command field. You can get this by running which uv on MacOS/Linux or where uv on Windows.

{
  "mcpServers": {
    "iotdb": {
      "command": "uv",
      "args": [
        "--directory",
        "YOUR_REPO_PATH/src/iotdb_mcp_server",
        "run",
        "server.py"
      ],
      "env": {
        "IOTDB_HOST": "127.0.0.1",
        "IOTDB_PORT": "6667",
        "IOTDB_USER": "root",
        "IOTDB_PASSWORD": "root",
        "IOTDB_DATABASE": "test",
        "IOTDB_SQL_DIALECT": "table"
      }
    }
  }
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

iotdb_mcp_server_fix-0.1.0.tar.gz (10.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

iotdb_mcp_server_fix-0.1.0-py3-none-any.whl (11.9 kB view details)

Uploaded Python 3

File details

Details for the file iotdb_mcp_server_fix-0.1.0.tar.gz.

File metadata

File hashes

Hashes for iotdb_mcp_server_fix-0.1.0.tar.gz
Algorithm Hash digest
SHA256 bdbe8d08f84a5575c833cf0cdbae89a7a0674d85e28e0786164dba6007522b80
MD5 8ec0cc5bfe497e34fcab102f54afb756
BLAKE2b-256 f9e3ab5549e009fa24898bfa07c15e83ae77e61e4082b498ad785f037335ab25

See more details on using hashes here.

File details

Details for the file iotdb_mcp_server_fix-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for iotdb_mcp_server_fix-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2789383dc7f55edc2cb0babcb0858ea0265cd3c6bb5ace7f354b06d54df894e4
MD5 4f2f4109335c24aa259211e323a47bb6
BLAKE2b-256 dfe0b223482725d0ba0ef5cba9d619dc13d9dc2fc82d90ad87c055efdd80b10b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page