FEAT: MCP (Model Context Protocol) Integration
还没有人认领这个 Issue。
评估
这个 Issue 还没有评估数据。
描述
Is your feature request related to a problem? Please describe.
When red teaming agentic AI systems, PyRIT currently requires custom integrations for each external tool, data source, or capability. This creates friction when testing systems that use diverse toolsets and limits the ability to dynamically discover and interact with target capabilities during assessments.
TheModel Context Protocol (MCP) by Anthropic provides a standardized interface for LLM-to-tool communication that's rapidly being adopted across the AI ecosystem. Without MCP support, PyRIT cannot natively interact with MCP-enabled targets or leverage the growing ecosystem of MCP servers for red teaming workflows.
Describe the solution you'd like
Add native MCP support to PyRIT, enabling red teaming agents to dynamically discover and use external tools, data sources, and prompt templates via the MCP protocol.
Core Capabilities:
- Tools: Execute functions (converters, probes, external APIs, target system tools)
- Resources: Read data (attack datasets, MITRE ATLAS mappings, reconnaissance results)
- Prompts: Load templates (red team agent prompts, attack strategies)
Proposed Implementation:
The codebase already defines MCP types in MessagePieceType:
MCP_CALL = "mcp_call"
MCP_LIST_TOOLS = "mcp_list_tools"
MCP_APPROVAL_REQUEST = "mcp_approval_request"
These types aren't implemented yet. This proposal would complete that implementation.
Proposed Usage:
from pyrit.mcp import MCPServerConfig, MCPTransport
# Native MCP support in target
target = OpenAIResponseTarget(
mcp_servers=[
MCPServerConfig(
name="converters",
transport=MCPTransport.STDIO,
command="python",
args=["converters_server.py"]
),
MCPServerConfig(
name="recon",
transport=MCPTransport.SSE,
url="http://localhost:8080/sse"
),
]
)
# Target auto-discovers tools, model can call them during conversation
Implementation Phases:
- Core MCP client implementation using the MCP Python SDK
- Integration with OpenAIResponseTarget
- Integration examples with existing agentic security tools as MCP resources/tool
- Documentation and notebooks
Additional context
Relationship to Existing Issues:
- Supersedes #1083
- Supersedes #1118
References:
Open Questions:
- Should example MCP servers live in PyRIT core or a separate repository?
- Which transport should be prioritized first (STDIO vs SSE)?
- Any security considerations for MCP server sandboxing during red team operations?
I'm happy to start the implementation and can break this into smaller PRs. Would welcome collaboration from anyone interested in this direction.
- 主要语言
- Python
- 星标
- 4.5k
- 派生
- 896
- 平均合并
- 3 天 8 小时
- 30 天内合并 PR
- 191
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
microsoft/PyRIT 的其他 Issue
-
BUG HarmBench loader drops ContextString, so contextual behaviors are sent without their context 未关闭
难度 2/5 1-3 小时 新手友好度 74/100
-
难度 2/5 1-3 小时 新手友好度 78/100
-
难度 2/5 1-3 小时 新手友好度 82/100
-
难度 2/5 1-3 小时 新手友好度 78/100
-
难度 5/5 一周以上 新手友好度 35/100
相似的 Issue
-
agent-ready documentation needs-triage
难度 1/5 1-3 小时 新手友好度 88/100
-
documentation
难度 1/5 1 小时以内 新手友好度 91/100
-
workflow-status page template still says reusable workflows are "triggered only by workflow_call:" 未关闭
难度 1/5 1 小时以内 新手友好度 92/100
-
instance instance add
难度 1/5 1 小时以内 新手友好度 72/100
searxng/searx-instances#939 · 1 条评论 ·
-
area-deployment area-integrations triage:bot-seen
难度 2/5 半天 新手友好度 86/100