Apache IoTDB MCP server
2026년 9월 17일 커밋Run SQL queries and metadata reads against Apache IoTDB time-series databases and export results to CSV or Excel.
다른 이름 apache/iotdb-mcp-server
- 스타
- 40
- Tools
- 15
- 다운로드, 30일
- —
- 최신 버전
- —
- 마지막 커밋
- 2026년 9월 17일
- 라이선스
- Apache-2.0
Apache IoTDB MCP란?
Apache IoTDB은(는) MCP server입니다. Run SQL queries and metadata reads against Apache IoTDB time-series databases and export results to CSV or Excel. 15개 도구를 제공합니다. 예: metadata_query, select_query, sql_executor_batch.
프로젝트 README에서 생성된 요약
Apache IoTDB MCP server 정보
Data engineers and analysts can interact with Apache IoTDB time-series databases directly through an AI client. This server enables running SQL queries, reading metadata, and executing business intelligence tasks using either the Tree Model or Table Model dialects. Users can switch between these modes by configuring the IOTDB_SQL_DIALECT setting.
Beyond standard SELECT queries, the server provides specialized tools for executing User Defined Functions (UDFs) and managing model inference via AINode. It supports batch execution of multiple read-only statements with configurable concurrency and worker pool sizes. For data portability, the export_query and export_table_query tools allow users to save results into CSV or Excel formats.
To connect, you must provide connection details such as the host, port, username, and password via environment variables. The server includes security features like an advisory permission model that reports risk levels for DDL/DML actions, allowing the host agent to manage user approvals.
활용 사례
- 1Analyzing database schemaRetrieve a list of all available tables or describe the columns within a specific table.
- 2Running batch analyticsExecute a large set of read-only SQL statements in parallel to speed up data retrieval.
- 3Performing AI model inferenceRun specialized inference commands on time-series data using registered AINode models.
프로젝트의 README를 바탕으로 작성되었습니다. 모든 활용 사례는 해당 내용의 인용문과 대조하여 확인합니다.
Apache IoTDB MCP 도구 15
README에서 감지됨metadata_queryselect_querysql_executor_batchread_result_pagesexport_querymodel_inferenceprepare_model_inference_requestlist_udf_functionsprepare_udf_queryexecute_udf_queryexport_udf_queryread_query
| metadata_query | — | |
| select_query | — | |
| sql_executor_batch | — | |
| read_result_pages | — | |
| export_query | — | |
| model_inference | — | |
| prepare_model_inference_request | — | |
| list_udf_functions | — | |
| prepare_udf_query | — | |
| execute_udf_query | — | |
| export_udf_query | — | |
| read_query | — |
도구 15개 모두 보기도구 수 줄이기
list_tablesdescribe_tableexport_table_query
| list_tables | — | |
| describe_table | — | |
| export_table_query | — |
구성
IOTDB_DATABASEIOTDB_EXPORT_PATHIOTDB_HOSTIOTDB_PASSWORDIOTDB_PORTIOTDB_SQL_DIALECTIOTDB_USER
| 이름 | 설명 | 유형 |
|---|---|---|
| IOTDB_DATABASE | — | |
| IOTDB_EXPORT_PATH | — | |
| IOTDB_HOST | — | |
| IOTDB_PASSWORD | — | |
| IOTDB_PORT | — | |
| IOTDB_SQL_DIALECT | — | |
| IOTDB_USER | — |
자동 검사
2026년 11월 14일에 실행됨전체 보고서 →아직 인증되지 않았습니다. 서버는 80점 이상의 점수, 심각한 결함 없음, 그리고 검사에 충분한 데이터를 갖추어야 합니다. 검사 방식
- 소스 저장소 연결 및 접근 가능apache/iotdb-mcp-server is public and reachablegithub.com/apache/iotdb-mcp-server ↗통과
- 패키지가 이 저장소를 소스로 지정검사되지 않음
- 빌드 출처(Sigstore 증명)검사되지 않음
- 오픈 소스 라이선스 (OSI)Apache-2.0spdx.org/licenses/Apache-2.0.html ↗통과
- 최근 1년 내 커밋 또는 릴리스Last commit or release 2026-09-17github.com/apache/iotdb-mcp-server ↗통과
- OpenSSF Scorecard검사되지 않음
- 패키지 이름이 인기 패키지와 유사하지 않음검사되지 않음
- 패키지와 의존성에 심각한 보안 권고 없음검사되지 않음
- 모델에 대한 숨겨진 지침 없음15 tool descriptions and the README read; no override phrases, credential paths or hidden characters통과
- 파괴적인 도구에 라벨 표시됨검사되지 않음
- 원격 endpoint가 MCP 핸드셰이크에 응답검사되지 않음
README
GitHub에서 보기IoTDB MCP Server
English | 中文
Overview
A Model Context Protocol (MCP) server implementation that provides database interaction and business intelligence capabilities through IoTDB. This server enables running SQL queries and interacting with IoTDB using different SQL dialects (Tree Model and Table Model).
Components
Resources
The server doesn't expose any resources.
Prompts
The server doesn't provide any prompts.
Permission Model
IoTDB MCP permissions are advisory by default. The server reports the required
permission, risk level, and confirmation parameter for SQL actions, while the
host agent system owns user approval. Use inspect_sql_permission before
executing DDL/DML or destructive SQL when the tool is available.
Long-running hosted agents can provide full-permission defaults with
environment variables such as IOTDB_SQL_DRIVER_MODE=full and
TIMESEEK_MCP_PERMISSION_ENFORCEMENT=advisory. Set
TIMESEEK_MCP_PERMISSION_ENFORCEMENT=strict only when the MCP server itself
should hard-block disallowed operations.
Session policy changes are bounded by a deployment policy frozen at startup
(process environment > MCP configuration > defaults). Narrowing applies immediately;
widening within that ceiling requires out-of-band administrator approval by default.
IOTDB_SESSION_POLICY_APPROVAL_MODE=allow explicitly permits in-ceiling widening
without approval. Neither setting allows tools to change enforcement switches,
SQL classification prefixes, or the deployment ceiling. Reset and replace follow
the same rules. See session policy administration
for configuration, approval commands, and the required host isolation.
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".
Dialect-specific identifier semantics:
- Tree dialect:
FROMtargets use explicitroot...paths.- Projection expressions should usually use measurement names instead of full
root...paths. IOTDB_DATABASEis only a connection/session hint; tree SQL still needs explicit root paths.
- Table dialect:
FROMtargets use table names in the current database.- Projection expressions use column names.
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
- Supported query types:
- SHOW DATABASES [path]
- SHOW TIMESERIES [path]
- SHOW CHILD PATHS [path]
- SHOW CHILD NODES [path]
- SHOW DEVICES [path]
- COUNT TIMESERIES [path]
- COUNT NODES [path]
- COUNT DEVICES [path]
- 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 (using TREE dialect, time using ISO 8601 format, e.g. 2017-11-01T00:08:00.000)
- Supported functions:
- SUM, COUNT, MAX_VALUE, MIN_VALUE, AVG, VARIANCE, MAX_TIME, MIN_TIME, etc.
- Returns: Query results as array of objects
sql_executor_batch- Execute multiple readonly SQL statements in parallel and store each result in ResultStore
- Input:
sqls(array): Explicit single SQL statements, orsql_template+param_sets: Repeated SQL template with parameter objectsmax_concurrency(integer): Concurrent statement limit, default 4worker_pool_size(integer): Thread worker pool size, default follows concurrency and is capped byIOTDB_SQL_EXECUTOR_BATCH_MAX_WORKER_POOL_SIZE(default 16)per_item_timeout_ms(integer): Per-statement wait timeout, default 60000batch_timeout_ms(integer): Whole-batch wait timeout, default 300000max_result_rows_per_item/max_result_bytes_per_item: Per-statement result quota, defaults 10000 rows and 16 MiBmax_batch_result_rows/max_batch_result_bytes: Whole-batch result quota, defaults 100000 rows and 64 MiB
- Template placeholders:
{{name}}for SQL literals,{{name:path}}for IoTDB paths,{{name:identifier}}for SQL identifiers
- Returns: Batch summary plus per-statement
result_id, row count, preview rows, and paging metadata
read_result_pages- Read multiple ResultStore pages in one MCP call
- Input:
pages(array): Page request objects withresult_idplus optionalcursor,offset,limit, andowner_session_iddefault_limit(integer): Default page size for items withoutlimitmax_pages/max_total_rows: Per-call quotas, defaults 32 pages and 10000 rowscontinue_on_error(boolean): Return per-item errors instead of aborting, default true
- Returns: Batch page summary plus per-page rows, cursors, and errors
export_query- Execute a query and export the results to a CSV or Excel file
- Input:
query_sql(string): The SQL query to execute (using TREE dialect)format(string): Export format, either "csv" or "excel" (default: "csv")filename(string): Optional filename for the exported file. If not provided, a unique filename will be generated.
- Returns: Information about the exported file and a preview of the data (max 10 rows)
model_inference- Execute AINode
CALL INFERENCE(...)SQL and return the result set - Input:
inference_sql(string): A single Tree-dialect SQL statement starting withCALL INFERENCE
- Validates model id, quoted input SELECT SQL, explicit non-wildcard columns,
and supported parameters (
generateTime,outputLength) before execution - Permission metadata: model management is reported through the advisory MCP
policy layer. In strict mode,
IOTDB_ENABLE_MODEL_MANAGEMENT=trueandIOTDB_MODEL_ALLOWED_USERSare enforced.
- Execute AINode
prepare_model_inference_request- Build and validate AINode
CALL INFERENCE(...)SQL from structured fields - Input:
model_id(string): Registered AINode model idinput_sql(string): Bounded Tree-dialect SELECT query used as model inputoutput_length(int): Forecast output length (default: 96)generate_time(bool): Whether to request a Time column (default: false)
- Build and validate AINode
UDF Tools
list_udf_functions- Execute
SHOW FUNCTIONSfor the selected IoTDB target.
- Execute
prepare_udf_query- Build a read-only UDF
SELECTfrom structured inputs. - Tree form:
SELECT UDF(measurement, "k"="v") FROM root.sg.d1 ... - Table form:
SELECT UDF(column, "k"="v") FROM table ...
- Build a read-only UDF
execute_udf_query- Execute the validated UDF query and return a ResultStore-backed preview.
export_udf_query- Execute the validated UDF query and export the result set to CSV or Excel.
UDF tools reject semicolons, SQL comments, and DDL/DML keywords in expressions and filter clauses. They are intended for read-only UDF calls such as data quality, profiling, repair planning, and anomaly scoring.
Table Model
Query Tools
read_query- Execute SELECT queries to read data from the database
- Input:
query_sql(string): The SELECT SQL query to execute (using TABLE dialect, time using ISO 8601 format, e.g. 2017-11-01T00:08:00.000)
- 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
-
export_table_query- Execute a query and export the results to a CSV or Excel file
- Input:
query_sql(string): The SQL query to execute (using TABLE dialect)format(string): Export format, either "csv" or "excel" (default: "csv")filename(string): Optional filename for the exported file. If not provided, a unique filename will be generated.
- Returns: Information about the exported file and a preview of the data (max 10 rows)
Configuration Options
IoTDB MCP Server supports the following configuration options, which can be set via environment variables or command-line arguments:
| Option | Environment Variable | Default Value | Description |
|---|---|---|---|
| --host | IOTDB_HOST | 127.0.0.1 | IoTDB host address |
| --port | IOTDB_PORT | 6667 | IoTDB port |
| --user | IOTDB_USER | root | IoTDB username |
| --password | IOTDB_PASSWORD | empty | IoTDB password |
| --database | IOTDB_DATABASE | test | Table dialect: current database name. Tree dialect: optional session/root scope hint; queries still use explicit root... paths. |
| --sql-dialect | IOTDB_SQL_DIALECT | table | SQL dialect: tree or table |
| --export-path | IOTDB_EXPORT_PATH | /tmp | Path for exporting query results |
The target registry contains only connections that have completed a successful
login. Call prepare_iotdb_target with non-secret fields, then pass explicitly
user-supplied credentials to connect_iotdb_target for one authentication
attempt. If credentials are absent, ask the user; never probe empty or default
passwords. An explicitly supplied empty password remains valid input.
Successful login atomically publishes the target and records its per-target
last_known_good_credential. Any connection-layer failure consumes the
candidate or evicts the published target. A retry requires a new candidate and
user_confirmed_retry=true after explicit user instruction. Public target
responses redact both the active password and last-known-good password.
When TIMESEEK_IOTDB_TARGETS_FILE is configured, successful connections are
persisted by default. The local Java CLI can reuse exactly that target through
iotdb-target-cli:
iotdb-target-cli --target-id cloud \
--cli /opt/iotdb/sbin/start-cli.sh -- -e "SHOW VERSION"
The wrapper reloads the verified target on every invocation and supplies its
host, port, dialect, username, and last-known-good password. It does not pass
-db to start-cli.sh, because the Java CLI does not support that option;
select a table database with SQL USE <database>. For import-data.sh and
import-data.bat, which do support -db, a table target's database is injected
automatically. A verified empty password is represented by omitting -pw, and
command previews redact non-empty passwords. Calling start-cli.sh directly
does not read the target registry.
Performance Optimizations
IoTDB MCP Server includes the following performance optimization features:
- Session Pool Management: Uses optimized session pool configurations, supporting up to 100 concurrent sessions
- Optimized Fetch Size: For queries, a fetch size of 1024 is set
- Connection Retry: Configured automatic retry mechanism for connection failures
- Timeout Management: Session wait timeout set to 5000 milliseconds for improved reliability
- Export Functionality: Support for exporting query results to CSV or Excel formats
Prerequisites
- Python environment
uvpackage 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
Claude Desktop Integration
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.
Claude Desktop Configuration Example
Add the following configuration to Claude Desktop's configuration file:
{
"mcpServers": {
"iotdb": {
"command": "uv",
"args": [
"--directory",
"/Users/your_username/iotdb-mcp-server/src/iotdb_mcp_server",
"run",
"server.py"
],
"env": {
"IOTDB_HOST": "127.0.0.1",
"IOTDB_PORT": "6667",
"IOTDB_USER": "root",
"IOTDB_PASSWORD": "",
"IOTDB_DATABASE": "test",
"IOTDB_SQL_DIALECT": "table",
"IOTDB_EXPORT_PATH": "/path/to/export/folder"
}
}
}
}
Note: Make sure to replace the
--directoryparameter's path with your actual repository clone path.
Error Handling and Logging
IoTDB MCP Server includes comprehensive error handling and logging capabilities:
- Log Level: Logging level is set to INFO, allowing you to view server status in the console
- Exception Handling: All database operations include exception handling to ensure graceful handling and meaningful error messages when errors occur
- Session Management: Automatic closure of used sessions to prevent resource leaks
- Parameter Validation: Basic validation of user-input SQL queries to ensure only allowed query types are executed
Docker Support
You can build a container image for the IoTDB MCP Server using the Dockerfile in the project root:
# Build Docker image
docker build -t iotdb-mcp-server .
# Run container
docker run -e IOTDB_HOST=<your-iotdb-host> -e IOTDB_PORT=<your-iotdb-port> -e IOTDB_USER=<your-iotdb-user> -e IOTDB_PASSWORD=<your-iotdb-password> iotdb-mcp-server
Apache IoTDB MCP 질문
Apache IoTDB MCP는 어떤 도구를 제공하나요?
15개 도구를 제공합니다. 예: metadata_query, select_query, sql_executor_batch, read_result_pages, export_query.
Which SQL dialects does the IoTDB MCP server support?
It supports both the Tree Model and Table Model dialects, selected with the IOTDB_SQL_DIALECT setting.
How do I connect the server to my IoTDB instance?
Configure host, port, user, password and database via environment variables or command-line arguments such as IOTDB_HOST and IOTDB_PORT.
Can I export query results to a file?
Yes, the export tools write query results to CSV or Excel files and return a preview of up to 10 rows.
What tools are available for reading metadata in the tree dialect?
The metadata_query tool runs SHOW and COUNT queries such as SHOW DATABASES, SHOW TIMESERIES, and COUNT DEVICES.
Does the server let me run AI model inference on IoTDB?
Yes, model_inference executes AINode CALL INFERENCE statements, and prepare_model_inference_request builds and validates the SQL from structured fields.