Skip to content

feat(runtime): MCP proxy — intercept tools/call, deny on enforce - #177

Open
xre217 wants to merge 1 commit into
PrismorSec:mainfrom
xre217:feat/mcp-proxy
Open

feat(runtime): MCP proxy — intercept tools/call, deny on enforce#177
xre217 wants to merge 1 commit into
PrismorSec:mainfrom
xre217:feat/mcp-proxy

Conversation

@xre217

@xre217 xre217 commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Summary

Ships the high-priority MCP proxy from TODO.md / registry (id: mcp-proxy).

A stdio/HTTP shim sits in front of any downstream MCP server:

  1. Intercepts JSON-RPC tools/call
  2. Builds a canonical Prismor event from params.name + params.arguments
  3. Runs evaluate_tool_call (full policy + IAM + telemetry path)
  4. Deny → MCP result.isError (or JSON-RPC error with --jsonrpc-error) without forwarding
  5. Allow / non-tools/call → pass-through to upstream

Zero per-framework code — any MCP-speaking agent (Claude Code, Cursor, custom) gets coverage by wiring Prismor as the MCP server command.

CLI

# stdio — wire as the MCP server in agent config
prismor mcp-proxy --stdio -- npx -y @modelcontextprotocol/server-filesystem /tmp

# HTTP reverse proxy
prismor mcp-proxy --upstream http://127.0.0.1:9000 --port 8080

Claude Code / Cursor example:

{
  "mcpServers": {
    "filesystem": {
      "command": "prismor",
      "args": ["mcp-proxy", "--stdio", "--", "npx", "-y", "@modelcontextprotocol/server-filesystem", "/tmp"]
    }
  }
}

Also

  • Registry: mcp-proxy roadmap → shipped; coverage matrix regenerated
  • Docs: docs/cli-reference.md, AGENT_INTEGRATIONS.md, TODO.md
  • Module: prismor/runtime/mcp_proxy.py

Test plan

  • python3 -m pytest tests/test_mcp_proxy.py -v (16 passed)
  • CLI parser accepts --stdio -- cmd… and --upstream
  • Manual: point an MCP client at the proxy and confirm rm -rf / style tools/call is denied

Related: #175 (registry enums), #176 (dashboard subject filter). Happy to iterate on framing edge cases or SSE/streamable-http if you want those next.

Ship the high-priority mcp-proxy integration: a stdio/HTTP shim that sits
in front of any MCP server, evaluates tools/call via evaluate_tool_call,
and returns an MCP isError (or JSON-RPC error) on deny. All other methods
pass through.

- prismor mcp-proxy --stdio -- <upstream-command…>
- prismor mcp-proxy --upstream <url> [--port 8080]
- Registry status: roadmap → shipped; matrix + CLI docs updated
- Unit coverage for event build, intercept, HTTP path, CLI parser
@xre217

xre217 commented Jul 11, 2026

Copy link
Copy Markdown
Contributor Author

Hey — quick note so this isn’t three unprompted PRs in a vacuum.

Shipped against items in TODO.md / the registry:

Happy to:

  • squash / split / rebase however you prefer
  • fix review nits same-day once first-time CI is approved
  • take Gemini CLI hooks (or whatever’s highest leverage next) if useful

No rush — just wanted to make it easy to say yes/no/redirect.

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