Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
paths: &python-paths
- '*/python/**'
- '*/conformance/**'
- 'mcp/examples/management-reference/**'
- '.github/workflows/python.yml'
pull_request:
paths: *python-paths
Expand Down Expand Up @@ -73,6 +74,21 @@ jobs:
PY
- run: ruff check src/ tests/
- run: python -m pytest
- name: Verify the MCP management reference with both SDK versions
if: matrix.component == 'mcp'
working-directory: .
shell: bash
run: |
example=mcp/examples/management-reference
reference="$RUNNER_TEMP/mcp-management-reference"
legacy="$RUNNER_TEMP/mcp-management-legacy"
python -m venv "$reference"
python -m venv "$legacy"
"$reference/bin/python" -m pip install -r "$example/requirements-test.txt" "$RUNNER_TEMP"/core-wheel/apcore-*.whl
"$reference/bin/python" -m pip check
"$reference/bin/python" -m pytest -q "$example"
"$legacy/bin/python" -m pip install 'mcp==1.30.0'
"$legacy/bin/python" "$example/legacy_smoke.py" "$reference/bin/python"

package:
name: Python distribution (${{ matrix.component }})
Expand Down
9 changes: 5 additions & 4 deletions mcp/docs/features/mcp-server-factory.md
Original file line number Diff line number Diff line change
Expand Up @@ -271,16 +271,17 @@ deployment choice.
|---|---|---|
| `system.health.summary` | resource | `apcore://system.health.summary` |
| `system.health.module` | resource template | `apcore://system.health.module/{module_id}` |
| `system.usage.summary` | resource | `apcore://system.usage.summary{?period}` |
| `system.usage.summary` | resource | `apcore://system.usage.summary` |
| `system.usage.module` | resource template | `apcore://system.usage.module/{module_id}{?period}` |
| `system.manifest.full` | resource | `apcore://system.manifest.full` |
| `system.manifest.module` | resource template | `apcore://system.manifest.module/{module_id}` |
| `system.manifest.search` | read-only tool | `system.manifest.search` |
| `system.control.update_config` | tool | `system.control.update_config` |
| `system.control.reload_module` | tool | `system.control.reload_module` |
| `system.control.toggle_feature` | tool | `system.control.toggle_feature` |

