English | 简体中文
- 1. Introduction
- 2. Documentation
- 3. Prerequisites
- 4. Build
- 5. Testing
- 6. CI/CD
- 7. Submitting Issues
- 8. Submitting PRs
- 9. References
- 10. License
MCP Server for TDengine TSDB provides a complete set of tools for querying, managing, and monitoring TDengine time-series database.
- Query Tool (query) - Execute TDengine SELECT queries and return results
- Show Tool (show) - Execute various SHOW commands to query metadata, supporting multiple parameter options
- Info Tool (info) - Provide TDengine server information, including version, status, etc.
- Describe Table Tool (describe_table) - Describe the structure of a specified table
- Predefined Schema Overview Tool (get_schema_overview) - Get database structure overview information
- Developed in Go language, lightweight and efficient
- Uses TDengine WebSocket driver to connect to the database
- Supports configuration via command line parameters and environment variables
- CSV format result output
| Parameter | Environment Variable | Default Value | Description |
|---|---|---|---|
--host |
TDENGINE_HOST |
localhost |
TDengine hostname |
--port |
TDENGINE_PORT |
6041 |
TDengine port (taosAdapter port) |
--user |
TDENGINE_USER |
root |
TDengine username |
--pass |
TDENGINE_PASS |
taosdata |
TDengine password |
--db |
TDENGINE_DB |
TDengine database name | |
--dsn |
TDENGINE_DSN |
TDengine Data Source Name (DSN), higher priority than individual connection parameters | |
--schema_overview_file |
TDENGINE_SCHEMA_OVERVIEW_FILE |
Predefined database schema overview file path |
- Download the latest release
- Place the executable in your system's
$PATHor in an easily accessible location. - Alternatively, if you have Go installed, you can build from source using:
go install -v github.com/taosdata/mcp-tdengine-tsdb@latestExample of adding to MCP configuration file:
{
"mcpServers": {
"tdengine-tsdb": {
"command": "mcp-tdengine-tsdb",
"args": [
"--host", "localhost",
"--port", "6041",
"--user", "root",
"--pass", "taosdata",
"--db", "test"
]
}
}
}command: Specify the executable name or pathargs: List of parameters passed to the executable
- Go 1.24.12 environment
- TDengine database 3.3.6.0 or higher
- Git version control tool
git clone https://github.com/taosdata/mcp-tdengine-tsdb.git
cd mcp-tdengine-tsdbgo build -o mcp-tdengine-tsdbTests will operate on the test database, which will be deleted after testing. Please ensure the test database does not contain important data.
- Before running tests, ensure that the TDengine server is installed and that
taosdandtaosAdapterare running. The database should be empty. - In the project directory, run
go test ./...to execute the tests. The tests will connect to the local TDengine server and taosAdapter for testing. - The output result
PASSmeans the test passed, whileFAILmeans the test failed. For detailed information, rungo test -v ./....
Add test cases to the *_test.go file to ensure that the test cases cover the new code.
Performance testing is in progress.
The project uses GitHub Actions for continuous integration and continuous deployment (CI/CD), with configuration files located at .github/workflows/build.yml.
When code is pushed to the main branch or a pull request is created for the main branch, the CI workflow will automatically trigger, executing automated builds and tests.
We welcome submitting GitHub Issues. When submitting, please include the following information:
- Problem description
- Reproduction steps
- Expected behavior
- Actual behavior
- Environment information
- Related screenshots or logs
We welcome developers to contribute to this project. When submitting PRs, please follow these steps:
- Fork this project. Please refer to how to fork a repo.
- Create a new branch from the main branch with a meaningful branch name (
git checkout -b my_branch). - Modify the code, ensure all unit tests pass, and add new unit tests to verify the changes.
- Push the changes to the remote branch (
git push origin my_branch). - Create a Pull Request on GitHub. Please refer to how to create a pull request.
- After submitting the PR, you can find your PR through the Pull Request. Click on the corresponding link to see if the CI for your PR has passed. If it has passed, it will display "All checks have passed". Regardless of whether the CI passes or not, you can click "Show all checks" -> "Details" to view the detailed test case logs.
- After submitting the PR, if the CI passes, you can find your PR on the codecov page to check the coverage.