Skip to content

Detect active remote MCP endpoints with scheme-aware severity#45

Merged
Conalh merged 1 commit into
mainfrom
active-remote-endpoint
May 22, 2026
Merged

Detect active remote MCP endpoints with scheme-aware severity#45
Conalh merged 1 commit into
mainfrom
active-remote-endpoint

Conversation

@Conalh
Copy link
Copy Markdown
Owner

@Conalh Conalh commented May 22, 2026

Summary

Closes the active-config gap I noted in the previous HTTP-severity commit (4082373). mcp_sample_remote_endpoint flagged sample configs, but the active .mcp.json and .codex/config.toml server loops weren't scrutinizing remote endpoints at all — a serverUrl change on a live MCP server produced no finding.

Two new findings, calibrated higher than the sample equivalents because these endpoints are live:

Surface Scheme Severity Rationale
sample https:// medium copy-paste risk only
sample http:// high sample silently teaches MitM
active https:// high live remote transport — review needed
active http:// critical live unencrypted MCP transport — real-time exfiltration risk

Changes

  • src/mcp-risk.ts — Extracted remoteEndpoint, isRemoteEndpoint, isUnencryptedEndpoint so both detectors share one endpoint policy.
  • src/detectors/mcp.ts — Active server loop now emits scope_trail.mcp_remote_endpoint when a server's url/serverUrl changes (or appears on a newly-added server). Scheme-aware severity.
  • src/detectors/codex-config.ts — Same shape for [mcp_servers.NAME] in .codex/config.toml. Supports both serverUrl and server_url since Codex uses snake_case in TOML.
  • Tests — Dedicated http/https regression tests in both detector test files. Existing Windsurf active-drift test updated to include the new finding on the team-registry serverUrl change.

Test plan

  • npm test — 52/52 passing locally
  • npm run build clean
  • CI green on PR

🤖 Generated with Claude Code

Closes the active-config gap I noted in the previous HTTP severity
commit (4082373): mcp_sample_remote_endpoint fired on sample configs
but the active .mcp.json / .codex/config.toml server loops weren't
scrutinizing remote endpoints at all. A `serverUrl` change on an
active MCP server got nothing — even though active configs are the
ones actually carrying traffic, where unencrypted transport is a
real-time exfiltration risk, not just a copy-paste foot-gun.

Adds two new findings, severity calibrated higher than the sample
equivalents because these endpoints are live:

- scope_trail.mcp_remote_endpoint
    http://  → critical  (live unencrypted MCP transport)
    https:// → high      (any active remote endpoint warrants review)

- scope_trail.codex_mcp_remote_endpoint
    Same shape for `[mcp_servers.NAME]` in .codex/config.toml.
    Supports both `serverUrl` and `server_url` (Codex uses snake_case).

Refactor: `remoteEndpoint`, `isRemoteEndpoint`, `isUnencryptedEndpoint`
extracted to mcp-risk.ts so both detectors share one source of truth
for the endpoint policy.

Severity ladder across surfaces (lowest to highest):
- sample https://  → medium  (copy-paste risk only)
- sample http://   → high    (sample silently teaches MitM)
- active https://  → high    (live remote transport, encrypted)
- active http://   → critical (live remote transport, unencrypted)

Test coverage: dedicated regression tests in mcp-drift.test.mjs and
codex-mcp-drift.test.mjs pin the http/https split for both detectors.
Existing Windsurf active-drift test updated to include the new
mcp_remote_endpoint finding on the team-registry serverUrl change.
@Conalh Conalh merged commit f19ea86 into main May 22, 2026
3 checks passed
@Conalh Conalh deleted the active-remote-endpoint branch May 22, 2026 23:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant