Company Secure Python MCP
Company Secure Python MCP
这是仅设想从 Copilot Studio 使用、采用洁净室设计的最小 MCP 服务器。未复用旧 m365-copilot-companion-mcp 的代码。将上级目录的审计报告作为负向需求处理,将功能缩减为 6 个工具。
当前的定位是“可进行安全审查的参考实现”。在配置专用 VM 或专用 rootless Docker、Entra ID、TLS 终止、密钥 ACL、内部注册表、DLP/SIEM,并完成实际 Docker 集成测试之前,请勿投入生产。
提供的功能
工具 | 功能 | 主要限制 |
| 单层列表 | 仅限公共输入、本人输入、本人输出,最多 200 项 |
| 读取 UTF-8 文本 | 允许的扩展名、1 MiB、最多 20 万字符、显示未信任数据 |
| 新建文本 | 仅限本人输出、不可覆盖或删除、仅限允许的扩展名 |
| 固定执行请求 | 固定代码、输入哈希和输出名称,不执行 |
| 确认本人请求的状态 | 不返回代码正文或批准签名 |
| 执行已批准的请求 | 独立路径签名、仅限一次、Docker、无网络 |
未实现邮件、日历、剪贴板、注册表、ODBC、Web 获取、任意 URL、Shell、PowerShell、软件包安装、自我更新、自动启动、浏览器操作、Tool Forge、隧道、通用工具中继。
Related MCP server: AI Workspace MCP Server
信任边界
flowchart LR
CS[Copilot Studio] -->|OAuth 2.0 delegated token / TLS| RP[Reverse proxy / WAF]
RP -->|loopback or private hop| MCP[6-tool MCP service]
MCP -->|JWKS only| ENTRA[Microsoft Entra ID]
MCP -->|scoped access| WS[Per-user workspace]
MCP -->|immutable request| Q[Control queue]
REVIEW[Separate reviewer account] -->|Ed25519 signed approval| Q
Q -->|one-time claim| RUN[Dedicated/rootless Docker runner]
RUN -->|network=none / read-only / limits| JOB[Python container]
JOB -->|declared UTF-8 outputs only| WS
MCP -->|HMAC chain; no content| AUDIT[Audit log -> SIEM]批准私钥不会传递给 MCP 服务。MCP 服务仅持有批准公钥和审计密钥。Python 代码不会在主机 Python 上执行,也没有本地执行的回退。
首先阅读的文档
开发环境中的确认
python -m venv .venv
.\.venv\Scripts\python.exe -m pip install uv
.\.venv\Scripts\uv.exe sync --frozen --extra dev
.\scripts\Invoke-SecurityChecks.ps1 -PythonExecutable .\.venv\Scripts\python.exe在生产环境中,请勿直接从互联网上的 PyPI 安装,请使用已批准的公司内部镜像和 requirements.lock 的固定哈希。uv.lock 也固定开发和验证环境。不加载 .env。配置从服务管理平台传递到进程环境。
Python 作业的契约
输入:
/work/input/manifest.json和/work/input/<固定名称>(只读)输出:
/work/output/<在 python_prepare 中声明的文件名>公开名称: 为防止冲突,以
<request-id>-<序号>.<扩展名>的形式在本人输出中新建输出格式: UTF-8 的
.txt、.md、.csv、.json标准输出、标准错误: 丢弃,不返回给模型
网络: 无
执行时间: 默认 60 秒,最长 300 秒
内存: 256 MiB、CPU: 1、PID: 64
AST 的 import 允许列表是纵深防御,并不视为 Python 沙箱。实际的边界是独立路径批准以及专用 VM/rootless Docker 的 OS 隔离。
超时时若无法确认 docker rm -f 成功,则将 runner 置于 quarantine 状态,此后拒绝所有 Python 执行并保全执行目录。在运维人员销毁并重建专用 VM 之前不会恢复。
This server cannot be deployed
Maintenance
Related MCP Connectors
Sandbox workspace tools: search, file read, DB queries, integrations. Returns synthetic data.
Securely search and manage workspace context files for AI agents and teams.
Runtime permission, approval, and audit layer for AI agent tool execution.
Manage files and folders directly from your workspace. Read and write files, list directories, cre…
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceProvides secure, sandboxed file system access for AI assistants to read, write, and manage project files with controlled command execution capabilities, all confined to a designated workspace directory.MIT
- FlicenseNot gradedqualityDmaintenanceProvides a secure workspace for AI-driven file management and Python script execution designed to run on Vercel. It enables tools for full file operations and code execution within a sandboxed environment.-
- AlicenseNot gradedqualityBmaintenanceProvides a secure, constrained filesystem workspace for LLM agents to manage files, notes, and code artifacts via stdio or remote HTTP. It features granular access controls, including extension whitelisting, storage quotas, and immutable paths for safe automated file operations.BSD 3-Clause
- AlicenseNot gradedqualityAmaintenanceEnables LLMs to execute Python code securely in a sandboxed environment. Supports configurable restrictions like no network access and returns results including files.29 PyPIMIT