Skip to main content
Glama
ValentinoWang

Control-PromotionMCP

control-promotion-mcp

Portable governance control-promotion CLI and MCP server.

This repository turns recurring engineering experience into a structured control lifecycle:

raw evidence
  -> reusable observation
  -> docs / Skill / scoped AGENTS
  -> static guard / QA harness
  -> type, schema, or contract prevention
  -> retired guard

The package has three layers:

control_promotion        # deterministic core and CLI
control_promotion_mcp    # read-only MCP server
.control-promotion.yaml  # project adapter

Why MCP

MCP lets a server expose callable tools, readable resources, and reusable prompts over JSON-RPC. The 2025-06-18 specification defines stdio and Streamable HTTP transports; stdio messages are newline-delimited JSON-RPC, and Streamable HTTP uses POST requests to a single MCP endpoint. This server follows that model for a read-only governance control plane.

References:

Related MCP server: scan-your-ai-toolkit

Install

pip install control-promotion-mcp

For local development:

python -m venv .venv
. .venv/bin/activate
pip install -e .

CLI

control-promotion inspect --project-root .
control-promotion validate-adapter .control-promotion.yaml
control-promotion validate-catalog references/smell-catalog.yaml
control-promotion validate-guard-spec examples/guard-specs/good-creation-table-contract.yaml
control-promotion run-guard-fixtures \
  examples/guard-specs/good-creation-table-contract.yaml \
  --command "python examples/mock-guards/creation_table_guard.py" \
  > /tmp/creation-table-proof.yaml
control-promotion validate-fixture-execution \
  /tmp/creation-table-proof.yaml \
  --guard-spec examples/guard-specs/good-creation-table-contract.yaml
control-promotion review-guard \
  examples/guard-specs/good-creation-table-contract.yaml \
  --execute "python examples/mock-guards/creation_table_guard.py"
control-promotion route \
  --failure-class frontend_semantic_metric_without_source \
  --detectability static \
  --recurrence repeated \
  --harm high
control-promotion review --candidate candidate.yaml --format markdown

Candidate file:

candidate_text: |
  frontend-metric-source-guard prevents hard-coded semantic KPI literals.
evidence:
  paths:
    - scripts/quality/check_frontend_metric_source_guard.py
  commands:
    - bash scripts/quality/run_frontend_metric_source_guard.sh --mode ci
context:
  recurrence: repeated
  harm: high

MCP stdio

{
  "mcpServers": {
    "control-promotion": {
      "command": "control-promotion-mcp",
      "args": [
        "--project-root",
        ".",
        "--adapter",
        ".control-promotion.yaml",
        "--mode",
        "stdio"
      ]
    }
  }
}

MCP HTTP

control-promotion-mcp \
  --project-root . \
  --adapter .control-promotion.yaml \
  --mode http \
  --host 127.0.0.1 \
  --port 8765

The V1 HTTP server exposes POST /mcp and returns one JSON response. It binds to localhost by default and rejects non-local Origin headers. It intentionally does not expose write tools.

Exposed MCP Tools

  • inspect_project

  • evaluate_control_candidate

  • route_control_destination

  • validate_smell_catalog

  • validate_project_adapter

  • validate_guard_spec

  • review_guard_quality

  • validate_fixture_execution

  • render_smell_gate_report

  • check_ssot_links

evaluate_control_candidate also returns an abstraction_review block. This block flags guard-quality issues that routing alone cannot catch, including incident-string denylist overfit, fixed current-file allowlists, missing positive/negative fixtures, missing canonical contracts, missing scoped surface discovery, and missing exception policies.

Example high-risk result:

decision: refactor_before_promote
control_level: L5_static_quality_guard
abstraction_review:
  specificity_risk: high
  overfit_signals:
    - literal_incident_phrase_denylist
    - fixed_current_file_allowlist
    - missing_targeted_fixtures
    - missing_canonical_contract
  missing_abstraction:
    - canonical_contract
    - deprecated_alias_set
    - scoped_surface_discovery
    - exception_policy
  recommendation: refactor_before_promote

GuardSpec Promotion Gate

Starting in v0.3.0, static quality guards should provide a GuardSpec before promotion to L5. GuardSpec is the evidence layer that proves the guard protects a reusable invariant instead of one observed incident.

Minimum shape:

