Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

FEAT: MCP (Model Context Protocol) Integration

Abierto
#1,273 6 comentarios 1 reacción 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Este issue todavía no se ha evaluado.

Descripción

enhancement needs design not ready yet
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:

  1. Core MCP client implementation using the MCP Python SDK
  2. Integration with OpenAIResponseTarget
  3. Integration examples with existing agentic security tools as MCP resources/tool
  4. 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.

Lenguaje dominante
Python
Estrellas
4.5k
Forks
896
Merge medio
3 d 8 h
PR fusionados (30 d)
191

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de microsoft/PyRIT

Todos los issues de microsoft/PyRIT

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.