IoTDB MCP Server

Official

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.

Integrations

  • Provides database interaction with Apache IoTDB, enabling execution of SQL queries to read data, list tables, and describe table schemas.

IoTDB MCP 服务器

概述

模型上下文协议 (MCP) 服务器实现,通过 IoTDB 提供数据库交互和商业智能功能。此服务器支持运行 SQL 查询。

成分

资源

服务器不公开任何资源。

提示

服务器没有提供任何提示。

工具

IoTDB 服务器提供了针对树形模型和表模型的不同工具。您可以通过将“IOTDB_SQL_DIALECT”配置设置为“tree”或“table”来选择。

树模型

  • metadata_query
    • 执行 SHOW/COUNT 查询以从数据库读取元数据
    • 输入:
      • query_sql (字符串):要执行的 SHOW/COUNT SQL 查询
    • 返回:查询结果作为对象数组
  • select_query
    • 执行 SELECT 查询以从数据库读取数据
    • 输入:
      • query_sql (字符串): 要执行的 SELECT SQL 查询
    • 返回:查询结果作为对象数组

表格模型

查询工具
  • read_query
    • 执行 SELECT 查询以从数据库读取数据
    • 输入:
      • query (字符串):要执行的 SELECT SQL 查询
    • 返回:查询结果作为对象数组
架构工具
  • list_tables
    • 获取数据库中所有表的列表
    • 无需输入
    • 返回:表名称数组
  • describe-table
    • 查看特定表的架构信息
    • 输入:
      • table_name (字符串):要描述的表的名称
    • 返回:具有名称和类型的列定义数组

Claude 桌面集成

先决条件

  • Python 与uv包管理器
  • IoTDB 安装
  • MCP 服务器依赖项

发展

# 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

在Claude Desktop的配置文件中配置MCP服务器:

MacOS

位置: ~/Library/Application Support/Claude/claude_desktop_config.json

视窗

位置: %APPDATA%/Claude/claude_desktop_config.json

您可能需要在命令字段中输入 uv 可执行文件的完整路径。您可以在 MacOS/Linux 上运行which uv或在 Windows 上运行where uv来获取此路径。

{ "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" } } } }
-
security - not tested
A
license - permissive license
-
quality - not tested

一种能够针对 IoTDB 数据库运行 SQL 查询的服务器,通过模型上下文协议接口提供数据读取功能和模式信息。

  1. Overview
    1. Components
      1. Resources
      2. Prompts
      3. Tools
    2. Claude Desktop Integration
      1. Prerequisites
        1. Development
          1. MacOS
          2. Windows
        ID: xy5u3egaw0