Provides AI assistants with a secure and structured way to explore and analyze data in GreptimeDB.
A Model Context Protocol (MCP) server implementation for GreptimeDB.
This server provides AI assistants with a secure and structured way to explore and analyze databases. It enables them to list tables, read data, and execute SQL queries through a controlled interface, ensuring responsible database access.
This is an experimental project that is still under development. Data security and privacy issues have not been specifically addressed, so please use it with caution.
list_resources
to list tablesread_resource
to read table datalist_tools
to list toolscall_tool
to execute an SQLlist_prompts
to list promptsget_prompt
to get the prompt by namepip install greptimedb-mcp-server
Set the following environment variables:
GREPTIMEDB_HOST=localhost # Database host
GREPTIMEDB_PORT=4002 # Optional: Database MySQL port (defaults to 4002 if not specified)
GREPTIMEDB_USER=root
GREPTIMEDB_PASSWORD=
GREPTIMEDB_DATABASE=public
Or via command-line args:
--host
the database host, localhost
by default,--port
the database port, must be MySQL protocol port, 4002
by default,--user
the database username, empty by default,--password
the database password, empty by default,--database
the database name, public
by default.Configure the MCP server in Claude Desktop's configuration file:
Location: ~/Library/Application Support/Claude/claude_desktop_config.json
Location: %APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"greptimedb": {
"command": "uv",
"args": [
"--directory",
"/path/to/greptimedb-mcp-server",
"run",
"-m",
"greptimedb_mcp_server.server"
],
"env": {
"GREPTIMEDB_HOST": "localhost",
"GREPTIMEDB_PORT": "4002",
"GREPTIMEDB_USER": "root",
"GREPTIMEDB_PASSWORD": "",
"GREPTIMEDB_DATABASE": "public"
}
}
}
}
MIT License - see LICENSE.md file for details.
uv
package manager# Clone the repository
git clone https://github.com/GreptimeTeam/greptimedb-mcp-server.git
cd greptimedb-mcp-server
# Create virtual environment
uv venv
source venv/bin/activate # or `venv\Scripts\activate` on Windows
# Install development dependencies
uv sync
# Run tests
pytest
Use MCP Inspector for debugging:
npx @modelcontextprotocol/inspector uv \
--directory \
/path/to/greptimedb-mcp-server \
run \
-m \
greptimedb_mcp_server.server
This library's implementation was inspired by the following two repositories and incorporates their code, for which we express our gratitude:
Thanks!
Read-only database access with schema inspection
Database interaction and business intelligence capabilities
Embeddings, vector search, document storage, and full-text search with the open-source AI application database
Query your ClickHouse database server.
Interact with the data stored in Couchbase clusters using natural language.
Hydrolix time-series datalake integration providing schema exploration and query capabilities to LLM-based workflows.
Open source MCP server specializing in easy, fast, and secure tools for Databases.
Interact & query with Meilisearch (Full-text & semantic search API)
Search, Query and interact with data in your Milvus Vector Database.
Query and analyze data with MotherDuck and local DuckDB