https://github.com/GreptimeTeam/greptimedb-mcp-server
A Model Context Protocol (MCP) server implementation for GreptimeDB
https://github.com/GreptimeTeam/greptimedb-mcp-server
Last synced: 28 days ago
JSON representation
A Model Context Protocol (MCP) server implementation for GreptimeDB
- Host: GitHub
- URL: https://github.com/GreptimeTeam/greptimedb-mcp-server
- Owner: GreptimeTeam
- License: mit
- Created: 2025-03-12T09:11:28.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2025-03-12T11:08:43.000Z (about 1 month ago)
- Last Synced: 2025-03-12T12:22:20.730Z (about 1 month ago)
- Language: Python
- Size: 4.88 KB
- Stars: 1
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
- awesome-mcp-list - GreptimeTeam/greptimedb-mcp-server - mcp-server?style=social)](https://github.com/GreptimeTeam/greptimedb-mcp-server): Enables querying of GreptimeDB. (Uncategorized / Uncategorized)
- awesome-mcp-zh - GreptimeDB
- awesome-mcp-servers - GreptimeTeam/greptimedb-mcp-server - MCP Server for querying GreptimeDB. (Legend / 🗄️ <a name="databases"></a>Databases)
- awesome-mcp-servers - GreptimeTeam/greptimedb-mcp-server - GreptimeDBのMCPサービスにクエリを実行する。 (サーバー実装 / 🗄️ <a name="databases"></a>データベース)
- awesome-mcp-servers - GreptimeDB MCP Server - A Model Context Protocol (MCP) server implementation for GreptimeDB (Table of Contents / Databases)
- awesome-mcp-servers - GreptimeDB MCP Server - A Model Context Protocol (MCP) server implementation for GreptimeDB (Table of Contents / Databases)
- awesome-mcp-servers - GreptimeDB - Provides AI assistants with a secure and structured way to explore and analyze data in [GreptimeDB](https://github.com/GreptimeTeam/greptimedb). (Official Servers)
README
# 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.
# Installation
```
pip install greptimedb-mcp-server
```# Configuration
Set the following environment variables:
```bash
GREPTIMEDB_HOST=localhost # Database host
GREPTIMEDB_PORT=4002 # Optional: Database port (defaults to 4002 if not specified)
GREPTIMEDB_USER=root
GREPTIMEDB_PASSWORD=
GREPTIMEDB_DATABASE=public
```Or via command-line args:
* `--host` the database host
* `--port` the database port
* `--user` the database username
* `--password` the database password
* `--database` the database name# 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`
```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"
}
}
}
}
```# 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
python -m venv venv
source venv/bin/activate # or `venv\Scripts\activate` on Windows# Install development dependencies
pip install -r requirements-dev.txt# Run tests
pytest
```Use [MCP Inspector](https://modelcontextprotocol.io/docs/tools/inspector) for debugging:
```bash
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:* [ktanaka101/mcp-server-duckdb](https://github.com/ktanaka101/mcp-server-duckdb)
* [designcomputer/mysql_mcp_server)](https://github.com/designcomputer/mysql_mcp_server)Thanks!