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
14 changes: 14 additions & 0 deletions .apm/architecture/owners/hooks-integrations.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,20 @@
"hooks-integrations-opencode-enabled-intent"
]
},
{
"id": "mcp-remote-transport-normalization",
"decision": "MCP remote transport vocabulary: registry v0.1 type, legacy transport_type and manifest transport normalized to streamable-http or sse, recorded at ingestion and read by every adapter and apm mcp show",
"owner": "mcp_transport.py (canonical_remote_transport, TRANSPORT_STREAMABLE_HTTP, TRANSPORT_SSE, CANONICAL_REMOTE_TRANSPORTS)",
"selectors": ["src/apm_cli/mcp_transport.py"],
"guards": ["hooks-integrations-mcp-remote-transport-normalization"]
},
{
"id": "mcp-remote-shape-table",
"decision": "Per-harness remote MCP output shape (URL key, transport discriminator, unsupported transports and retired APM renders), one evidence-backed row per registered runtime, plus the warn-skip-unclaimed disposition for unsupported transports",
"owner": "adapters/client/_remote_shapes.py (REMOTE_SHAPES, remote_shape_of, skip_unsupported_remote)",
"selectors": ["src/apm_cli/adapters/client/_remote_shapes.py"],
"guards": ["hooks-integrations-mcp-remote-shape-table"]
},
{
"id": "jetbrains-copilot-mcp-config-path",
"decision": "JetBrains Copilot MCP config path",
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ apm_modules/
build/tmp/
scout-pipeline-result.png
.copilot/
# Upgrade fixtures replay real Copilot user homes written by tagged releases.
!tests/fixtures/upgrade_0361/**/.copilot/
# Cursor MCP config (may contain auth tokens)
.cursor/mcp.json
.playwright-mcp/
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

- Remote MCP servers now reach each harness in its native shape: registry `remotes[].type` is honored, so SSE servers stay SSE on Copilot CLI, Claude Code and VS Code (`type: sse`) and Gemini (`url`); Antigravity gets `serverUrl`, and SSE on Antigravity or Codex is skipped with one warning and exit `0` instead of failing the install. `apm mcp show` prints the real transport, the next `apm install`, `apm update` or `apm install --frozen` rewrites entries an earlier APM wrote in the old shape (user entries are preserved), and `extra:` can no longer add an `httpUrl` or `serverUrl` endpoint. (#3789)
- Release tags that are promoted without re-running integration now publish to PyPI and deploy docs again; `repository_dispatch` `publish-existing-tag` re-publishes a released tag that never reached PyPI. (#3794, #3796)

### Changed
Expand Down
30 changes: 30 additions & 0 deletions docs/src/content/docs/consumer/install-mcp-servers.md
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,36 @@ MCP defines two transport families. APM exposes both:
and `file://` are rejected). Use `--header KEY=VALUE` (repeatable)
for HTTP headers such as `Authorization`.

### Remote transport per harness

`http` and `streamable-http` both mean Streamable HTTP; `sse` is the legacy
HTTP+SSE transport. For a registry server, APM reads the transport from the
registry's `remotes[].type` (a missing value means Streamable HTTP). `apm mcp
show` prints the same transport. Each harness gets its own native keys:

| Harness | Streamable HTTP | SSE |
|---|---|---|
| Copilot CLI, Claude Code, VS Code | `type: http`, `url` | `type: sse`, `url` |
| Gemini CLI | `httpUrl` | `url` |
| Antigravity | `serverUrl` | not supported |
| Codex CLI | `url` | not supported |
| Cursor, Windsurf, JetBrains Copilot | `type: http`, `url` | `type: http`, `url` |
| Kiro, Hermes | `url` | `url` |
| OpenCode | `type: remote`, `url` | `type: remote`, `url` |

When a harness does not support the transport, APM prints one warning naming
the server and the harness, skips that harness, and continues; the server is
not recorded for that harness and the install exits `0`, including under
`apm install --frozen`.

Entries an earlier APM release wrote in a shape the table above replaced (for
example Antigravity `httpUrl`, or `type: http` for an SSE server) are rewritten
on the next `apm install`, `apm update` or `apm install --frozen`, even when
`apm.yml` did not change. APM rewrites only entries it can prove it wrote; a
same-name entry you added yourself is preserved and reported as a conflict.
Extra fields cannot add a second endpoint: `extra:` keys named `url`,
`httpUrl` or `serverUrl` are dropped.

Codex requires HTTPS for non-loopback remote endpoints. Plain HTTP is
accepted only for literal loopback addresses such as `localhost`,
`ip6-localhost`, `127.0.0.0/8`, and `::1`, which keeps local development
Expand Down
2 changes: 1 addition & 1 deletion docs/src/content/docs/reference/cli/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ still cleans up its managed files, subject to the usual user-edit protections.
- **Hash drift.** A deployed file's on-disk bytes differ from its `deployed_file_hashes` value. The error names each path with its expected and observed hash. This is the same check `apm audit --ci` runs, so `apm install --frozen && apm audit --ci` gives one answer. It catches a user edit that install kept, such as an edited skill. It also catches an APM upgrade that renders a locked file differently.

The deployed files are already on disk; only the lockfile write is withheld. To recover, run `apm install` without `--frozen`, then commit the deployed files and the updated `apm.lock.yaml`. Export local edits you want to keep with `apm export-patch` first. The unrecorded-files check is one-directional and matches the tolerance above: claims the install would *drop* (a `--target` filter, `--only`) do not fail, and a removed dependency's claims are kept rather than dropped (see **Frozen mode**). `generated_at` and `apm_version` are excluded, so a newer CLI reading an older lockfile is not a rewrite.
- **Frozen native-service targets.** The no-write boundary includes late MCP/LSP integration and MCP-only installs: `apm.yml` and `apm.lock.yaml` keep their exact bytes, including legacy timestamps. Frozen mode replays recorded target/server ownership, not an unrecorded personal deployment. If Copilot and Claude own a server but IntelliJ does not, `apm install --frozen --target copilot,claude,intellij` exits `1`, names the missing target/server claim, and leaves native MCP/LSP configs and user entries unchanged. Run the same command without `--frozen`, keeping the intended `--target`, `--only`, `--root DIR` or `--global` options, to record that ownership; commit the lockfile, then replay frozen. `--only mcp` does not hydrate package sources, even without `--frozen`. Restore the package sources and declarations matching the lock using `apm install` without `--only mcp` in the same deployment store (retain `--root DIR` or `--global`, if used) before retrying. Reordered, repeated and narrower selections remain valid. Source acquisition may precede this check; this is not a general rollback guarantee for package deployment or lifecycle scripts.
- **Frozen native-service targets.** The no-write boundary includes late MCP/LSP integration and MCP-only installs: `apm.yml` and `apm.lock.yaml` keep their exact bytes, including legacy timestamps. Frozen mode replays recorded target/server ownership, not an unrecorded personal deployment. If Copilot and Claude own a server but IntelliJ does not, `apm install --frozen --target copilot,claude,intellij` exits `1`, names the missing target/server claim, and leaves native MCP/LSP configs and user entries unchanged. A registry server the lock records but never claimed for Codex or Antigravity (because that harness refuses its transport, for example SSE) is looked up in its declared registry before any write and skipped with a warning; if the harness can load it after all, the install fails the same way. Run the same command without `--frozen`, keeping the intended `--target`, `--only`, `--root DIR` or `--global` options, to record that ownership; commit the lockfile, then replay frozen. `--only mcp` does not hydrate package sources, even without `--frozen`. Restore the package sources and declarations matching the lock using `apm install` without `--only mcp` in the same deployment store (retain `--root DIR` or `--global`, if used) before retrying. Reordered, repeated and narrower selections remain valid. Source acquisition may precede this check; this is not a general rollback guarantee for package deployment or lifecycle scripts.
Late MCP checks use the complete resolved package graph, not just the packages selected for installation.
- **Local `.apm/` deployment.** After dependencies are integrated, primitives in the project's own `.apm/` directory are deployed to the same targets. Local files win on collision. Skipped with `--only mcp`. At `--global` the source root is `$HOME`, so `~/.apm/` primitives deploy to user-scope targets.
- **User-scope skill paths.** Global skill installation reads the lockfile from the APM user home (`$APM_HOME`, default `~/.apm/`), separate from the skill deployment root. `HOME` or `APM_HOME` directory symlink aliases work without extra flags; package-descendant symlinks and symlinked skill destinations remain rejected. Explicit dependency `alias:` placement is separate; unrelated user files remain protected.
Expand Down
2 changes: 1 addition & 1 deletion docs/src/content/docs/reference/manifest-schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,7 @@ Any additional keys not listed above are preserved as **extra passthrough fields

Two guardrails apply:

- **Reserved keys are rejected.** A passthrough key whose name collides with a modeled field above -- `name`, `transport`/`type`, `command`, `url`, `headers`, `env`, `args`, `tools`, `version`, `registry`, `package`, `enabled` -- or with an adapter-owned field (`http_headers`, `env_http_headers`, `bearer_token_env_var`, `environment`, `id`) is dropped with a warning. This prevents a passthrough value from shadowing or redirecting a modeled field. Extra keys also never overwrite a value the target adapter set itself. The top-level `enabled` field is the OpenCode-only exception: it is forwarded only to OpenCode, and an `extra.enabled` value remains reserved.
- **Reserved keys are rejected.** A passthrough key whose name collides with a modeled field above -- `name`, `transport`/`type`, `command`, `url`, `headers`, `env`, `args`, `tools`, `version`, `registry`, `package`, `enabled` -- or with an adapter-owned field (`http_headers`, `env_http_headers`, `bearer_token_env_var`, `environment`, `id`, `httpUrl`, `serverUrl`) is dropped with a warning. This prevents a passthrough value from shadowing or redirecting a modeled field. Extra keys also never overwrite a value the target adapter set itself. The top-level `enabled` field is the OpenCode-only exception: it is forwarded only to OpenCode, and an `extra.enabled` value remains reserved.
- **Extra keys broadcast to every target.** Passthrough keys are written uniformly into the generated config for **all** installed harnesses, not just the one that understands them. A Claude Code `oauth` block (`clientId`/`callbackPort`), for example, is emitted into every target's server entry; harnesses that do not recognise the key ignore it. Per-harness scoping is tracked as a future enhancement (see issue #1806).

> A future release may require passthrough keys to be nested under an explicit `extra:` block and stop auto-capturing bare top-level keys (fail-closed), via a deprecation path. See issue #1806.
Expand Down
12 changes: 11 additions & 1 deletion packages/apm-guide/.apm/skills/apm-usage/dependencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,8 @@ dependencies:
# Unknown keys (e.g. oauth) are passthrough: preserved and written into
# the generated config for EVERY installed harness. Keys that collide with
# a modeled or adapter-owned field
# (command/url/headers/env/environment/http_headers/id/...) are rejected.
# (command/url/httpUrl/serverUrl/headers/env/environment/http_headers/id/...)
# are rejected.
# Top-level enabled is modeled for OpenCode; extra.enabled remains reserved.
- name: slack
registry: false
Expand All @@ -675,6 +676,15 @@ dependencies:
callbackPort: 3118
```

Remote transport: `http`/`streamable-http` are Streamable HTTP; registry servers
take it from `remotes[].type` (missing = Streamable HTTP). Native keys per
harness: Copilot CLI, Claude, VS Code `type: http|sse` + `url`; Gemini `httpUrl`
(Streamable HTTP) or `url` (SSE); Antigravity `serverUrl`; Codex `url`. SSE on
Antigravity or Codex is skipped with one warning, not recorded, exit 0 (also
under `--frozen`). The next
install, update or `install --frozen` rewrites APM-written entries left in an
older APM shape (for example Antigravity `httpUrl`); user entries are preserved.

For a recognized GitHub MCP server, automatic auth follows the target's
runtime support and uses the selected token environment variable name on
runtime-capable targets. A nonempty string manifest `Authorization` value takes
Expand Down
Loading
Loading