GreptimeDB
Provides AI assistants with a secure and structured way to explore and analyze data in GreptimeDB.
greptimedb-mcp-server
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.
Project Status
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.
Capabilities
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 name
Installation
pip install greptimedb-mcp-server
Configuration
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
GREPTIMEDB_TIMEZONE=UTC
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.--timezone
the session time zone, empty by default(using server default time zone).
Usage
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
{
"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",
"GREPTIMEDB_TIMEZONE": ""
}
}
}
}
License
MIT License - see LICENSE.md file for details.
Contribute
Prerequisites
- Python with
uv
package manager - GreptimeDB installation
- MCP server dependencies
Development
# 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
Acknowledgement
This library's implementation was inspired by the following two repositories and incorporates their code, for which we express our gratitude:
Thanks!
Related Servers
libSQL by xexr
MCP server for libSQL databases with comprehensive security and management tools. Supports file, local HTTP, and remote Turso databases with connection pooling, transaction support, and 6 specialized database tools.
Movies MCP Server
A comprehensive movie database server supporting advanced search, CRUD operations, and image management via a PostgreSQL database.
Qdrant
Implement semantic memory layer on top of the Qdrant vector search engine
Supabase MCP Server
An MCP server providing administrative control over a Supabase PostgreSQL database, compatible with Cursor's Composer and Codeium's Cascade.
MySQL MCP Tools
Provides tools for querying and managing a MySQL database.
Tesouro Direto MCP Server
Provides natural language access to Brazilian treasury bond data from the Tesouro Direto API, allowing users to query market data and bond details.
Nile Postgres
Manage and query databases, tenants, users, auth using LLMs
Hasura GraphQL
Interact with a Hasura GraphQL endpoint, enabling schema introspection, queries, mutations, and data aggregation.
Data Exploration
MCP server for autonomous data exploration on .csv-based datasets, providing intelligent insights with minimal effort.
Neon
Interact with the Neon serverless Postgres platform