The three `system.control.*` modules have side effects — that is what a tool is — and stay tools with
the approval bridge wired on the tool-call path exactly as before. The six read-only modules are
The three `system.control.*` tools use the approval bridge on the tool-call path.
`system.manifest.search` is a read-only tool that accepts search criteria. The six resource modules are
excluded from `build_tools()`'s output and are instead served by the resource-handler registration step
(below), whichever `module_id` prefix filter or resource-handler-only variant of that step the SDK
exposes.
Expand All @@ -296,7 +297,7 @@ uses for tool calls.
This classification is also the reachability signal the
[System Management Extension](./system-management-extension.md) (`com.aiperceivable/management`,
aiperceivable/apcore-mcp#16 Phase A) advertises in `capabilities.extensions` — see that document for
the negotiation shape. Declaring or omitting that extension has no effect on whether any of the nine
the negotiation shape. Declaring or omitting that extension has no effect on whether any of the ten
modules above are reachable; see its Design Constraint section.

### Unprotected control surface warning
Expand Down
2 changes: 1 addition & 1 deletion mcp/docs/features/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ description: "Auto-generated index of all apcore-mcp feature specs with dependen
| [Async Task Bridge](./async-task-bridge.md) | Routes async-hinted modules to apcore's AsyncTaskManager and exposes task meta-tools. | execution-router, error-mapper | released-v0.14.0 |
| [Explorer UI](./explorer-ui.md) | Web dashboard for inspecting and testing tools. | mcp-server-factory, execution-router | released-v0.14.0 |
| [Markdown](./markdown.md) | Renders `Tool.description` and OpenAI `function.description` as canonical apcore-toolkit Markdown for richer LLM tool-selection signal (`rich_description` / `richDescription` / `with_rich_description`). | apcore-toolkit 0.6+ (optional) | released-v0.15.0 |
| [System Management Extension](./system-management-extension.md) | Unofficial MCP extension (`com.aiperceivable/management`) advertising the `system.*` management surface's shape in `initialize`; Phase A only. | mcp-server-factory | released-v0.19.0 (Phase A) |
| [System Management Extension](./system-management-extension.md) | Unofficial MCP extension (`com.aiperceivable/management`) advertising the `system.*` management surface in `initialize`, with an SDK reference for `server/discover` and legacy compatibility. | mcp-server-factory | released-v0.19.0 (Phase A) |
| [ACL Builder](./acl-builder.md) | Builds an `apcore.ACL` from the `mcp.acl` Config Bus section; owns the Config-Bus-shaped validation, wraps apcore's §6.2.1 pattern-array rejections with a rule index, and reports tier-2 never-matches findings at startup. | apcore 0.30.0 | released-v0.20.0 |
| [OpenAPI Backend](./openapi-backend.md) | Third backend source — turns an OpenAPI 3.0/3.1 document into MCP tools via apcore-toolkit's `OpenAPIScanner` + `HTTPProxyRegistryWriter`. | apcore-toolkit 0.13.0, schema-converter, annotation-mapper, mcp-server-factory | released-v0.20.0 |

Expand Down
92 changes: 53 additions & 39 deletions mcp/docs/features/system-management-extension.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
---
description: "com.aiperceivable/management MCP extension (Phase A, unofficial): identifier, capabilities.extensions negotiation shape, resource/tool conventions for the nine canonical system.* modules, ACL/approval interaction, degradation behavior."
description: "com.aiperceivable/management MCP extension (Phase A, unofficial): identifier, capabilities.extensions negotiation shape, resource/tool conventions, ACL/approval interaction, and the official SDK reference for #113."
---

# System Management Extension (`com.aiperceivable/management`)

> Feature spec for code-forge implementation planning.
> Tracking issue: aiperceivable/apcore-mcp#16 (Phase A only — B and C are separate follow-ups).
> Blocked by / depends on: [`system.* module projection`](./mcp-server-factory.md#system-module-projection-resources-vs-tools) (aiperceivable/apcore-mcp#15).
> Phase A: [#110](https://github.com/aiperceivable/apcore-surfaces/issues/110).
> Phases B and C: [#113](https://github.com/aiperceivable/apcore-surfaces/issues/113).
> Depends on: [`system.* module projection`](./mcp-server-factory.md#system-module-projection-resources-vs-tools) (aiperceivable/apcore-mcp#15).
> Status: Phase A — unofficial extension. Not submitted to `modelcontextprotocol/modelcontextprotocol`.
> Created: 2026-09-01

Expand All @@ -16,25 +17,23 @@ interpreted as described in RFC 2119.
## Purpose

Publish the `system.*` management surface (health, usage, manifest, control) as a discoverable,
versioned MCP extension so a client can learn — from one field of the `initialize` handshake — that a
server exposes a known-shaped governance surface, instead of inferring it by pattern-matching
`module_id` strings.
versioned MCP extension. Clients that recognize the identifier can learn the server's management
conventions from the capability settings.

This is [SEP-2133](https://modelcontextprotocol.io/seps/2133-extensions) **Phase A**: an *unofficial*
extension, which SEP-2133 states "may be introduced and governed by developers outside the MCP
organization" with no approval required. Phase B (Working Group discussion) and Phase C (formal SEP
submission) are tracked separately and are out of scope for this document.
organization." Phase A is implemented in Python, TypeScript, and Rust. The
[reference implementation for #113](#reference-implementation-for-113) validates the same contract
across two MCP protocol revisions.

## Identifier

`com.aiperceivable/management`

Format is `{vendor-prefix}/{extension-name}` per SEP-2133, where the vendor prefix is a reversed
domain the author controls. `aiperceivable.com` is the project domain, and every project in the
ecosystem documents under `<project>.aiperceivable.com`. SEP-2133 requires a *new* identifier for any
breaking change to this extension's shape, so this prefix and name **MUST** be treated as stable from
first publication — a future breaking revision ships under a new identifier, never a version bump of
this one.
ecosystem documents under `<project>.aiperceivable.com`. The Phase A identifier **MUST** remain stable. A breaking revision to this Phase A contract uses a
new identifier.

## Design constraint — the extension is metadata, not a gate

Expand All @@ -44,7 +43,7 @@ An adapter **MUST NOT** let declaring or omitting this extension change what a c
lose access to anything: every `system.*` resource and tool **MUST** remain reachable through
ordinary `resources/list` / `resources/read` / `tools/list` / `tools/call`, subject only to
Activation (§6.6.3 layer 1), ACL (layer 2) and Approval (layer 3) as defined by
[PROTOCOL_SPEC §6.6.3](https://github.com/aiperceivable/apcore/blob/main/PROTOCOL_SPEC.md).
[PROTOCOL_SPEC §6.6.3](https://github.com/aiperceivable/apcore/blob/main/docs/spec/protocol-spec.md#663-defense-in-depth-model).
- An adapter **MUST NOT** introduce a permission switch keyed off whether the *caller* declared this
extension. PROTOCOL_SPEC §6.6.3 prohibits adapters from inventing permission mechanisms beyond
Activation / ACL / Approval; a capability-gated access difference would be exactly that — a shadow
Expand All @@ -54,13 +53,13 @@ An adapter **MUST NOT** let declaring or omitting this extension change what a c

## Negotiation

Advertised in the `initialize` response's `capabilities.extensions` map, keyed by identifier:
The Phase A adapters advertise the extension in the legacy `initialize` response. The reference
implementation also advertises it in `server/discover` on MCP 2026-07-28. Both responses use the
same `capabilities.extensions` entry.

```json
{
"capabilities": {
"tools": { "listChanged": true },
"resources": { "listChanged": true },
"extensions": {
"com.aiperceivable/management": {
"surfaces": ["health", "usage", "manifest", "control"],
Expand All @@ -73,15 +72,15 @@ Advertised in the `initialize` response's `capabilities.extensions` map, keyed b

### `surfaces`

An array drawn from the four-element set `["health", "usage", "manifest", "control"]`, reflecting only
what is **actually reachable** on this server instance:
An ordered array of registered groups drawn from `["health", "usage", "manifest", "control"]`.
Per-invocation access depends on Core governance.

| Element | Present iff |
|---|---|
| `"health"` | `system.health.summary` or `system.health.module` is registered (`sys_modules.enabled = true`) |
| `"usage"` | `system.usage.summary` or `system.usage.module` is registered |
| `"manifest"` | `system.manifest.full` or `system.manifest.module` is registered |
| `"control"` | any `system.control.*` module is registered (`sys_modules.enabled = true` **and** `sys_modules.events.enabled = true`) |
| `"manifest"` | `system.manifest.full`, `system.manifest.module`, or `system.manifest.search` is registered |
| `"control"` | a `system.control.*` module is registered (requires management, events, and control to be enabled) |

An adapter **MUST NOT** advertise the extension at all — the whole `"com.aiperceivable/management"` key
**MUST** be absent from `capabilities.extensions` — when `surfaces` would be empty (i.e.
Expand All @@ -95,12 +94,12 @@ their disjunction and is not fine-grained enough on its own to populate `surface

### `protocolVersion`

The [PROTOCOL_SPEC](https://github.com/aiperceivable/apcore/blob/main/PROTOCOL_SPEC.md) version this
adapter's `system.*` projection was written against (currently `1.30.0`). A client MAY use this to
decide whether it understands the resource-URI and tool-annotation conventions below; an adapter
**MUST** update this string when it adopts a newer PROTOCOL_SPEC's `§6.6` changes.
The [PROTOCOL_SPEC](https://github.com/aiperceivable/apcore/blob/main/docs/spec/protocol-spec.md) version this
adapter's `system.*` projection targets. Phase A and the reference use the shared fixture value
`1.30.0`. A client MAY use it to interpret the resource URI and tool annotation conventions.
This setting is independent of the MCP connection revision and the installed Core package version.

## Resource and tool conventions for the nine canonical modules
## Resource and tool conventions for the ten canonical modules

This section restates, for the extension's own reference-implementation contract, the classification
[`system.* module projection`](./mcp-server-factory.md#system-module-projection-resources-vs-tools)
Expand All @@ -111,14 +110,18 @@ shapes without probing:
|---|---|---|
| `system.health.summary` | resource | `apcore://system.health.summary` |
| `system.health.module` | resource template | `apcore://system.health.module/{module_id}` |
| `system.usage.summary` | resource | `apcore://system.usage.summary{?period}` |
| `system.usage.summary` | resource | `apcore://system.usage.summary` |
| `system.usage.module` | resource template | `apcore://system.usage.module/{module_id}{?period}` |
| `system.manifest.full` | resource | `apcore://system.manifest.full` |
| `system.manifest.module` | resource template | `apcore://system.manifest.module/{module_id}` |
| `system.manifest.search` | read-only tool | `system.manifest.search` |
| `system.control.update_config` | tool | `system.control.update_config` |
| `system.control.reload_module` | tool | `system.control.reload_module` |
| `system.control.toggle_feature` | tool | `system.control.toggle_feature` |

`resources/read` accepts an optional `?period=…` for both usage endpoints. Only the usage module
template advertises `{?period}`.

A `resources/read` on any `apcore://system.*` URI **MUST** be dispatched through the same execution
path (Activation → ACL → Approval → Executor pipeline) as a `tools/call` on the corresponding
module — an adapter **MUST NOT** add a second, resource-only invocation path that bypasses ACL or
Expand All @@ -130,22 +133,20 @@ registry/module invocation.

Nothing here changes ACL or Approval semantics. The three read-only groups (`health`, `usage`,
`manifest`) are read-only, no-side-effect modules per PROTOCOL_SPEC §6.6.2 and are still subject to
ACL evaluation on every `resources/read`, exactly as they would be on a `tools/call` were they
projected as tools. The `control` group keeps its `requiresApproval` annotation and passes through the
ACL evaluation on every `resources/read` and on `tools/call` for `system.manifest.search`. The
`control` group keeps its `_meta.requiresApproval` annotation and passes through the
Approval gate identically whether it is discovered via `tools/list` or invoked directly by a client
that already knows its name from this extension's contract.

Declaring this extension does **not** imply an ACL rule exists that permits reaching any of these
modules — see [`acl-builder`](https://github.com/aiperceivable/apcore-mcp/blob/main/README.md) rule-template guidance
modules — see [`acl-builder`](./acl-builder.md) rule-template guidance
(aiperceivable/apcore-mcp#14) for the ACL configuration that actually gates this surface.

## Degradation behavior

Per SEP-2133's graceful-degradation requirement, a client that does not understand this extension
simply does not see the `com.aiperceivable/management` key in `capabilities.extensions` and falls back
to core MCP discovery (`resources/list`, `resources/templates/list`, `tools/list`) to find the same
modules. No fallback code path is required on the client side because there is no behavior to fall
back *from* — the extension adds no protocol requirement, only a discovery shortcut.
Clients that omit or ignore the extension use ordinary MCP discovery (`resources/list`,
`resources/templates/list`, and `tools/list`) to find the same modules. The same Core activation,
ACL, and approval decisions apply in both cases.

## Security considerations

Expand All @@ -168,8 +169,21 @@ back *from* — the extension adds no protocol requirement, only a discovery sho
(regression test — proves the extension is not acting as a gate).
- [ ] `surfaces` accurately reflects only the four groups actually registered on the running instance.

Phases B (Working Group discussion) and C (formal Extensions Track SEP against
`modelcontextprotocol/modelcontextprotocol`) are tracked by their own follow-ups when they start; see
aiperceivable/apcore-mcp#16 for the full three-phase plan and its gating requirements (a reference
implementation inside an official MCP SDK, and named Extension Maintainers, before SEP review can
begin).
## Reference implementation for #113

The example under `mcp/examples/management-reference` uses the official MCP Python SDK's discovery
and legacy handshake handlers. It exposes the management projection over stdio and uses the existing
Core Executor with a host-selected demo identity.

- With `--advertise-management` and registered groups, both protocol eras advertise the same
extension settings. The example defaults to ordinary discovery and omits the entry when no
management groups are registered. SDK 2.3.0's legacy serializer omits `capabilities.extensions`.
The reference uses SDK middleware to preserve the Phase A entry after `initialize` serialization.
- Acceptance covers the shared projection fixture, a permitted and denied resource read, a denied
control call, and an ACL-permitted control call with missing, rejecting, and approving Core
handlers. An approved toggle changes subsequent module activation in the demo process.

The Surfaces example supplies local evidence for Phase B. Under
[SEP-2133](https://modelcontextprotocol.io/seps/2133-extensions) and
[SEP-3392](https://modelcontextprotocol.io/seps/3392-extension-lifecycle), Phase C still needs a
reference in an official SDK codebase, a Working Group, named Extension Maintainers, and SEP review.
3 changes: 3 additions & 0 deletions mcp/examples/management-reference/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.venv/
.venv-legacy/
__pycache__/
Loading
Loading