Skip to content

Expose incident postmortems/runbooks (#19) through the API, MCP and Slack #198

Backlog

Description

@OkiriGabriel

Context

Since #19 (PR #187), every completed incident gets postmortem.md, runbook.md and kb.md written next to its logs ({org}/logs/<y>/<m>/<incident_id>/). The only way to read them now is to open the storage bucket directly.

Proposed solution

  • GET /orgs/{org}/incidents/{incident_id}/docs lists the available documents (viewer role).
  • GET /orgs/{org}/incidents/{incident_id}/docs/{name} returns the markdown (text/markdown).
  • Add an MCP tool get_incident_docs.
  • Link the postmortem from the Slack resolution message when PUBLIC_BASE_URL is set.
  • Optionally, an POST …/docs/{name}/publish that copies a reviewed runbook into the org's docs (/orgs/{org}/docs). This must be an explicit human action, never automatic: incident text can contain attacker-controlled log lines, and the agent reads org docs back.
  • Tests: RBAC (viewer can read, another org gets 403), 404 for unknown incidents, and that the month folder is found without the caller knowing it.

Files

api/server.py, services/incident_store.py, devops_mcp/registry.py, tools/notify.py, docs/API_REFERENCE.md

Activity

  1. added
    enhancement
    on Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions