mirror of
https://github.com/norandom/OpenUltraSAST.git
synced 2026-10-18 04:29:27 +00:00
feat(mcp): Phase 12 — narrow MCP server + ousast mcp
A zero-dependency MCP server over stdio (newline-delimited JSON-RPC 2.0) for OpenCode/IDE integration, exposing only stable project-level operations. - mcp.py: McpServer (pure handle() dispatch) + serve() stdio loop, stdlib-only. Ten tools: openultrasast.scan/status/findings/get_finding/evidence/artifacts/ benchmark/explain/propose_patch/export_report. scan/benchmark run the bounded analysis pipeline; NO tool accepts a free-form command — no shell, Docker, or internal hunter tools are exposed. propose_patch degrades visibly (patch oracle is a later phase). initialize/tools/list/tools/call/ping handled; notifications get no response; errors surface as JSON-RPC errors instead of crashing the loop. - cli: `ousast mcp` subcommand launches the stdio server (lazy import → keeps the mcp↔cli cycle one-directional). - tests/test_mcp.py: tool listing is exactly the narrow surface, surface-safety (no shell/exec/command tool), scan→status→findings→explain→evidence flow, export_report, propose_patch degradation, and the stdio loop round-trip. - README "MCP server" section; openrouter-sast-harness Phase 12 checked off. Verified end-to-end over real stdio (initialize → tools/list → scan). 179 passed, 4 skipped; ruff + mypy clean; detection gate PASS. Co-Authored-By: Claude Opus 4.8 <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
867bd536a2
commit
9c917dd6aa
@@ -249,12 +249,15 @@ Do not report OpenUltraSAST as a working security harness until `usable_harness_
|
||||
|
||||
## Phase 12: MCP And OpenCode Commands (`opencode_product` prerequisite)
|
||||
|
||||
Implemented in `mcp.py` (zero-dep stdio JSON-RPC server) + the `ousast mcp` CLI
|
||||
subcommand; tests in `tests/test_mcp.py`; README "MCP server" section documents it.
|
||||
|
||||
- [x] Add project-local opencode skills for scan, triage, fix audit, and implementation steering.
|
||||
- [ ] Implement narrow MCP server.
|
||||
- [ ] Add `openultrasast.scan`, `status`, `findings`, `get_finding`, `evidence`, `artifacts`, `benchmark`, `explain`, `propose_patch`, and `export_report` tools.
|
||||
- [ ] Add opencode command docs for quick, standard, deep, verify, and patch workflows.
|
||||
- [ ] Ensure MCP tools never expose arbitrary shell execution.
|
||||
- [ ] Add integration test for MCP tool listing and scan status.
|
||||
- [x] Implement narrow MCP server.
|
||||
- [x] Add `openultrasast.scan`, `status`, `findings`, `get_finding`, `evidence`, `artifacts`, `benchmark`, `explain`, `propose_patch`, and `export_report` tools.
|
||||
- [x] Add opencode command docs for quick, standard, deep, verify, and patch workflows. (README; deep/patch noted as roadmap.)
|
||||
- [x] Ensure MCP tools never expose arbitrary shell execution. (Surface-safety test asserts no shell/exec/command tool.)
|
||||
- [x] Add integration test for MCP tool listing and scan status.
|
||||
|
||||
## Phase 13: Fusion (`standard_security_harness` and `opencode_product` prerequisite)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user