grafana-oncall-mcp
A dedicated Grafana OnCall MCP (Model Context Protocol) server written in Go.
Overview
The upstream mcp-grafana project targets Grafana Cloud and no longer supports grafana-oncall-app, which is archived and deprecated upstream. This MCP server exists to maintain compatibility for self-hosted Grafana OnCall instances that still run grafana-oncall-app or its rebranded successor grafana-irm-app. If you are using Grafana Cloud, use the official mcp-grafana from Grafana instead.
Quick Start (Recommended: uvx)
The fastest way to use this server is via uvx, which downloads a
small Python wrapper plus the pre-compiled Go binary from PyPI on
first invocation (~50MB total) and caches them. Requires uv.
# Install uv if you don't have it yet
curl -LsSf https://astral.sh/uv/install.sh | sh
# Smoke test
uvx --from grafana-oncall-mcp grafana-oncall-mcp -version
# grafana-oncall-mcp 0.1.0
Prerequisites
- For
uvx: uv (Python package manager; handles the Python wrapper + Go binary). - For Docker: a working Docker daemon.
- For source builds: Go 1.26.x.
- Access to a self-hosted Grafana instance with at least one supported OnCall plugin installed:
grafana-oncall-app(legacy, archived upstream) orgrafana-irm-app(rebranded successor)
- Grafana service account token with OnCall permissions.
- MCP client capable of stdio, SSE, or Streamable HTTP.
Configuration
Use direct OnCall API mode to call the OnCall Application API directly, bypassing the Grafana plugin resource proxy. This is the recommended mode for self-hosted instances.
export GRAFANA_ONCALL_API_URL="https://oncall-prod-us-central-0.grafana.net/oncall"
export GRAFANA_ONCALL_API_KEY="oncall_user_scoped_key"
Get these values from OnCall -> Settings:
GRAFANA_ONCALL_API_URL: the OnCall Application endpointGRAFANA_ONCALL_API_KEY: the user-scoped API key
Alternatively, set the Grafana endpoint and service account token:
export GRAFANA_URL="https://example.grafana.net"
export GRAFANA_SERVICE_ACCOUNT_TOKEN="glsa_..."
GRAFANA_API_KEY may be used instead of GRAFANA_SERVICE_ACCOUNT_TOKEN for compatibility with upstream mcp-grafana configuration conventions.
Optional settings:
# Default is oncall-app; accepted values: oncall-app | irm | unset
export GRAFANA_ONCALL_PLUGIN_PREFERENCE="oncall-app"
export GRAFANA_ONCALL_READ_ONLY=true
export OTEL_EXPORTER_OTLP_ENDPOINT="http://localhost:4318"
Build
go mod download
go build -o grafana-oncall-mcp ./cmd/oncall-mcp
Speckit setup (contributors)
This project uses Spec Kit for spec-driven development. Spec Kit manages the feature spec, plan, research, tasks, and contract artifacts under specs/.
-
Install the Specify CLI (requires uv and Python 3.11+):
uv tool install specify-cli --from git+https://github.com/github/spec-kit.git@v0.10.0
-
Initialize Spec Kit in the project root (this project is already initialized; run only if cloning fresh):
specify init . --force --integration copilot
This creates
.specify/memory/constitution.md(gitignored) and registers the Spec Kit slash-commands (/speckit.constitution,/speckit.specify,/speckit.plan,/speckit.tasks,/speckit.implement) in your AI coding agent. -
For each new feature, run the SDD pipeline from a feature spec:
/speckit.specify <feature description> /speckit.plan <tech stack and architecture choices> /speckit.tasks
The generated artifacts (
plan.md,research.md,data-model.md,contracts/,tasks.md) are committed alongside the spec inspecs/<feature-number>-<name>/.
Run
Stdio (default)
./grafana-oncall-mcp -transport=stdio
SSE
./grafana-oncall-mcp -transport=sse -address=:8000
Connect the MCP client to:
http://localhost:8000/sse
Streamable HTTP
./grafana-oncall-mcp -transport=streamable-http -address=:8000
Connect the MCP client to:
http://localhost:8000/mcp
Tools
Read tools:
list_oncall_schedulesget_oncall_shiftget_current_oncall_userslist_oncall_teamslist_oncall_userslist_alert_groupsget_alert_group
Write tools (omitted in read-only mode):
acknowledge_alert_groupresolve_alert_groupsilence_alert_groupunresolve_alert_group
RBAC Notes
The token must have permission to:
- Read OnCall schedules, shifts, teams, users, and alert groups
- Write (acknowledge / resolve / silence / unresolve) alert groups
Service account tokens are preferred over API keys. Use read-only mode (GRAFANA_ONCALL_READ_ONLY=true) in environments where the agent must never mutate state.
Running with Docker
A multi-profile docker-compose.yml is provided at the repo root. It supports three transports (stdio / SSE / streamable-HTTP) and reads the same .env file the binary would read directly.
# One-time setup
cp env.example .env
$EDITOR .env # fill in GRAFANA_URL + token
docker compose build mcp-stdio # build the image once
# One-shot stdio (the default profile) — use this from an MCP client:
docker compose run --rm mcp-stdio
# Or run a long-lived HTTP server in the background:
docker compose --profile http up -d
docker compose --profile http logs -f # check the dual-plugin probe
# Stop the HTTP server
docker compose --profile http down
Coding Agent Setup
The server works with any MCP-aware client (opencode, VS Code Copilot Chat, Claude Desktop, Cursor, Windsurf, etc.). All clients need the same environment variables. The examples below use the recommended direct OnCall API mode (GRAFANA_ONCALL_API_URL + GRAFANA_ONCALL_API_KEY) with GRAFANA_ONCALL_PLUGIN_PREFERENCE="oncall-app" as the default.
Set the env vars in your shell before launching the client:
export GRAFANA_ONCALL_API_URL="https://oncall-<region>.grafana.net/oncall"
export GRAFANA_ONCALL_API_KEY="<OnCall user-scoped API key>"
export GRAFANA_ONCALL_PLUGIN_PREFERENCE="oncall-app"
opencode
Add a server entry to your opencode.json (user-scoped at ~/.config/opencode/opencode.json, or project-scoped at ./opencode.json):
Using uvx (recommended):
{
"mcp": {
"grafana-oncall": {
"type": "local",
"command": ["uvx", "grafana-oncall-mcp", "-transport=stdio"],
"environment": {
"GRAFANA_ONCALL_API_URL": "{{env.GRAFANA_ONCALL_API_URL}}",
"GRAFANA_ONCALL_API_KEY": "{{env.GRAFANA_ONCALL_API_KEY}}",
"GRAFANA_ONCALL_PLUGIN_PREFERENCE": "oncall-app"
},
"enabled": true
}
}
}
Using Docker:
{
"mcp": {
"grafana-oncall": {
"type": "local",
"command": ["docker", "compose", "-f", "<repo-path>/docker-compose.yml", "--project-directory", "<repo-path>", "run", "--rm", "--no-deps", "--profile", "stdio", "mcp-stdio"],
"environment": {
"GRAFANA_ONCALL_API_URL": "{{env.GRAFANA_ONCALL_API_URL}}",
"GRAFANA_ONCALL_API_KEY": "{{env.GRAFANA_ONCALL_API_KEY}}",
"GRAFANA_ONCALL_PLUGIN_PREFERENCE": "oncall-app"
},
"enabled": true
}
}
}
Replace <repo-path> with the absolute path to this repository.
VS Code (GitHub Copilot Chat)
Add to .vscode/mcp.json (workspace-scoped) or VS Code settings.json:
Using uvx (recommended):
{
"servers": {
"grafana-oncall": {
"type": "stdio",
"command": "uvx",
"args": ["grafana-oncall-mcp", "-transport=stdio"],
"env": {
"GRAFANA_ONCALL_API_URL": "${input:grafanaOncallApiUrl}",
"GRAFANA_ONCALL_API_KEY": "${input:grafanaOncallApiKey}",
"GRAFANA_ONCALL_PLUGIN_PREFERENCE": "oncall-app"
}
}
},
"inputs": [
{
"id": "grafanaOncallApiUrl",
"type": "promptString",
"description": "OnCall Application endpoint URL",
"default": "https://oncall-prod-us-central-0.grafana.net/oncall"
},
{
"id": "grafanaOncallApiKey",
"type": "promptString",
"description": "OnCall user-scoped API key",
"password": true
}
]
}
Restart the Copilot Chat session after editing: Command Palette > "Copilot: Restart Chat Session".
Claude Desktop
Add to ~/.claude/claude_desktop_config.json (user-scoped):
Using uvx (recommended):
{
"mcpServers": {
"grafana-oncall": {
"command": "uvx",
"args": ["grafana-oncall-mcp", "-transport=stdio"],
"env": {
"GRAFANA_ONCALL_API_URL": "${GRAFANA_ONCALL_API_URL}",
"GRAFANA_ONCALL_API_KEY": "${GRAFANA_ONCALL_API_KEY}",
"GRAFANA_ONCALL_PLUGIN_PREFERENCE": "oncall-app"
}
}
}
}
Using Docker:
{
"mcpServers": {
"grafana-oncall": {
"command": "docker",
"args": [
"compose",
"-f", "<repo-path>/docker-compose.yml",
"--project-directory", "<repo-path>",
"run", "--rm", "--no-deps", "--profile", "stdio", "mcp-stdio"
],
"env": {
"GRAFANA_ONCALL_API_URL": "${GRAFANA_ONCALL_API_URL}",
"GRAFANA_ONCALL_API_KEY": "${GRAFANA_ONCALL_API_KEY}",
"GRAFANA_ONCALL_PLUGIN_PREFERENCE": "oncall-app"
}
}
}
}
Restart Claude Desktop after editing the config.
Verifying the connection
After configuring your client, ask the agent:
"List the OnCall teams in my Grafana."
A successful response from list_oncall_teams confirms the connection is healthy.
Release Process (for maintainers)
This repo ships a single Go source tree, but produces two distribution channels from one source:
- GitHub Releases (
.tar.gz/.zip) — built by GoReleaser from.goreleaser.yamlon everyv*tag push. - PyPI (
uvx grafana-oncall-mcp) — built by go-to-wheel which bundles the Go binary into a Python wrapper. Eight platform-specific wheels (linux/darwin/windows × amd64/arm64) are produced and uploaded via OIDC trusted publishing.
The CI wiring lives in .github/workflows/release.yml. The two jobs (goreleaser then pypi) run sequentially on every v* tag push.
Metadata
Release files for grafana-oncall-mcp 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| grafana_oncall_mcp-0.1.2-py3-none-win_arm64.whl | Python 3 | none | Windows ARM64 | Details |
| grafana_oncall_mcp-0.1.2-py3-none-win_amd64.whl | Python 3 | none | Windows x86-64 | Details |
| grafana_oncall_mcp-0.1.2-py3-none-musllinux_1_2_x86_64.whl | Python 3 | none | Linux musl 1.2+ x86-64 | Details |
| grafana_oncall_mcp-0.1.2-py3-none-musllinux_1_2_aarch64.whl | Python 3 | none | Linux musl 1.2+ ARM64 | Details |
| grafana_oncall_mcp-0.1.2-py3-none-manylinux_2_17_x86_64.whl | Python 3 | none | Linux glibc 2.17+ x86-64 | Details |
| grafana_oncall_mcp-0.1.2-py3-none-manylinux_2_17_aarch64.whl | Python 3 | none | Linux glibc 2.17+ ARM64 | Details |
| grafana_oncall_mcp-0.1.2-py3-none-macosx_11_0_arm64.whl | Python 3 | none | macOS 11.0+ ARM64 | Details |
| grafana_oncall_mcp-0.1.2-py3-none-macosx_10_9_x86_64.whl | Python 3 | none | macOS 10.9+ x86-64 | Details |
Total release size: 103.4 MB
Release files / grafana_oncall_mcp-0.1.2-py3-none-win_arm64.whl
| Download URL | grafana_oncall_mcp-0.1.2-py3-none-win_arm64.whl |
|---|---|
| Size | 12.4 MB |
| Tags | Python 3 Windows ARM64 |
|
SHA-256 checksum How to use checksums |
491018ed51b2071242aa40034eb1806b4281ed915a1168ccc3f5f85772ea7a25
|
|
BLAKE2b-256 checksum How to use checksums |
f3a7d296e6b09504eb0fa93dbedd0e7d72b70b26333198bc93f21ecbe03dd32d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 9, 2026.
Transparency logRelease files / grafana_oncall_mcp-0.1.2-py3-none-win_amd64.whl
| Download URL | grafana_oncall_mcp-0.1.2-py3-none-win_amd64.whl |
|---|---|
| Size | 13.5 MB |
| Tags | Python 3 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
f0cc5cb449681eb27016878070ed90525c7aa289e86a6fccbd0daf89f39ddb22
|
|
BLAKE2b-256 checksum How to use checksums |
2a24e6542808fc7048763da2dbeb9b2db0358090077eea3cacc804950f2238b9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 9, 2026.
Transparency logRelease files / grafana_oncall_mcp-0.1.2-py3-none-musllinux_1_2_x86_64.whl
| Download URL | grafana_oncall_mcp-0.1.2-py3-none-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 13.2 MB |
| Tags | Linux musl 1.2+ x86-64 Python 3 |
|
SHA-256 checksum How to use checksums |
cd459dde69246f2b5cb6042d2a685d29af46076d4ff34f8f7ec4a7fe25bc7f96
|
|
BLAKE2b-256 checksum How to use checksums |
fbc47942fff49c0ff6204fbd3518ad1ad6cf386603d576a56f9b118fce19af52
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 9, 2026.
Transparency logRelease files / grafana_oncall_mcp-0.1.2-py3-none-musllinux_1_2_aarch64.whl
| Download URL | grafana_oncall_mcp-0.1.2-py3-none-musllinux_1_2_aarch64.whl |
|---|---|
| Size | 12.3 MB |
| Tags | Linux musl 1.2+ ARM64 Python 3 |
|
SHA-256 checksum How to use checksums |
f1c6f0813152e706ad346bf1a13c410941c648b0c5470bfc45485a6417f07312
|
|
BLAKE2b-256 checksum How to use checksums |
e50f5e2f8c5a5b6317b7d5e02c7ce5c4e2fb4d8f0752614cdab2d8c64bb7d439
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 9, 2026.
Transparency logRelease files / grafana_oncall_mcp-0.1.2-py3-none-manylinux_2_17_x86_64.whl
| Download URL | grafana_oncall_mcp-0.1.2-py3-none-manylinux_2_17_x86_64.whl |
|---|---|
| Size | 13.2 MB |
| Tags | Linux glibc 2.17+ x86-64 Python 3 |
|
SHA-256 checksum How to use checksums |
d1f913190c867e2fdd5b46b8337d4d6335d64768db04a593acd6e1555f838af4
|
|
BLAKE2b-256 checksum How to use checksums |
880f323f921d9cd7577c253bd8dcb231bcea3f68c2ef770db20918636390f7a3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 9, 2026.
Transparency logRelease files / grafana_oncall_mcp-0.1.2-py3-none-manylinux_2_17_aarch64.whl
| Download URL | grafana_oncall_mcp-0.1.2-py3-none-manylinux_2_17_aarch64.whl |
|---|---|
| Size | 12.3 MB |
| Tags | Linux glibc 2.17+ ARM64 Python 3 |
|
SHA-256 checksum How to use checksums |
3b1fec289fd6a333563a5c9b325c5c2ae6b86565a890c8632f24e3f597e03c4f
|
|
BLAKE2b-256 checksum How to use checksums |
8cfadc48ea367cf523cb54c4f54b769740a8eee7b9bef35910c42fb636e1e67e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 9, 2026.
Transparency logRelease files / grafana_oncall_mcp-0.1.2-py3-none-macosx_11_0_arm64.whl
| Download URL | grafana_oncall_mcp-0.1.2-py3-none-macosx_11_0_arm64.whl |
|---|---|
| Size | 12.8 MB |
| Tags | Python 3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
9c04b70493ef693ddbcb271d0edb54b32aad1cdb30f9994890475858ab398550
|
|
BLAKE2b-256 checksum How to use checksums |
45d44209817fc29662195ad9251c0574ebc9a4c27f7e9091826f42357f9525c7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 9, 2026.
Transparency logRelease files / grafana_oncall_mcp-0.1.2-py3-none-macosx_10_9_x86_64.whl
| Download URL | grafana_oncall_mcp-0.1.2-py3-none-macosx_10_9_x86_64.whl |
|---|---|
| Size | 13.7 MB |
| Tags | Python 3 macOS 10.9+ x86-64 |
|
SHA-256 checksum How to use checksums |
a150a514cbdf4f7d7faa0eecc5f7645b160e4261eee27b8683553a075fe6c3fe
|
|
BLAKE2b-256 checksum How to use checksums |
7d8eba3b33300470c50704d53b92cc623ab0a9489c844de6c80e9fa6f518e19b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 9, 2026.
Transparency log