Overview
What is TDengine MCP Server?
TDengine MCP Server is a Model Context Protocol (MCP) server that provides read-only query capabilities for TDengine databases, enabling AI assistants to execute queries, explore database structures, and investigate data through a secure interface.
How to use TDengine MCP Server?
To use TDengine MCP Server, you can either run it directly using uv after you clone this repo from github:
git clone https://github.com/Abeautifulsnow/tdengine-mcp.git
cd tdengine-mcp
uv venv -p python3.12
source .venv/bin/activate
uv run src/tdengine_mcp_server -th <host> -db <database> -ll debug
Or install via pip and run:
pip install tdengine_mcp_server
python -m tdengine_mcp_server
Or install via uvx
uvx tdengine-mcp-server -h
Key features of TDengine MCP Server?
- Executes read-only SQL queries (SELECT, SHOW, DESCRIBE) against TDengine databases
- Provides comprehensive database and stable information retrieval
- Supports secure database exploration with built-in query restrictions
- Offers configurable connection settings through environment variables or CLI arguments
- Integrates seamlessly with MCP-compatible AI tools
Use cases of TDengine MCP Server?
- Enabling AI assistants to analyze time-series data in TDengine databases
- Supporting data exploration and investigation through natural language queries
- Facilitating read-only access to IoT device data and metrics
- Assisting in debugging and monitoring system performance
FAQ from TDengine MCP Server?
What types of queries can I execute?
Only read-only operations are supported (SELECT, SHOW, DESCRIBE). Write operations like INSERT, UPDATE, DELETE, or CREATE are not permitted.
How do I configure the database connection?
You can configure the connection using environment variables in a .env file or through command-line arguments, specifying host, port, credentials, and database name.
Is it safe to use with AI assistants?
Yes! The server is designed with security in mind, allowing only read-only operations and preventing any modifications to your database structure or data.
Server Config
{
"mcpServers": {
"tdengine": {
"command": "uvx",
"args": [
"tdengine-mcp-server",
"-th",
"YOUR_TDengine_HOST",
"-tu",
"YOUR_TDengine_USERNAME",
"-pwd",
"YOUR_TDengine_PASSWORD",
"-db",
"YOUR_TDengine_DATABASE",
"-ll",
"debug",
"-trans",
"stdio"
]
}
}
}