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_resourcesto list tablesread_resourceto read table datalist_toolsto list toolscall_toolto execute an SQLlist_promptsto list promptsget_promptto 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:
--hostthe database host,localhostby default,--portthe database port, must be MySQL protocol port,4002by default,--userthe database username, empty by default,--passwordthe database password, empty by default,--databasethe database name,publicby default.--timezonethe 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
uvpackage 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
NetSuite MCP Server by CData
A read-only MCP server that allows LLMs to query live NetSuite data. Requires the CData JDBC Driver for NetSuite.
Vertica MCP Server
Provides read-only access to Vertica databases.
Quran Cloud
Access the Quran API from alquran.cloud to retrieve accurate Quranic text and reduce LLM hallucinations.
NSE Ticker MCP Server
Provides access to National Stock Exchange (NSE) data using the Upstox API.
SQL Server Express
An MCP server for interacting with Microsoft SQL Server Express databases.
DuckDB Knowledge Graph Memory
An MCP memory server that uses a DuckDB backend for persistent knowledge graph storage.
CData SAP BusinessObjects BI
A read-only MCP server for SAP BusinessObjects BI, powered by the CData JDBC Driver.
Local Context Memory MCP
A production-ready persistent memory system for AI agents, offering searchable memory across sessions with semantic search and support for multiple database backends.
Keboola MCP Server
An MCP server for interacting with the Keboola Connection data platform.
MySQL MCP Server
Enables secure interaction with MySQL databases, allowing AI assistants to list tables, read data, and execute SQL queries through a controlled interface.