modelcontextprotocol / modelcontextprotocol/python-sdk
Document and provide hooks for sandboxing file and network access in MCP tools
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Python
- Estrellas
- 24.3k
- Forks
- 4k
- Merge medio
- 1 d 1 h
- PR fusionados (30 d)
- 31
Descripción
Description
Summary
MCP tools and resources built with the Python SDK can, by default, access the full file system, network, and environment of the host process. This is powerful but risky, especially when:
- servers are installed from third parties, or
- LLM agents can call tools based on prompt-injected instructions.
The SDK should clearly document this and provide hooks/patterns for limiting capabilities.
Proposal
-
Document security considerations
- Add a “Security considerations” section explicitly calling out:
- file system access,
- network access,
- environment variables and credentials.
- Add a “Security considerations” section explicitly calling out:
-
Provide capability hooks
- Offer configuration points or helper utilities to:
- restrict file access to specific directories (allowlist),
- restrict outbound network calls to certain hosts/domains,
- prevent access to environment variables by default.
- Offer configuration points or helper utilities to:
-
Encourage process-level sandboxing
- Provide guidance on running MCP servers in:
- containers with minimal privileges,
- separate processes with limited OS capabilities.
- Provide guidance on running MCP servers in:
Why this matters
- Defense in depth: Even if application code is careful, configuration mistakes or third-party code can introduce risk.
- Prompt-injection mitigation: Restricting what tools can do reduces the impact of malicious prompts.
- Operational guidance: Many users are new to MCP and benefit from clear security best practices.
Acceptance criteria
- Documentation clearly describes the security implications of running MCP servers and tools.
- There are example patterns for restricting file and network access.
- Where feasible, the SDK exposes hooks or configuration points for capability control.
References
No response
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
No se indican archivos ni pruebas. Empieza revisando la documentación existente del SDK y los puntos de configuración o extensión para servidores y herramientas MCP; después, determina si se pueden añadir controles de capacidades sin asumir una aplicación a nivel del sistema operativo. Se considera terminado cuando las directrices de seguridad, los ejemplos de restricciones de archivos y red, y los hooks o puntos de configuración viables están documentados y cubiertos por una validación adecuada.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- python
- Área
- documentation, security
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Estado de actividad
- Activo
- Claridad
- Bastante claro
- Aptitud para principiantes
- 35/100