Skip to content

Add MCP client integration example - #4

Merged
wei9072 merged 1 commit into
wei9072:mainfrom
Baijack-star:examples/mcp-client-integration
Apr 28, 2026
Merged

wei9072 merged 1 commit into
wei9072:mainfrom
Baijack-star:examples/mcp-client-integration

Conversation

@Baijack-star

Copy link
Copy Markdown

Summary

Adds a minimal client-side MCP integration example under examples/integration/mcp-server/.

The example demonstrates:

  • spawning aegis-mcp over stdio JSON-RPC
  • calling initialize, tools/list, and tools/call
  • validating one PASS candidate and one BLOCK candidate
  • branching client control flow without feeding Aegis reasons back into the LLM as retry hints

Also updates the integrations index to point at the Rust aegis-mcp install path and the new example.

Validation

  • python3 -m py_compile examples/integration/mcp-server/client_smoke.py
  • git diff --check

I could not run the end-to-end smoke test in this local environment because cargo is not installed here. The script now fails with an explicit message in that case and supports AEGIS_MCP_COMMAND for an already-built binary.

@wei9072

wei9072 commented Apr 28, 2026

Copy link
Copy Markdown
Owner

Thanks — this is the first external integration example for the project, and it lands cleanly inside the framing the issue asked for. Two specific things I want to call out before merging.

What you got right that I want to make explicit:

  1. Framing. The README's three sentences on control boundary ("the agent owns generation and branching", "BLOCK is a stop signal", "do not feed reasons back into the LLM as retry hints") are word-for-word what docs/post_launch_discipline.md and docs/gap3_control_plane.md's Critical Principle exist to defend. Having an external example state this in client code makes those docs less abstract.
  2. AEGIS_MCP_COMMAND env-var fallback. Decoupling the client integration from cargo availability is a useful pattern. I'm going to back-port the convention into docs/integrations/mcp_design.md so future readers see it as a recommended shape, not just a workaround for your machine.
  3. Doc fix. The pip install -e .[mcp] line in docs/integrations/README.md was stale post-V1.10. You caught it independently — appreciated.

Merge conflict — resolved on my side:

The base for this PR (d62df41) and current main both updated the same MCP install line; the conflicts were trivial style differences plus your example link, which is strictly additive. Merged with both your example and the link preserved.

One observation worth flagging for your follow-up:

Your client-pattern pseudocode treats WARN as "surface for review or require a human policy decision". That's an interesting overload of WARN, because in current code WARN is purely advisory — there's no separate verdict for "rules don't have enough information to safely decide, escalate to a higher-authority node". You've independently described the missing fourth verdict (working name: ESCALATE). I have that on the design backlog; if your real integration ever needs to distinguish "soft regression, fine to proceed" from "I can't decide, ask someone", please open a follow-up issue with the concrete shape — that would be evidence-of-need, not speculation, and would unblock that variant landing.

Also: when you wire this into a real agent loop (not the two-case smoke), please open a separate issue describing what wall you hit — multi-file edits, batched validation, signal inspection before planning, anything. That's the second-round feedback the project doesn't have yet.

Merging shortly.

@wei9072
wei9072 merged commit b57acd8 into wei9072:main Apr 28, 2026
wei9072 added a commit that referenced this pull request Apr 28, 2026
Promotes the framework abstraction to a first-class document.
aegis-agent is now framed as one reference implementation case
(code-change domain). Status banner marks this as articulation +
worked example, not validated cross-domain claim. escalate verdict
is in the framework definition; reference impl will land it when
the first concrete escalation case emerges in the code domain
(trigger pinned in PR #4 review).

Co-Authored-By: Claude Opus 4.7 <[email protected]>
wei9072 added a commit that referenced this pull request Apr 28, 2026
Two new strategic documents anchored on the 2026-04-27 PocketOS
incident (Cursor + Claude Opus 4.6 deleted production database +
backups via a single Railway API call in 9 seconds).

docs/case_pocketos_railway_delete.md
  Cold technical analysis. Maps the failure layer-by-layer to the
  five-layer admission-control framework in framework.md, makes
  the concrete claim that an aegis-shaped wrapper would have
  produced ESCALATE on the destructive Railway API call, and
  honestly enumerates what aegis CANNOT claim it would have caught
  (no Railway-domain plug ships today, escalate verdict not yet in
  reference impl, TOCTOU still real, etc). The framing claim
  ("aegis would have prevented this") is not made; the provable
  claim ("the framework definition would have prevented this if
  instantiated for the Railway domain") is.

docs/commercial.md
  Strategic narrative for adopting aegis at the team / org /
  enterprise level. Cold-opens with PocketOS as the inciting
  incident for the AI-agent admission-control category. Lays out:

    * the negative-space framing as enterprise sales moat (CISOs
      buy control, not magic)
    * what the OSS already ships toward enterprise needs (~70% of
      primitives are in code; commercial layer is federation,
      aggregation, governance, retention)
    * open-core boundary, hard-pinned by framing not by revenue
    * three-tier pricing structure (free / team / enterprise)
    * three sales motions (bottom-up dev / top-down security /
      compliance-driven)
    * what aegis will NOT sell (the discipline list, framed as
      pitch advantage rather than limitation)
    * differentiation vs imminent competition (framing discipline,
      domain-agnostic framework, pre-shaped multi-vertical play)
    * evidence-gated roadmap signals — every item has a trigger
      condition; nothing ships speculatively

Both documents:

  * Reference docs/framework.md, docs/post_launch_discipline.md
    as load-bearing anchors
  * Cite PR #4 as first external evidence the framing is portable
    to non-insider contributors (and the contributor's pseudocode
    independently described the correct client behaviour for the
    PocketOS-class incident before it happened)
  * Make claims that are provable today, mark speculation as
    speculation

Neither document proposes changes to OSS code. Both are
positioning arguments. If commercial features are ever proposed
that violate the framing, framing wins — explicitly stated in
commercial.md §11.

Co-Authored-By: Claude Opus 4.7 <[email protected]>
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.

2 participants