Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions .github/workflows/publish-mcp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Publish to MCP Registry

# Publishes server.json to the official MCP Registry (registry.modelcontextprotocol.io),
# which the GitHub MCP Registry (github.com/mcp) syncs from.
#
# Run this AFTER the PyPI package and GHCR image for the release exist — the registry
# validates both artifacts at publish time:
# 1. Tag + GitHub release -> Docker image published to GHCR (release-docker.yml)
# 2. Run "publish" workflow -> package published to PyPI (publish.yml)
# 3. Run this workflow -> server published to the MCP Registry

on:
workflow_dispatch:
inputs:
ref:
description: "Tag to publish (e.g. v0.4.1)"
required: true

jobs:
publish:
runs-on: ubuntu-latest
permissions:
id-token: write # Required for OIDC authentication to the MCP Registry
contents: read

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.ref }}

- name: Set version in server.json from pyproject.toml
run: |
VERSION=$(grep -m1 '^version' pyproject.toml | sed 's/.*"\(.*\)"/\1/')
echo "Publishing version $VERSION"
jq --arg v "$VERSION" '
.version = $v
| .packages |= map(
if .registryType == "pypi" then .version = $v
elif .registryType == "oci" then .identifier = (.identifier | sub(":[^:]*$"; ":" + $v))
else . end)
' server.json > server.json.tmp && mv server.json.tmp server.json
echo "VERSION=$VERSION" >> "$GITHUB_ENV"

- name: Verify PyPI package exists
run: curl -fsS "https://pypi.org/pypi/mcp-clickhouse/${VERSION}/json" > /dev/null

- name: Verify GHCR image exists
run: docker manifest inspect "ghcr.io/clickhouse/mcp-clickhouse:${VERSION}" > /dev/null

- name: Install mcp-publisher
run: |
curl -L "https://github.com/modelcontextprotocol/registry/releases/latest/download/mcp-publisher_$(uname -s | tr '[:upper:]' '[:lower:]')_$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/').tar.gz" | tar xz mcp-publisher

- name: Authenticate to MCP Registry
run: ./mcp-publisher login github-oidc

- name: Publish server to MCP Registry
run: ./mcp-publisher publish
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ FROM python:3.13-slim-bookworm
LABEL org.opencontainers.image.source="https://github.com/ClickHouse/mcp-clickhouse"
LABEL org.opencontainers.image.description="MCP server for ClickHouse"
LABEL org.opencontainers.image.licenses="Apache-2.0"
LABEL io.modelcontextprotocol.server.name="io.github.ClickHouse/mcp-clickhouse"

# Set the working directory
WORKDIR /app
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# ClickHouse MCP Server

<!-- mcp-name: io.github.ClickHouse/mcp-clickhouse -->

[![PyPI - Version](https://img.shields.io/pypi/v/mcp-clickhouse)](https://pypi.org/project/mcp-clickhouse)

An MCP server for ClickHouse.
Expand Down
166 changes: 166 additions & 0 deletions server.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
{
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
"name": "io.github.ClickHouse/mcp-clickhouse",
"title": "ClickHouse",
"description": "Official ClickHouse MCP server for querying and exploring ClickHouse clusters and chDB.",
"version": "0.4.0",
"repository": {
"url": "https://github.com/ClickHouse/mcp-clickhouse",
"source": "github"
},
"websiteUrl": "https://clickhouse.com",
"packages": [
{
"registryType": "pypi",
"identifier": "mcp-clickhouse",
"version": "0.4.0",
"runtimeHint": "uvx",
"transport": {
"type": "stdio"
},
"environmentVariables": [
{
"name": "CLICKHOUSE_HOST",
"description": "Hostname of the ClickHouse server",
"isRequired": true
},
{
"name": "CLICKHOUSE_USER",
"description": "Username for ClickHouse authentication",
"isRequired": true
},
{
"name": "CLICKHOUSE_PASSWORD",
"description": "Password for ClickHouse authentication",
"isRequired": true,
"isSecret": true
},
{
"name": "CLICKHOUSE_PORT",
"description": "ClickHouse HTTP(S) port. Defaults to 8443 when CLICKHOUSE_SECURE=true, 8123 otherwise",
"isRequired": false
},
{
"name": "CLICKHOUSE_SECURE",
"description": "Use HTTPS to connect to ClickHouse",
"format": "boolean",
"default": "true",
"isRequired": false
},
{
"name": "CLICKHOUSE_VERIFY",
"description": "Verify SSL certificates",
"format": "boolean",
"default": "true",
"isRequired": false
},
{
"name": "CLICKHOUSE_DATABASE",
"description": "Default database to use",
"isRequired": false
},
{
"name": "CLICKHOUSE_ROLE",
"description": "ClickHouse role to activate for the session",
"isRequired": false
},
{
"name": "CLICKHOUSE_ALLOW_WRITE_ACCESS",
"description": "Allow write operations (DDL and DML). Queries run read-only by default",
"format": "boolean",
"default": "false",
"isRequired": false
},
{
"name": "CLICKHOUSE_ALLOW_DROP",
"description": "Allow destructive operations (DROP, TRUNCATE) when write access is also enabled",
"format": "boolean",
"default": "false",
"isRequired": false
},
{
"name": "CLICKHOUSE_MCP_QUERY_TIMEOUT",
"description": "Query tool timeout in seconds",
"format": "number",
"default": "30",
"isRequired": false
}
]
},
{
"registryType": "oci",
"identifier": "ghcr.io/clickhouse/mcp-clickhouse:0.4.0",
"transport": {
"type": "stdio"
},
"environmentVariables": [
{
"name": "CLICKHOUSE_HOST",
"description": "Hostname of the ClickHouse server",
"isRequired": true
},
{
"name": "CLICKHOUSE_USER",
"description": "Username for ClickHouse authentication",
"isRequired": true
},
{
"name": "CLICKHOUSE_PASSWORD",
"description": "Password for ClickHouse authentication",
"isRequired": true,
"isSecret": true
},
{
"name": "CLICKHOUSE_PORT",
"description": "ClickHouse HTTP(S) port. Defaults to 8443 when CLICKHOUSE_SECURE=true, 8123 otherwise",
"isRequired": false
},
{
"name": "CLICKHOUSE_SECURE",
"description": "Use HTTPS to connect to ClickHouse",
"format": "boolean",
"default": "true",
"isRequired": false
},
{
"name": "CLICKHOUSE_VERIFY",
"description": "Verify SSL certificates",
"format": "boolean",
"default": "true",
"isRequired": false
},
{
"name": "CLICKHOUSE_DATABASE",
"description": "Default database to use",
"isRequired": false
},
{
"name": "CLICKHOUSE_ROLE",
"description": "ClickHouse role to activate for the session",
"isRequired": false
},
{
"name": "CLICKHOUSE_ALLOW_WRITE_ACCESS",
"description": "Allow write operations (DDL and DML). Queries run read-only by default",
"format": "boolean",
"default": "false",
"isRequired": false
},
{
"name": "CLICKHOUSE_ALLOW_DROP",
"description": "Allow destructive operations (DROP, TRUNCATE) when write access is also enabled",
"format": "boolean",
"default": "false",
"isRequired": false
},
{
"name": "CLICKHOUSE_MCP_QUERY_TIMEOUT",
"description": "Query tool timeout in seconds",
"format": "number",
"default": "30",
"isRequired": false
}
]
}
]
}
Loading