Skip to content

Commit 5988c6e

Browse files
committed
chore: add server.json for MCP registry
Also update the 'docker' CI workflow to publish to the registry after building and pushing the image. This is split out of #291 since it's actually a different thing; this PR adds our MCP server to the registry, using the Docker image. The other will add an MCPB manifest which we _could_ use for the registry instead, and which can be used for Claude Desktop.
1 parent 3c57f77 commit 5988c6e

File tree

3 files changed

+101
-2
lines changed

3 files changed

+101
-2
lines changed

.github/workflows/docker.yml

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@ on:
99

1010
permissions:
1111
contents: read
12-
id-token: write
1312

1413
jobs:
1514
docker:
1615
runs-on: ubuntu-latest
16+
permissions:
17+
id-token: write
1718
steps:
1819
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
1920

@@ -31,3 +32,50 @@ jobs:
3132
latest
3233
${{ steps.tag.outputs.version }}
3334
push: true
35+
36+
mcp-registry:
37+
runs-on: ubuntu-latest
38+
needs: docker
39+
permissions:
40+
contents: read
41+
id-token: write
42+
steps:
43+
- name: Checkout code
44+
uses: actions/checkout@v5
45+
with:
46+
fetch-depth: 0
47+
48+
- name: Extract version from tag
49+
id: version
50+
run: |
51+
# Get the tag from the triggering workflow
52+
TAG=$(git describe --tags --exact-match HEAD 2>/dev/null || echo "")
53+
if [ -z "$TAG" ]; then
54+
echo "No tag found at HEAD"
55+
exit 1
56+
fi
57+
echo "VERSION=$TAG" >> $GITHUB_OUTPUT
58+
59+
- name: Install dependencies
60+
run: |
61+
sudo apt-get update && sudo apt-get install -y jq
62+
curl -L "https://github.com/modelcontextprotocol/registry/releases/download/v1.2.3/mcp-publisher_1.2.3_linux_amd64.tar.gz" | tar xz mcp-publisher
63+
chmod +x mcp-publisher
64+
sudo mv mcp-publisher /usr/local/bin/
65+
66+
- name: Update server.json with Docker image
67+
run: |
68+
# Update the server.json with the correct Docker image reference
69+
# (note the image tag does not include the "v" prefix)
70+
jq --arg version "${{ steps.version.outputs.VERSION }}" \
71+
--arg image "grafana/mcp-grafana:${{ steps.version.outputs.VERSION#v }}" \
72+
'.packages[0].version = $version |
73+
.packages[0].identifier = $image |
74+
.version = $version' server.json > server.json.tmp
75+
mv server.json.tmp server.json
76+
77+
- name: Login to MCP Registry
78+
run: mcp-publisher login github-oidc
79+
80+
- name: Publish to MCP Registry
81+
run: mcp-publisher publish

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Build stage
22
FROM golang:1.24-bullseye AS builder
33

4-
LABEL io.modelcontextprotocol.server.name="grafana/mcp-grafana"
4+
LABEL io.modelcontextprotocol.server.name="io.github.grafana/mcp-grafana"
55

66
# Set the working directory
77
WORKDIR /app

server.json

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
{
2+
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-09-29/server.schema.json",
3+
"name": "io.github.grafana/mcp-grafana",
4+
"description": "An MCP server giving access to Grafana dashboards, data and more.",
5+
"repository": {
6+
"url": "https://github.com/grafana/mcp-grafana",
7+
"source": "github"
8+
},
9+
"version": "0.6.5",
10+
"packages": [
11+
{
12+
"registryType": "oci",
13+
"registryBaseUrl": "https://docker.io",
14+
"identifier": "grafana/mcp-grafana",
15+
"version": "0.6.5",
16+
"transport": {
17+
"type": "stdio"
18+
},
19+
"environmentVariables": [
20+
{
21+
"description": "URL to your Grafana instance",
22+
"isRequired": true,
23+
"format": "string",
24+
"isSecret": false,
25+
"name": "GRAFANA_URL"
26+
},
27+
{
28+
"description": "Service account token used to authenticate with your Grafana instance",
29+
"isRequired": false,
30+
"format": "string",
31+
"isSecret": true,
32+
"name": "GRAFANA_SERVICE_ACCOUNT_TOKEN"
33+
},
34+
{
35+
"description": "Username to authenticate with your Grafana instance",
36+
"isRequired": false,
37+
"format": "string",
38+
"isSecret": false,
39+
"name": "GRAFANA_USERNAME"
40+
},
41+
{
42+
"description": "Password to authenticate with your Grafana instance",
43+
"isRequired": false,
44+
"format": "string",
45+
"isSecret": true,
46+
"name": "GRAFANA_PASSWORD"
47+
}
48+
]
49+
}
50+
]
51+
}

0 commit comments

Comments
 (0)