What is MCP?
The Model Context Protocol (MCP) is an open standard that lets AI agents communicate with external tools and data sources through a client-server architecture. An MCP client (the AI agent or its host) connects to one or more MCP servers, each of which exposes tools (callable functions), resources (readable data), and prompts (reusable templates). Because MCP servers execute real actions — running commands, querying databases, writing files — they are a direct attack surface for agent infrastructure.OWASP MCP Top 10
The OWASP MCP Top 10 is a vulnerability taxonomy for MCP-based systems, maintained by the OWASP Foundation. q-ai maps all audit findings to these categories.| ID | Vulnerability |
|---|---|
| MCP01 | Token Mismanagement & Secret Exposure |
| MCP02 | Privilege Escalation via Scope Creep |
| MCP03 | Tool Poisoning |
| MCP04 | Software Supply Chain Attacks |
| MCP05 | Command Injection & Execution |
| MCP06 | Prompt Injection via Contextual Payloads |
| MCP07 | Insufficient Authentication & Authorization |
| MCP08 | Lack of Audit & Telemetry |
| MCP09 | Shadow MCP Servers |
| MCP10 | Context Injection & Over-Sharing |
Transport types
MCP defines three transport mechanisms for client-server communication.| Transport | Description | Use case |
|---|---|---|
| stdio | Server spawned as a child process, communication over stdin/stdout | Local development, CI pipelines, testing servers you can run directly |
| SSE | Server-Sent Events over HTTP (legacy transport) | Remote servers using the older SSE-based MCP protocol |
| Streamable HTTP | Bidirectional HTTP transport (current standard) | Remote servers using the current MCP transport specification |
Threat model
q-ai tests agent infrastructure — the servers, tools, and trust boundaries that AI agents interact with — not just model outputs. The assumption is that MCP servers are untrusted components: they may leak secrets, execute injected commands, poison tool descriptions, or over-share context across sessions.Module methodologies
Audit, Proxy, Inject, Chain — MCP infrastructure testing
The audit module scans MCP servers by enumerating exposed tools, resources, and prompts, then running security checks mapped to the OWASP MCP Top 10. Proxy intercepts live MCP traffic between client and server for inspection and replay. Inject tests whether AI agents comply with poisoned tool descriptions. Chain composes multi-step attack sequences across modules.IPI — Generate, Deploy, Track
IPI has an active attack chain with callback-based proof of execution:- Generate — Create documents with hidden payloads, registered as campaigns with unique tokens
- Deploy — Place payloads where the target AI will ingest them
- Track — The callback listener captures HTTP requests from agents that execute the instruction
CXP — Build, Test, Record
CXP is a research harness where the researcher drives the test:- Build — Assemble a context file from clean base templates + researcher-selected insecure coding rules via the interactive TUI
- Test — Open the generated repo in a coding assistant, issue a trigger prompt, capture the output
- Record — Store results in the evidence pipeline with validation against detection rules
RXP — Embed, Query, Score
RXP measures retrieval behavior without connecting to live systems:- Embed — Encode corpus and poison documents into vectors using an embedding model
- Query — Run target queries and retrieve top-k results from an ephemeral collection
- Score — Measure poison document retrieval rate and rank across models
Callback-based verification
Each IPI campaign generates a unique callback URL containing a cryptographic token:| Confidence | Criteria | Interpretation |
|---|---|---|
| HIGH | Valid campaign token present | Strong proof of agent execution — the token could only have come from the specific payload |
| MEDIUM | No/invalid token, but programmatic User-Agent (python-requests, httpx, curl, etc.) | Likely agent execution, but without token proof |
| LOW | No/invalid token and browser/scanner User-Agent | Noise — likely a human click, web crawler, or port scanner |
Payload styles vs payload types
q-ai separates how a payload is hidden from what it instructs the agent to do. Payload styles control how the injection instruction blends into the document content. Styles range fromobvious (direct injection markers for baseline testing) to subtle social-engineering approaches like citation, reviewer, academic, compliance, and datasource that disguise the instruction as legitimate document content.
Payload types define the action the agent is instructed to perform:
callback— Fire an HTTP request to the listener (proof of execution)exfil_summary,exfil_context— Exfiltrate data to the listenerssrf_internal— Server-side request forgery to internal endpointsinstruction_override— Override the agent’s system instructionstool_abuse— Misuse agent tools and capabilitiespersistence— Persist instructions across sessions
Dangerous payload gating
Payload types are divided into two safety tiers:- Always available:
callback— benign proof-of-execution that only fires an HTTP GET - Requires
--dangerousflag: All other payload types (exfil, SSRF, instruction override, tool abuse, persistence)
q-ai modules
| Module | Attack Surface | What It Tests | How It Proves Results |
|---|---|---|---|
| audit | MCP server capabilities | Whether servers expose vulnerabilities mapped to the OWASP MCP Top 10 | Structured findings with severity, evidence, and remediation |
| proxy | MCP client-server traffic | What data flows between agents and servers | Recorded sessions with message-level detail |
| inject | MCP tool descriptions | Whether AI agents comply with poisoned tool descriptions | Model response analysis with compliance scoring |
| chain | Multi-module attack paths | Whether vulnerabilities can be composed into attack chains | Step-by-step execution trace with success/failure |
| ipi | Document ingestion | Whether AI agents execute hidden instructions in uploaded documents | Out-of-band HTTP callback from the agent |
| cxp | Project instruction files | Whether poisoned instruction files influence coding assistant code generation | Detection rule validation against captured assistant output |
| rxp | RAG retrieval layer | Whether adversarial documents win vector similarity battles and enter the LLM context window | Retrieval rate and poison rank scoring across embedding models |
Interpret prompts
Every report and export output includes aprompt field containing an AI-evaluation prompt. This prompt summarizes the structured findings in natural language and can be fed directly to an LLM for automated analysis, triage recommendations, or follow-on testing priorities.
| Module | What the prompt summarizes |
|---|---|
| audit | Target server, tools scanned, findings by severity, OWASP categories |
| inject | Target model, techniques used, compliance outcomes |
| chain | Step count, modules used, trust boundaries crossed, success/failure path |
| ipi | Campaign count, formats, techniques, callback hit rate |
| cxp | Techniques, objectives, assistants tested, outcome distribution |
| rxp | Embedding model, query count, retrieval rate, mean poison rank |
"prompt" in JSON output, "interpretPrompt" in SARIF, and as an expandable analyst context section in HTML reports.