id: creation-table-name-contract
protected_invariant: User-facing creation output targets must use the canonical table name.
failure_class: deprecated_creation_table_alias
contract:
  owner: CREATION_OUTPUT_TABLE_CONTRACT
  canonical: 03_创作任务总表
  source: MEDIA_OS_CREATION_TASKS_URL
scan_scope:
  include:
    - docs/说明书/**
    - openclaw-agents/media/**
  exclude:
    - tmp/**
    - agents-results/**
    - tests/fixtures/**
fixtures:
  positive:
    - 产出位置:写入 03_创作任务总表
  negative:
    - 产出位置:写入创作灵感表
  near_miss:
    - 事实源字段 current_node_title 可以保存历史标题“创作灵感表”
  exception:
    - allow reason=truth-source owner=media-os expires=2026-12-31 scope=registry.json
exception_policy:
  required_fields: [reason, owner, expires, scope]
retirement:
  stronger_control: schema_or_registry_contract
  condition: All user-facing labels are rendered from the registry contract.
  action: downgrade heuristic guard to a contract smoke check.

Examples:

control-promotion validate-guard-spec examples/guard-specs/good-creation-table-contract.yaml
control-promotion run-guard-fixtures \
  examples/guard-specs/good-creation-table-contract.yaml \
  --command "python examples/mock-guards/creation_table_guard.py" \
  --format yaml
control-promotion review-guard \
  examples/guard-specs/good-creation-table-contract.yaml \
  --fixture-execution examples/fixture-execution/good-creation-table-contract.yaml
control-promotion review --candidate examples/candidates/good-creation-table-contract.yaml

control-promotion validate-guard-spec examples/guard-specs/bad-incident-string-guard.yaml
control-promotion review --candidate examples/candidates/bad-incident-string-guard.yaml --format markdown

The bad sample is intentionally blocked because it has a one-incident phrase denylist, fixed file scope, no canonical contract, no near-miss fixture, incomplete exception policy, and no retirement path.

Starting in v0.4.0, GuardSpec alone is not enough for promotion. L5 promotion requires fixture execution proof. The local CLI can execute fixtures through a narrow stdin/exit-code interface; the MCP server only validates supplied proof and does not run commands.

Starting in v0.6.0, execution proof has a stricter trust boundary. guard_spec_fingerprint detects GuardSpec drift, but it is not a signature and does not prove that execution happened. Reusing a proof file is treated as declared external evidence, even if it contains proof_origin: executed. Use review-guard --execute or review --execute when the gate decision must be based on tool-executed fixtures. This is a breaking change from v0.5.0: externally supplied executed proof no longer promotes an L5 guard.

Starting in v0.5.0, abstraction risk is based on structured GuardSpec fields and the cataloged abstraction rubric, not candidate prose. Candidate/evidence text can still produce warnings, but text warnings do not lower or raise the promotion risk score.

Exposed MCP Resources

  • control://ladder

  • control://routing-matrix

  • control://abstraction-rubric

  • control://smell-rubric

  • control://proof-obligations

  • control://retirement-policy

  • control://fingerprints

  • catalog://base

  • catalog://project

  • adapter://project

  • schema://guard-spec

  • schema://fixture-execution

  • sample://guard-spec/good-creation-table-contract

  • sample://guard-spec/bad-incident-string-guard

  • template://smell-gate-report

Exposed MCP Prompts

  • review-control-candidate

  • promote-experience

  • retire-guard

Project Adapter

Every consuming repository should keep project-specific paths and policies in .control-promotion.yaml instead of forking this server. The adapter expresses:

  • project type

  • AGENTS, Skill, docs, quality, QA, and generated paths

  • SSOT links

  • baseline quality commands

  • routing overrides

  • generated artifact and write-tool policies

Safety Model

V1 is read-only. It can inspect files, validate catalogs/adapters, classify candidates, and render reports. It does not write repository files, run arbitrary project commands, or mutate governance rules through MCP.

Future write tools should remain disabled by default, require explicit path scopes, forbid generated and secret paths, and return diffs plus verification commands before applying changes.

Development

python -m unittest discover -s tests
PYTHONPATH=src python -m control_promotion.cli validate-adapter .control-promotion.yaml
PYTHONPATH=src python -m control_promotion.cli validate-catalog references/smell-catalog.yaml
PYTHONPATH=src python -m control_promotion.cli validate-guard-spec examples/guard-specs/good-creation-table-contract.yaml
PYTHONPATH=src python -m control_promotion.cli review-guard examples/guard-specs/good-creation-table-contract.yaml --execute "python examples/mock-guards/creation_table_guard.py"

This repository intentionally does not use GitHub Actions. Run the local validation commands above before publishing a commit or tag.

Available Tools

7 tools
evaluate_control_candidateEvaluate Control CandidateB
Read-only

Evaluate a proposed rule, guard, skill, or remediation and decide its control maturity.

ParametersJSON Schema
NameRequiredDescriptionDefault
candidate_textYes
evidenceNo
contextNo

TDQS

B3.2/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=true and destructiveHint=false, so the safety profile is clear. The description adds that it 'decides' maturity, implying a non-mutating classification. However, it does not describe the decision process or any side effects. No contradiction with annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence, no redundancy. Could include structure like parameter details, but for a brief description it is concise. However, it is under-specified for a complex tool.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With 3 parameters (1 required, 2 objects) and no output schema, the description fails to explain return values, the meaning of 'control maturity', or how the parameters are used. The tool requires more context for correct invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema_description_coverage is 0%, so the description must compensate but does not. It names 'candidate_text' implicitly as the proposed rule, but provides no details on 'evidence' or 'context' parameters, leaving their meaning ambiguous.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'evaluate' and the resource 'proposed rule, guard, skill, or remediation', and specifies the outcome 'decide its control maturity'. It distinguishes itself from sibling tools like 'check_ssot_links' or 'validate_project_adapter', which have different purposes.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives. Does not mention prerequisites, context needed, or exclusions. The description lacks usage direction.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

inspect_projectInspect ProjectC
Read-only

Inspect repository structure and detected governance controls.

ParametersJSON Schema
NameRequiredDescriptionDefault
project_rootNo

TDQS

C2.9/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already provide readOnlyHint=true and destructiveHint=false, so the description is not required to disclose safety. However, it adds minimal behavior context beyond 'inspect' and does not explain what happens if project_root is omitted or the structure of the response.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is one short sentence, which is concise but lacks sufficient detail to be fully effective. It front-loads the purpose but omits critical information about parameters and usage.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has one optional parameter and no output schema, the description is incomplete. It does not explain the meaning of 'repository structure' or 'governance controls,' nor does it describe the response format or behavior when the parameter is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0% and the description does not mention the sole parameter 'project_root' at all. It fails to compensate for the lack of schema documentation, leaving the agent without guidance on the parameter's purpose or format.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'Inspect' and the resources 'repository structure and detected governance controls.' It distinguishes from sibling tools like 'check_ssot_links' and 'evaluate_control_candidate' by focusing on project-level inspection.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit guidance on when to use this tool vs alternatives. The description is minimal and does not provide context for appropriate use or when to choose a sibling tool.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

render_smell_gate_reportRender Smell Gate ReportC
Read-only

Render a Markdown smell gate report from a candidate or review object.

ParametersJSON Schema
NameRequiredDescriptionDefault
candidate_textNo
reviewNo
evidenceNo
contextNo

TDQS

C2.7/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=true and destructiveHint=false, so the description adds limited behavioral context. It does not disclose edge cases, such as behavior when multiple inputs are provided or omitted, nor does it mention any authentication or rate limits. The description adds minimal value beyond the annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence that front-loads the key purpose and output format. It is concise and avoids verbosity, though it could add more detail without becoming excessively long.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no output schema and four optional parameters, the description should explain what the generated Markdown report contains or how inputs affect the output. It does not, leaving gaps in how to invoke the tool effectively. The description is incomplete for a tool with this complexity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0% (no parameter descriptions). The description hints at 'candidate or review object' but does not explain the four parameters (candidate_text, review, evidence, context). It fails to clarify their types, relationships, or how they map to the output, leaving the agent with insufficient semantic information.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Render a Markdown smell gate report') and source ('from a candidate or review object'), specifying the output format. However, it does not differentiate from sibling tools like evaluate_control_candidate or validate_smell_catalog, which might have overlapping purposes.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no guidance on when to use this tool versus alternatives, nor any conditions for use or exclusion. The usage is implied (when you have a candidate or review object), but no explicit directions are given.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

route_control_destinationRoute Control DestinationC
Read-only

Route a failure class to docs, Skill, quality guard, QA harness, or contract prevention.

ParametersJSON Schema
NameRequiredDescriptionDefault
failure_classNo
detectabilityNo
recurrenceNo
harmNo
scopeNo

TDQS

C2.7/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=true and destructiveHint=false, signaling a non-destructive operation. The description adds the 'route' action which is consistent but does not elaborate on side effects, authorization needs, or output behavior. With annotations present, the description is adequate but not enriched.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, concise sentence that conveys the core function without unnecessary words. It could benefit from slightly more structure but is efficient.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With five parameters, zero schema coverage, and no output schema, the description fails to provide sufficient context for correct tool invocation. Critical details like which parameter selects the destination are missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0% and the description provides no information about any of the five parameters (failure_class, detectability, recurrence, harm, scope). This leaves the agent unable to determine parameter usage or how they map to destinations.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's action ('route') and resource ('failure class'), listing specific destinations (docs, Skill, quality guard, QA harness, contract prevention). This distinguishes it from siblings like evaluate_control_candidate or check_ssot_links.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance provided on when to use this tool vs alternatives, nor any prerequisites or exclusions. The agent must infer usage context from the name and description alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

validate_project_adapterValidate Project AdapterC
Read-only

Validate a project adapter file.

ParametersJSON Schema
NameRequiredDescriptionDefault
pathYes

TDQS

C2/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=true and destructiveHint=false, so the description adds no behavioral context. It does not explain what validation entails (e.g., checks performed, error reporting), which is critical for a validation tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness2/5

Is the description appropriately sized, front-loaded, and free of redundancy?

While the description is concise at one sentence, it is under-specified. Important details are omitted, making it insufficient for effective tool selection and use. Brevity should not come at the cost of completeness.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with one parameter, no output schema, and sibling tools, the description is severely incomplete. It does not explain what a project adapter is, what 'validate' means, or what the output (success/failure, errors) looks like. The agent cannot use this tool reliably.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description provides no information about the 'path' parameter. With 0% schema description coverage, the agent has no clue what path refers to (file path, directory, format?). The parameter's type and requirement are given, but semantics are missing.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action (validate) and resource (project adapter file), but it lacks specificity to differentiate from siblings like 'evaluate_control_candidate' or 'inspect_project'. The term 'project adapter file' is not defined, making it vague.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives. The description does not mention context, prerequisites, or limitations, leaving the agent without direction.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

validate_smell_catalogValidate Smell CatalogB
Read-only

Validate a smell catalog file for required control-promotion fields.

ParametersJSON Schema
NameRequiredDescriptionDefault
pathYes

TDQS

B3/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already indicate readOnlyHint=true and destructiveHint=false, so the description does not contradict. However, beyond annotations, it adds little behavioral context; e.g., it doesn't mention if validation produces output or side effects.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, concise sentence with no unnecessary words. It is appropriately sized for a simple tool.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a validation tool, the description should indicate what the result looks like (e.g., success/failure, errors). Without an output schema, this omission makes the tool harder to use correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema coverage, the description should explain the 'path' parameter. It implies the path points to a smell catalog file but does not clarify format, expected values, or examples.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action (validate) and the target (a smell catalog file) and specifies the aspect being validated (required control-promotion fields). It is sufficiently specific and distinguishes from sibling tools like validate_project_adapter.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It does not mention prerequisites, context, or when not to use it.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

TDQS

B3.1/5.0
Disambiguation5/5

Each tool targets a distinct operation: checking symlinked paths, evaluating control candidates, inspecting projects, rendering reports, routing failure classes, and validating two different file types. No overlap in purposes.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern using snake_case (e.g., check_ssot_links, evaluate_control_candidate). The naming convention is uniform across the set.

Tool Count5/5

7 tools is appropriate for a specialized domain like control promotion. It is neither too few to be trivial nor too many to be overwhelming.

Completeness4/5

The tools cover the core workflow of checking, evaluating, inspecting, rendering, routing, and validating. A minor gap is the lack of explicit creation or update operations for control candidates, but the set is largely complete for its stated purpose.

Maintenance

ActivityStale
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ValentinoWang/Control-PromotionMCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server