Repository navigation
feat(mcp): add keep-mcp sidecar MCP server - #6896
Open
harisrujanc wants to merge 5 commits into
Open
harisrujanc wants to merge 5 commits into
harisrujanc wants to merge 5 commits into
Conversation
Thin adapter over the Keep REST API exposing alerts, incidents, topology and workflows to MCP clients over stdio and streamable-HTTP. Write tools are opt-in (KEEP_MCP_ENABLE_WRITES). Includes Dockerfile and an opt-in 'mcp' compose profile. Closes keephq#6618 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
harisrujanc
force-pushed
the
harisrujanc-keep-mcp-server
branch
from
October 24, 2026 10:37
a110c98 to
4a577d3
Compare
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📑 Description
Adds
keep-mcp, an MCP (Model Context Protocol) server shipped as an independent sidecar next tokeep-backend, so LLM clients (Claude Desktop, Copilot CLI, Cursor, agent frameworks) can query Keep. It is a thin adapter over the Keep REST API: it stores no secrets or tenancy state and forwardsX-API-KEY, so Keep stays the single source of truth for authZ/RBAC.Closes #6618
Architecture
How to read it: orange = what this PR adds, white = existing Keep. Clients reach the sidecar over stdio (local, key from
KEEP_API_KEY) or streamable-HTTP (remote, each client sends its ownX-API-KEY). The sidecar registers the MCP tools/resources via FastMCP and callskeep-backendthroughKeepClient.Where it sits in a Keep deployment (opt-in
--profile mcp, loopback-only port):Deployment
Where it sits: keep-mcp is one extra container next to the existing Keep containers in
docker-compose.yml. It only starts with--profile mcp, has no database or volume, publishes8001on loopback only, and talks only tokeep-backendover the compose network. Kubernetes/Helm (keephq/helm-charts) is not covered by this PR.ELI5
Keep is a big notebook where all the "something is broken!" alarms get written down. AI assistants are smart, but they can't open that notebook on their own.
keep-mcp is a librarian standing next to the notebook. The AI asks a question ("which alarms are ringing?", "tell me about incident 42"), the librarian looks it up in Keep, and hands back the answer so the AI can help a person figure out what went wrong.
House rules:
X-API-KEY). The librarian has no master key, so you only see what Keep already lets you see.KEEP_MCP_ENABLE_WRITES=true), and every change is written in a logbook.run_workflowshows what it would do (dry_run=true) unless told otherwise.What's included
search_alerts,list_incidents,get_incident_with_alerts,get_topology,get_alert_history, alert/incident status summaries, workflows (list_workflows,get_workflow,list_workflow_runs,get_workflow_run,get_alert_workflow_executions)keep://topology,keep://incidents/{id},keep://alerts/{fingerprint}; prompttriage_alertchange_incident_status,add_alert_note,run_workflow— only registered withKEEP_MCP_ENABLE_WRITES=true; audit-logged;run_workflowdefaults todry_run=true/healthz,/readyz(HTTP transport)docker/Dockerfile.mcp(non-root), opt-inmcpprofile indocker-compose.yml(published on127.0.0.1:8001only)Security hardening
X-API-KEYfor tools and resources; no env-key fallback in HTTP mode (key is required)../..rejected) to prevent path/parameter injection; status filters use fixed allowlists./readyz; audit log uses%rand a hashed key id.Known limitations
search_alerts/get_alert_status_summarycallPOST /alerts/query, which triggers Keep's background provider pull (documented in the README).keep-backendruns withAUTH_TYPE=NO_AUTH; do not expose the MCP port beyond loopback unless the backend enforces auth.✅ Checks
keep-mcp/README.md)cd keep-mcp && pytest→ 25 passed)ℹ Additional Information
Run locally:
cd keep-mcp && pip install -e ".[dev]" && pytest, thenKEEP_API_URL=... KEEP_API_KEY=... keep-mcp(stdio) orMCP_TRANSPORT=streamable-http keep-mcp. Docker:docker compose --profile mcp up keep-mcp. Not verified against a livekeep-backendor a built Docker image.