MCP ExplorerExplorer

Clickhouse Mcp Sse

@aankitroyon a year ago
2 MIT
FreeCommunity
AI Systems
FastAPI-based server for ClickHouse with SSE support and Docker deployment.

Overview

What is Clickhouse Mcp Sse

ClickHouse MCP SSE Server is a FastAPI-based server that provides a Server-Sent Events (SSE) interface for performing operations on a ClickHouse database using the Model Control Protocol (MCP).

Use cases

Use cases include real-time data updates in web applications, live data feeds for dashboards, and event-driven architectures where continuous data flow is essential.

How to use

To use ClickHouse MCP SSE Server, set up your environment by creating a .env file with your ClickHouse database credentials, then create a virtual environment, install dependencies, and run the server. Alternatively, you can deploy it using Docker by building and running the container.

Key features

Key features include a FastAPI-based REST API, support for Server-Sent Events (SSE), integration with ClickHouse database, and Docker deployment support.

Where to use

ClickHouse MCP SSE Server is suitable for applications that require real-time data streaming and communication with a ClickHouse database, such as analytics dashboards, monitoring tools, and data visualization applications.

Content

ClickHouse MCP SSE Server

A FastAPI-based server that provides Server-Sent Events (SSE) interface for ClickHouse database operations using MCP (Model Control Protocol).

Features

  • FastAPI-based REST API
  • Server-Sent Events (SSE) support
  • ClickHouse database integration
  • Docker deployment support

Prerequisites

  • Python 3.11+
  • Docker and Docker Compose
  • Access to a ClickHouse server

Environment Setup

Create a .env file in the project root with the following variables:

CLICKHOUSE_HOST=your_clickhouse_host
CLICKHOUSE_PORT=your_clickhouse_port
CLICKHOUSE_USER=your_clickhouse_user
CLICKHOUSE_PASSWORD=your_clickhouse_password
CLICKHOUSE_DATABASE=your_clickhouse_database

Local Development

  1. Create and activate a virtual environment:
python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
  1. Install dependencies:
pip install -r requirements.txt
  1. Run the server:
python mcp_server.py

The server will be available at http://localhost:8000

Docker Deployment

  1. Build and run the container:
docker-compose up -d --build
  1. Check container status:
docker-compose ps
  1. View logs:
docker-compose logs -f
  1. Stop the container:
docker-compose down

The server will be available at http://localhost:8083

API Endpoints

  • /sse: SSE endpoint for real-time communication
  • /messages: Endpoint for message handling

Project Structure

.
├── Dockerfile              # Docker configuration
├── docker-compose.yml      # Docker Compose configuration
├── mcp_server.py          # Main application file
├── requirements.txt       # Python dependencies
└── .env                   # Environment variables (not in version control)

License

[Add your license information here]

Tools

No tools

Comments

Recommend MCP Servers

View All MCP Servers