Skip to content

Adjust MCP server to be run in SSE mode and Docker #43

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

jasimmk
Copy link

@jasimmk jasimmk commented May 1, 2025

This pull request introduces Docker support for the MCP ClickHouse server, including a Dockerfile, Docker Compose configuration, and related updates to the server code and documentation. It also adds an SSE transport mode to the server and updates the project dependencies.

Docker support:

  • Added a Dockerfile to build the MCP ClickHouse server with dependencies and environment setup for Docker. The image includes ClickHouse-related environment variables and exposes port 28123.
  • Introduced a docker-compose.yml file to simplify running the server with Docker Compose, including environment variable configuration and port mapping.

SSE transport mode:

  • Added a new main_sse function in mcp_clickhouse/main.py to support running the server with SSE transport.
  • Updated mcp_clickhouse/mcp_server.py to allow specifying a server port, defaulting to 28123, and to support the SSE mode. [1] [2]

Documentation updates:

  • Updated README.md with instructions for running the server using Docker Compose and configuring the MCP client for Docker.

Dependency updates:

  • Updated pyproject.toml to bump the project version to 0.1.8, add uvicorn[standard] as a dependency, and register a new script entry point for the SSE mode (mcp-clickhouse-sse). [1] [2]

This was referenced May 1, 2025
@akshayparseja
Copy link

hey , thansk for this change @jasimmk .
Can you help me here. i deployed it on k8s using ur docker

and looks like its up

Started server process [32]
Waiting for application startup.
Application startup complete.
Uvicorn running on http://0.0.0.0:28123 (Press CTRL+C to quit)

Now im not able to retrive anything , is there any issue ?

Can you help me on how we can test this server.

i tried a few POST
"POST /api/v1/tools/run_select_query HTTP/1.1" 404 Not Found

but 404

jasimmk and others added 2 commits June 5, 2025 12:11
- Add dual mode support (HTTP/streaming) in server.py
- Add streaming capabilities to MCP server with ServerSession
- Create docker-run.sh for single-command Docker execution
- Update Dockerfile with proper environment variables and port 8213
- Add MCP_SERVER_MODE, MCP_SERVER_HOST, MCP_SERVER_PORT env vars
- Support both 'http' (default) and 'stream'/'streaming' modes

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Integrate new dataclass-based Table and Column structure
- Preserve streaming HTTP support functionality
- Merge improved list_tables implementation with enhanced schema info
- Add testing instructions from main branch

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants