SentinelMCP
SentinelMCP
用于模型上下文协议(MCP)的确定性策略防火墙与运行时治理引擎
概述
SentinelMCP 是一个生产级安全网关和运行时治理框架,专为**模型上下文协议(MCP)**服务器和多代理 AI 集群 [1] 设计。随着 AI 代理通过 MCP 越来越自主地访问企业文件系统、数据库和 API,提示注入、未授权工具调用和数据泄露等安全风险急剧增加。
SentinelMCP 充当内联策略防火墙,拦截 JSON-RPC MCP 工具调用,根据声明式 AST 规则检查参数,强制执行安全限制,并记录不可篡改、可加密验证的审计跟踪。
Related MCP server: protect-mcp
核心架构与特性
策略即代码引擎:声明式 JSON/YAML 策略定义,支持工具名称的 glob 模式匹配、参数值的正则表达式检查以及严格的参数模式验证 [2]。
加密溯源账本:仅追加的审计日志,每条执行记录通过 SHA-256 哈希链接,确保防篡改的可追溯性,满足合规和审计要求。
高性能代理网关:基于 FastAPI 和 Pydantic v2 构建,通过异步请求处理实现亚毫秒级拦截延迟。
CLI 与测试工具链:内置 CLI,用于评估工具调用是否符合策略、运行网关服务器以及验证账本完整性。
企业级 CI/CD:通过 pytest 全面测试,在 Python 3.11 和 3.12 上进行矩阵测试,并与 GitHub Actions 工作流集成。
安装
克隆仓库并以可编辑模式安装,同时包含开发依赖:
git clone https://github.com/ateeqdesktop-dot/sentinel-mcp.git
cd sentinel-mcp
pip install -e .[dev]使用方法
1. 通过 CLI 评估工具调用
您可以测试 SentinelMCP 如何根据您的安全策略评估任何 MCP 工具调用:
sentinel-mcp evaluate --tool fs_delete --args '{"path": "/home/user/document.txt"}' --policy policy.json2. 运行网关服务器
在本地启动 SentinelMCP 代理服务器:
sentinel-mcp serve --host 127.0.0.1 --port 8000 --policy policy.json3. 验证审计账本完整性
验证仅追加的审计跟踪是否未被篡改:
sentinel-mcp verify --ledger sentinel_audit.jsonl策略配置示例(policy.json)
{
"version": "1.0",
"default_action": "allow",
"rules": [
{
"id": "block-destructive-fs",
"tool_pattern": "fs_*",
"action": "deny",
"forbidden_arguments": [
"rm\\s+-rf",
"/etc/passwd",
"drop\\s+database"
]
},
{
"id": "limit-sql-queries",
"tool_pattern": "db_*",
"action": "allow",
"max_string_length": 500
}
]
}测试
使用 pytest 和代码覆盖率运行测试套件:
pytest --cov=sentinel tests/ -v许可证
根据 MIT 许可证分发。有关更多信息,请参阅 LICENSE。
参考
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
AlicenseNot gradedqualityCmaintenancePolicy enforcement gateway for MCP tool calls, evaluating every tool invocation against declarative YAML policies (allow/deny/escalate-to-human), generating cryptographic hash-chained audit receipts, and including built-in content safety scanning.2MIT- AlicenseBqualityCmaintenanceSecurity gateway that wraps any MCP server with per-tool policies, approval gates, and optional Ed25519-signed decision receipts. Shadow mode logs every tool call without blocking; enforce mode applies block, rate-limit, and minimum-tier rules. Receipts are independently verifiable offline with no accounts needed.54699MIT
- FlicenseNot gradedqualityBmaintenanceThe security runtime for MCP servers. Every tool call inspected. Every attack blocked. Every decision logged.1
- AlicenseNot gradedqualityBmaintenanceA least-privilege enforcement proxy for MCP servers. It sits between MCP clients and upstream servers, enforcing tool policies, hiding denied tools, requiring human approval for risky actions, and providing a structured audit trail.MIT
Related MCP Connectors
Security scanner for MCP servers. Detect vulnerabilities, prompt injection, and tool poisoning.
Scans MCP servers for tool poisoning, prompt injection and supply chain risks.
Security firewall for AI agents — scans MCP calls for injection, secrets, and risks.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/ateeqdesktop-dot/sentinel-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server