Skip to content

Commit d837b29

Browse files
committed
docs(sdk): add MCP server phase, CI config health to roadmap, ADR-015
- Phase 5: MCP server for AI assistant integration (ADR-015) Documents why MCP over skill files: staleness, vendor neutrality, structured data, single source of truth - CI preflight and living issue (Renovate-style config health tracking) - Runtime network dependency notes for --check-tools
1 parent b2ac8f7 commit d837b29

2 files changed

Lines changed: 169 additions & 0 deletions

File tree

.ai/decisions.yaml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -652,3 +652,82 @@ decisions:
652652
argus/containers.py: Central image manifest for version tracking
653653
docker/: Dockerfiles for custom images (bandit, opengrep, supply-chain, cli)
654654
.github/dependabot.yml: docker ecosystem for Dockerfile base images
655+
656+
- id: ADR-015
657+
title: "MCP server for AI assistant integration instead of skill files"
658+
date: "2026-04-12"
659+
status: proposed
660+
661+
context: |
662+
AI coding assistants (Claude Code, Cursor, Windsurf, VS Code Copilot) are
663+
increasingly used to drive developer workflows. Argus has a curated skill
664+
file at .agents/skills/argus-scanner-selection/ that teaches AI assistants
665+
how to select and run scanners. However, distributing this skill to users
666+
has unsolved problems:
667+
668+
1. No universal skill format — each AI tool has its own convention
669+
(.claude/commands/, .cursorrules, .github/copilot-instructions.md).
670+
Picking one means favoring a vendor; supporting all means maintaining
671+
duplicates.
672+
2. No versioning or update mechanism — copying a skill into a project
673+
creates a stale snapshot. AI tools have no skill registries or update
674+
notifications. There is no "pip install" for skills.
675+
3. Lossy interface — the AI shells out to the CLI and parses unstructured
676+
terminal output (including ANSI colors, tables, progress indicators),
677+
losing structured information.
678+
4. Duplicated intelligence — the skill file re-describes logic that already
679+
exists in argus init (project detection) and the engine (scanner
680+
selection). Two sources of truth drift over time.
681+
682+
decision: |
683+
Expose Argus as an MCP (Model Context Protocol) server via `argus mcp`.
684+
The server provides typed tools (argus_scan, argus_detect, argus_validate,
685+
argus_list_scanners, argus_init) that return structured JSON, and resources
686+
(argus://config, argus://results/latest) for reading project state.
687+
688+
MCP is the emerging standard supported by Claude Code, Cursor, Windsurf,
689+
and VS Code Copilot. A single implementation works across all tools.
690+
691+
alternatives_considered:
692+
- name: "Skill file installed by argus init"
693+
rejected_because: |
694+
Creates stale snapshots with no update path. Must choose a tool-specific
695+
location or maintain duplicates. AI still parses terminal output.
696+
697+
- name: "Inform-only (print URL at init)"
698+
rejected_because: |
699+
Avoids staleness but puts full integration burden on the user. Still
700+
has the terminal-parsing problem. No structured data exchange.
701+
702+
- name: "Publish to AI tool skill registries"
703+
rejected_because: |
704+
No such registries exist with versioning or update notifications.
705+
cursor.directory is community-shared with no version control.
706+
Would still require tool-specific formats.
707+
708+
- name: "Generate tool-specific files for each AI tool"
709+
rejected_because: |
710+
As OSS, Argus should not favor one tool vendor over another.
711+
Maintaining N tool-specific formats is unsustainable.
712+
713+
consequences:
714+
positive:
715+
- "Tool-agnostic — one implementation, all MCP-compatible AI tools"
716+
- "Structured data — AI receives typed JSON, not terminal output"
717+
- "Auto-updating — upgrades ship with pip install --upgrade"
718+
- "No vendor favoritism — MCP is an open protocol"
719+
- "Single source of truth — MCP tools call the same engine as the CLI"
720+
- "Discoverable — AI tools auto-detect available tools from the server"
721+
negative:
722+
- "Adds MCP Python SDK as optional dependency"
723+
- "Users must configure MCP server in their AI tool (one-time setup)"
724+
- "MCP adoption is still early — not all tools support it yet"
725+
- "Scanner dependency story unchanged — tools still need local bins or Docker"
726+
727+
implementation: |
728+
Phase 5 in SDK-ROADMAP.md. Key files:
729+
argus/mcp.py — MCP server module (stdio transport)
730+
argus mcp — CLI subcommand to start the server
731+
Optional dependency: pip install argus-security[mcp]
732+
Existing skill at .agents/skills/ remains as fallback reference.
733+
Depends on Phase 3 (portability) for maximum scanner coverage without Docker.

docs/developer/SDK-ROADMAP.md

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,13 +147,103 @@ Refactor `.github/actions/scanner-*` to call `argus scan` internally. Actions sh
147147
- [ ] Progress indicators during scanning and container pulls
148148
- [ ] `argus report github` — post results as PR comment via GitHub API
149149

150+
### CI Preflight and Config Health
151+
152+
- [ ] CI workflow step: `argus validate --strict --check-tools` as a gate before scan jobs
153+
- [ ] Living issue (Renovate-style): a single "Argus Config Health" GitHub issue that gets updated (not recreated) when config validation fails on the default branch. Scheduled workflow runs `argus validate --strict --check-tools`, updates the issue body with current status, and auto-closes when healthy. Avoids issue spam — one issue, always current.
154+
- [ ] `argus validate --check-tools` notes for scanners with runtime network dependencies (e.g., OSV API, ClamAV freshclam, Trivy DB updates) — informational, not blocking
155+
150156
### CI Templates
151157
- [ ] GitLab CI template
152158
- [ ] Jenkins pipeline template
153159
- [ ] Azure DevOps template
154160

155161
---
156162

163+
## Remaining: Phase 5 — MCP Server (AI Assistant Integration)
164+
165+
Expose Argus as an MCP (Model Context Protocol) server so AI coding assistants can drive scanning natively. Replaces the need for tool-specific skill files with a single, tool-agnostic integration that stays current with the installed Argus version.
166+
167+
### Why MCP over skill files
168+
169+
We explored three approaches for AI assistant integration:
170+
171+
1. **Skill file installed by `argus init`** — A markdown file copied into the user's project that teaches AI assistants how to shell out to the Argus CLI. Problems:
172+
- Immediately becomes a stale snapshot with no update mechanism
173+
- AI tools have no skill registries or update notifications
174+
- Must be duplicated per tool (`.claude/commands/`, `.cursorrules`, `.github/copilot-instructions.md`) or the project picks favorites
175+
- The AI parses unstructured terminal output, losing information
176+
177+
2. **"Inform, don't install"**`argus init` prints a URL to the skill. Avoids staleness but puts the integration burden entirely on the user, and still has the terminal-parsing problem.
178+
179+
3. **MCP server** — Argus exposes structured tools that any MCP-compatible AI assistant discovers automatically. The assistant calls typed functions and receives structured JSON instead of parsing CLI output. Updates ship with `pip install --upgrade argus`. Tool-agnostic by design (Claude Code, Cursor, Windsurf, VS Code Copilot all support MCP).
180+
181+
### What the MCP server provides
182+
183+
**Tools:**
184+
185+
| Tool | Parameters | Returns |
186+
|------|-----------|---------|
187+
| `argus_detect` | `path` | Detected project signals (languages, frameworks, IaC, containers) |
188+
| `argus_scan` | `scanners`, `path`, `severity_threshold` | Structured findings with severity, file, line, rule, message |
189+
| `argus_validate` | `config_path` | Validation errors and warnings for argus.yml |
190+
| `argus_list_scanners` || Available scanners with install status and descriptions |
191+
| `argus_init` | `path`, `platform` | Generated config content and file paths |
192+
193+
**Resources:**
194+
195+
| Resource URI | Description |
196+
|-------------|-------------|
197+
| `argus://config` | Current argus.yml parsed as structured data |
198+
| `argus://results/latest` | Most recent scan results from the last run |
199+
200+
### User setup
201+
202+
```json
203+
{
204+
"mcpServers": {
205+
"argus": {
206+
"command": "argus",
207+
"args": ["mcp"]
208+
}
209+
}
210+
}
211+
```
212+
213+
One line of config in any MCP-compatible tool. The AI assistant then has full Argus capabilities without needing to know CLI syntax, parse terminal output, or have a skill file installed.
214+
215+
### Dependencies and portability considerations
216+
217+
The MCP server is a new interface to the existing engine — it does not change the scanner dependency story. Scanners still require either local binaries or Docker. Key considerations:
218+
219+
- Pure Python scanners (bandit, checkov, osv) work without Docker
220+
- Binary scanners (gitleaks, trivy, opengrep) need Docker or local install
221+
- `argus_list_scanners` should clearly report what's available and what's missing
222+
- Graceful degradation: scans return partial results with clear "unavailable" status per scanner rather than failing entirely
223+
- Phase 3 (portability) should land first to maximize the set of scanners that work out of the box
224+
225+
### Implementation tasks
226+
227+
- [ ] `argus/mcp.py` — MCP server module using the MCP Python SDK
228+
- [ ] `argus mcp` CLI subcommand to start the server (stdio transport)
229+
- [ ] `argus_detect` tool — wraps `detect_project()` from init module
230+
- [ ] `argus_scan` tool — wraps engine scan, returns structured `ScanResult.to_dict()`
231+
- [ ] `argus_validate` tool — wraps config validation
232+
- [ ] `argus_list_scanners` tool — wraps scanner registry with availability status
233+
- [ ] `argus_init` tool — wraps init workflow, returns generated content
234+
- [ ] `argus://config` resource — reads and parses argus.yml
235+
- [ ] `argus://results/latest` resource — reads most recent results from output dir
236+
- [ ] Add `mcp` extra to pyproject.toml (`pip install argus-security[mcp]`)
237+
- [ ] Tests for all MCP tools with mock engine
238+
- [ ] Documentation: setup instructions per AI tool, example interactions
239+
- [ ] `argus init` prints MCP setup hint in summary output
240+
241+
### Existing skill file
242+
243+
The skill at `.agents/skills/argus-scanner-selection/` remains as a reference document and works for AI tools that don't support MCP. It is not versioned or synced to releases. Once the MCP server ships, the skill can reference it as the preferred integration path.
244+
245+
---
246+
157247
## Known Issues
158248

159249
### Engine

0 commit comments

Comments
 (0)