Skip to main content
Glama

sop-mcp

PyPI Python License

An MCP server that brings process automation to AI agents through Standard Operating Procedures.

LLMs are powerful but unpredictable when executing multi-step processes — they skip steps, summarize instead of act, and lose track of where they are. sop-mcp solves this by delivering procedures one step at a time, forcing the agent to execute each step and provide concrete output before advancing. This turns SOPs into a control mechanism that makes LLM behavior predictable and auditable.

The result: agents that follow processes the way humans do — step by step, with reasoning enforced at each level.

This approach aligns with Agent SOPs — a standardized markdown format for defining AI agent workflows using RFC 2119 requirement levels (MUST, SHOULD, MAY). sop-mcp adds the execution layer: an MCP server that delivers these procedures one step at a time and enforces completion before advancing.

Install

Kiro

Cursor

VS Code

Add to Kiro

Install MCP Server

Install on VS Code

Or add manually:

{
  "mcpServers": {
    "sop-mcp": {
      "command": "uvx",
      "args": ["sop-mcp"],
      "env": { "SOP_STORAGE_DIR": "/path/to/your/sops" }
    }
  }
}

Related MCP server: Workflow Orchestration MCP Server

How It Works

Every session starts the same way — discover what's available, then execute.

list_resources()                                     → catalog of sop:// URIs
run_sop(sop_name="sop_creation_guide")               → Step 1 + instructions
run_sop(..., current_step=1, step_output="...")      → Step 2
run_sop(..., current_step=2, step_output="...")      → Step 3
  ...
run_sop(..., current_step=N, step_output="...")      → Completion

Each response tells the agent to execute the step — not just read it.

Bundled SOPs

Four SOPs ship with the server so new users can try run_sop immediately:

SOP

What it does

sop_creation_guide

Step-by-step guide for authoring new SOPs with RFC 2119 requirements

code_review_process

Standard code review workflow — prepare, review, address feedback, merge

employee_onboarding_setup

IT setup for a new hire — alias, email, hardware selection

user_onboarding_process

Provision identity, application access, and welcome package

Storage default: ~/.sop_mcp (seeded from the bundled SOPs on first run). Override with SOP_STORAGE_DIR.

Tools

Tool

Purpose

list_resources

Discover available SOPs (built in to every MCP client)

read_resource

Read an SOP's full content before executing it

run_sop

Execute an SOP step by step

publish_sop

Create or update an SOP

submit_sop_feedback

Record improvement suggestions

Full parameter reference: docs/mcp-reference.md

Documentation

Audience

Resource

AI tools

llms.txt — auto-discovered server description

Users

skills/sop-mcp-usage/ — how to use

Operators

skills/sop-mcp-configuration/ — install, configure, hooks

Developers

CONTRIBUTING.md — build, test, design decisions

Reference

docs/mcp-reference.md — full tool schemas

Development

uv sync              # install dependencies
uv run pytest        # run tests
uv run sop-mcp       # start server locally
uv run python scripts/generate_docs.py  # regenerate docs

License

MIT

Available Tools

5 tools
list_resourcesA

List all available resources with their URIs and descriptions.

Inputs: no named parameters.

publish_sopA

Publish a new or updated Standard Operating Procedure document.

The content parameter MUST contain the complete SOP markdown string with YAML frontmatter declaring:

  • name (required, snake_case, ≥3 underscore segments — the SOP's identity)

  • owner (required, non-empty string — team, alias, or email. This is the point of contact surfaced when feedback is submitted or a mismatch is detected during review. Pick a name you want pinged.)

  • stage (required, 'preprod' or 'prod' — informational lifecycle label; see the stage argument below for mismatch behaviour)

  • version (required, positive integer — advisory revision counter. The tool auto-bumps on each publish (+1), but we ask authors to declare it explicitly so a mismatch between the file on disk and what the author thinks they are updating is visible in the response)

  • description (optional — when omitted, the SOP's ## Overview section is used for short summaries)

Version & stage mismatch: the tool never trusts the frontmatter values blindly. The stage argument wins over the frontmatter stage, and the version is computed server-side (max existing + 1). Both values are overwritten in the stored content so the file on disk always reflects what actually happened. If you pass a version or stage that disagrees with the final stored values, the response surfaces the difference under warning so you can decide whether you were editing the right version.

Example call: {"content": "---\nname: my_sop_name\nversion: 1\nowner: my-team\nstage: preprod\n---\n\n# My SOP\n\n## Overview\nOverview text.\n\n### Step 1: First step\nDo the thing."}

Versioning: plain positive integers — 1, 2, 3, 4, … New SOPs start at 1; each subsequent publish increments by one. No semver.

Lint enforcement: every publish runs the same rule engine as the standalone sop-lint CLI. Errors (SOP rules at severity=error) BLOCK the publish — the tool raises and nothing is written. Warnings are returned under the warning field but do not block. Iterate locally with sop-lint <file> before calling publish_sop to avoid MCP round-trip latency.

Inputs: stage (required), content (required).

read_resourceC

Read a resource by its URI.

Inputs: uri (required).

run_sopA

Start or advance a Standard Operating Procedure step by step. Use list_resources to discover available SOPs, then call this tool with the SOP name.

Each call returns one step. Execute the step, then call again with current_step incremented to advance.

IMPORTANT: You MUST execute ALL actions described in the returned step content. Do NOT just read or summarize the step — perform the actions using your available tools.

When continuing (current_step >= 1), you MUST provide step_output with the concrete output you produced for the completed step.

Inputs: sop_name (required), step_output, current_step.

submit_sop_feedbackA

Submit improvement feedback for a specific SOP.

Feedback is appended as a single JSON line to {sop_name}.feedback.jsonl inside the SOP's folder. Each entry captures the SOP version, a UTC timestamp, and the feedback text — ready for review when the SOP is next revised.

Inputs: feedback (required), sop_name (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.8/5.0

    Scored across 5 tools

    Disambiguation5/5

    Each tool targets a distinct action: publishing, running, providing feedback, and generic resource listing/reading. No overlaps or ambiguous boundaries exist between the tools.

    Naming Consistency5/5

    All tools use verb_noun snake_case, with run_sop, publish_sop, list_resources, read_resource following the pattern, and submit_sop_feedback as a natural extension. Consistent and predictable.

    Tool Count5/5

    Five tools cover the SOP lifecycle without bloat; each tool serves a clear purpose. The count is well within the ideal range for a focused server.

    Completeness4/5

    The surface covers publish (create/update), run (execution), and feedback, with list/read for discovery. Missing delete/archive and feedback retrieval, but those are minor gaps for the core workflow.

    Maintenance

    ActivityActive
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      B
      maintenance
      Enables autonomous AI agents to proactively poll event queues, evaluate document compliance, retrieve grounded knowledge via semantic RAG, enforce human-in-the-loop approval gates, and track multi-model cost budgets.
      10
      MIT
    • F
      license
      Not graded
      quality
      Not graded
      maintenance
      Enables autonomous agents and multi-agent frameworks to route actions through deterministic human approval gates before execution. Enforces risk tiers, reversible checkpoints, and token approval bounds so that risky or costly operations can be reviewed, bounded, and rolled back without LLM round-trips.
      -