tdengine-mcp-server
v0.1.0
Published
MCP server for TDengine using WebSocket connector
Downloads
22
Readme
tdengine-mcp-server
MCP server for TDengine using the official @tdengine/websocket connector.
Inspired by the DBHub MCP server design, but focused on TDengine only.
Features
execute_sql: Execute SQL with optional read-only guardrails.search_objects: List databases, stables, tables, and columns with pattern matching.- Supports
stdioandhttptransport.
Requirements
- Node.js >= 18
- TDengine with taosAdapter (WebSocket) enabled
Install
npm installConfiguration
Set a DSN and optional guardrails via env or CLI:
TDENGINE_DSNor--dsn- Example:
ws://root:taosdata@localhost:6041/power
- Example:
TDENGINE_READ_ONLYor--read-onlyTDENGINE_MAX_ROWSor--max-rowsTDENGINE_QUERY_TIMEOUT_MSor--query-timeout-msTDENGINE_CONNECT_TIMEOUT_MSor--connect-timeout-msTRANSPORTor--transport(stdioorhttp)PORTor--port(for HTTP)
You can also provide credentials separately:
TDENGINE_USERTDENGINE_PASSWORDTDENGINE_DBTDENGINE_TOKEN
See .env.example for a ready-to-use template.
Run (stdio)
TDENGINE_DSN="ws://root:taosdata@localhost:6041/power" npm run devRun (http)
TDENGINE_DSN="ws://root:taosdata@localhost:6041/power" TRANSPORT=http PORT=8080 npm run devHTTP endpoint:
POST /mcpGET /healthz
Build
npm run build
npm start -- --transport=stdio --dsn "ws://root:taosdata@localhost:6041/power"