greptimedb-mcp-server

greptimedb-mcp-server

A Model Context Protocol (MCP) server for secure, structured AI access to GreptimeDB.

23
Stars
11
Forks
23
Watchers
4
Issues
greptimedb-mcp-server implements a Model Context Protocol (MCP) server for GreptimeDB, enabling AI assistants to securely explore and analyze database contents. It provides controlled operations such as listing tables, reading data, and executing SQL queries, ensuring responsible access. The server offers integration with Claude Desktop and supports prompt management for structured AI interactions.

Key Features

Implements Model Context Protocol (MCP) for database interaction
Supports listing of tables and database resources
Allows reading of table data via secure interface
Executes SQL queries through controlled tool calls
Provides prompt listing and retrieval features
Environment variable and CLI-based configuration
Seamless integration with Claude Desktop
Development and testing support with uv and pytest
Sample integration with MCP Inspector for debugging
Access control for responsible database usage

Use Cases

Powering AI assistants to access and analyze GreptimeDB databases securely
Embedding structured database exploration into AI-driven workflows
Enabling safe SQL execution from language model-based tools
Managing and utilizing prompt templates for AI interactions with data
Integrating database context with Claude Desktop environments
Developing custom chatbots or agents that need controlled data querying
Prototyping and testing MCP-compatible database integrations
Facilitating responsible and auditable database access in sensitive environments
Testing new data/AI features using the MCP Inspector tool
Providing a bridge between GreptimeDB and model-centric interfaces

README

greptimedb-mcp-server

PyPI - Version build workflow MIT License

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 tables
  • read_resource to read table data
  • list_tools to list tools
  • call_tool to execute an SQL
  • list_prompts to list prompts
  • get_prompt to get the prompt by name

Installation

pip install greptimedb-mcp-server

Configuration

Set the following environment variables:

bash
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

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:

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:

Thanks!

Star History

Star History Chart

Repository Owner

GreptimeTeam
GreptimeTeam

Organization

Repository Details

Language Python
Default Branch main
Size 60 KB
Contributors 4
License MIT License
MCP Verified Nov 12, 2025

Programming Languages

Python
100%

Tags

Join Our Newsletter

Stay updated with the latest AI tools, news, and offers by subscribing to our weekly newsletter.

We respect your privacy. Unsubscribe at any time.

Related MCPs

Discover similar Model Context Protocol servers

  • Multi-Database MCP Server (by Legion AI)

    Multi-Database MCP Server (by Legion AI)

    Unified multi-database access and AI interaction server with MCP integration.

    Multi-Database MCP Server enables seamless access and querying of diverse databases via a unified API, with native support for the Model Context Protocol (MCP). It supports popular databases such as PostgreSQL, MySQL, SQL Server, and more, and is built for integration with AI assistants and agents. Leveraging the MCP Python SDK, it exposes databases as resources, tools, and prompts for intelligent, context-aware interactions, while delivering zero-configuration schema discovery and secure credential management.

    • 76
    • MCP
    • TheRaLabs/legion-mcp
  • mcp-server-duckdb

    mcp-server-duckdb

    A Model Context Protocol server enabling SQL access to DuckDB databases.

    Implements a Model Context Protocol (MCP) server for DuckDB, allowing structured database interaction via MCP-compliant tools and language models. Offers a unified query tool for executing any SQL statement, with support for read-only mode to ensure data integrity. Flexible configuration options include database path specification and connection management. Easily integrable with applications like Claude Desktop for enhanced local data analysis through LLMs.

    • 171
    • MCP
    • ktanaka101/mcp-server-duckdb
  • MCP 数据库工具 (MCP Database Utilities)

    MCP 数据库工具 (MCP Database Utilities)

    A secure bridge enabling AI systems safe, read-only access to multiple databases via unified configuration.

    MCP Database Utilities provides a secure, standardized service for AI systems to access and analyze databases like SQLite, MySQL, and PostgreSQL using a unified YAML-based configuration. It enforces strict read-only operations, local processing, and credential protection to ensure data privacy and integrity. The tool is suitable for entities focused on data privacy and minimizes risks by isolating database connections and masking sensitive data. Designed for easy integration, it supports multiple installation options and advanced capabilities such as schema analysis and table browsing.

    • 85
    • MCP
    • donghao1393/mcp-dbutils
  • InfluxDB MCP Server

    InfluxDB MCP Server

    Expose InfluxDB data and tools to AI models via the Model Context Protocol.

    InfluxDB MCP Server is a Model Context Protocol (MCP) server that enables AI models to access, write, and manage time-series data stored in InfluxDB instances through a standardized API. It provides resources for organizations, buckets, and measurements, as well as tools for running Flux queries, writing data, and managing InfluxDB objects. The server includes prompt templates for common query operations and supports seamless integration with AI platforms like Claude Desktop. Easy installation options are offered via Smithery, npx, npm, or from source.

    • 27
    • MCP
    • idoru/influxdb-mcp-server
  • SQLite Explorer MCP Server

    SQLite Explorer MCP Server

    Secure, read-only access to SQLite databases for LLMs via the Model Context Protocol.

    SQLite Explorer MCP Server provides a safe, read-only interface to SQLite databases using the Model Context Protocol (MCP). Built with the FastMCP framework, it enables large language models to explore, query, and retrieve database schema information with robust safety and validation mechanisms. The server exposes structured tools such as read_query, list_tables, and describe_table, ensuring secure and reliable access to database contents. Designed for integration with platforms like Claude Desktop and Cline VSCode Plugin.

    • 93
    • MCP
    • hannesrudolph/sqlite-explorer-fastmcp-mcp-server
  • Hydrolix MCP Server

    Hydrolix MCP Server

    MCP server for secure, efficient SQL access to Hydrolix clusters.

    Hydrolix MCP Server provides a Model Context Protocol (MCP) interface for executing SQL queries, listing databases, and listing tables on Hydrolix clusters. It ensures safe, read-only data access and includes a standardized health-check endpoint. The server integrates easily with various MCP-compatible clients, supporting multiple authentication methods using either credentials or service account tokens.

    • 5
    • MCP
    • hydrolix/mcp-hydrolix
  • Didn't find tool you were looking for?

    Be as detailed as possible for better results