关于 agentos
AgentOS MCP Server 让用户通过自然语言在 Claude Desktop、Copilot、Cursor 等 MCP 客户端中创建、测试和部署 AI Agent,并附带安全策略、审批和审计功能。适合需要合规管理的自动化场景。
主要功能
- 01通过自然语言描述创建 Agent
- 02内置 6 种安全策略并可执行策略评估
- 03高风险操作的人工审批流程
- 04不可变审计日志与合规报告
- 05提供 10 个 Agent 模板
适用场景
- 01创建每晚备份文件的 Agent 并附加安全策略
- 02在部署前以 dry-run 方式测试 Agent
- 03按 SOC 2 或 GDPR 等框架检查 Agent 的合规性
MCP 相关
AgentOS MCP Server 是 MCP 服务,向 MCP 客户端暴露 create_agent、test_agent、deploy_agent、audit_log、check_compliance 等 10 个工具。
配置
本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。
工具
10收录的工具列表 · 更新于 2 周前
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| language | enum | 否 | Agent 使用的编程语言python | typescript | javascript | go |
| policies | array | 否 | 要应用的策略模板(例如:"pii-protection"、"rate-limiting") |
| schedule | string | 否 | 用于定期执行的 Cron 计划(例如:"0 9 * * *" 表示每天上午 9 点) |
| description | string | 是 | 对 Agent 应执行任务的自然语言描述 |
| approvalRequired | boolean | 否 | 执行前是否需要人工审批 |
详细介绍
AgentOS MCP 服务
使用自然语言构建安全的 AI Agent,实现 0% 的策略违规
属于 Agent OS - 面向 AI Agent 的内核级治理
🚀 快速安装
npx agentos-mcp-server
npm: agentos-mcp-server
MCP Registry: io.github.imran-siddique/agentos
概述
AgentOS MCP 服务将完整的 Agent OS 安全框架带到任何兼容 MCP 的 AI 助手中,包括 Claude Desktop、GitHub Copilot、Cursor 等。通过自然对话创建、部署和管理符合策略的自主 Agent。
┌─────────────────────────────────────────────────────────────┐
│ Claude Desktop / Copilot / Cursor │
│ ┌────────────────────────────────────────────────────────┐ │
│ │ "Create an agent that..." │ │
│ └──────────────────────┬─────────────────────────────────┘ │
└─────────────────────────┼───────────────────────────────────┘
│ MCP Protocol
┌─────────────▼─────────────┐
│ 🛡️ AgentOS MCP Server │
│ │
│ • 10 Tools │
│ • Policy Engine │
│ • Approval Workflows │
│ • Audit Logging │
│ • Template Library │
└─────────────┬─────────────┘
│
┌───────────────────┼───────────────────┐
│ │ │
┌─────▼─────┐ ┌──────▼──────┐ ┌─────▼─────┐
│ Agents │ │ Policies │ │ Audit │
│ (Local) │ │ (Enforced) │ │ (Logged) │
└───────────┘ └─────────────┘ └───────────┘
✨ 功能
🤖 通过自然语言创建 Agent
User: Create an agent that processes customer feedback from support emails daily
Claude: ✅ Agent Created Successfully!
Agent: customer-feedback-processor
✅ Data Source: Email inbox via IMAP
✅ Processing: Sentiment analysis + categorization
✅ Output: Daily summary to Slack
✅ Schedule: Every day at 9 AM
Safety Policies Applied:
🛡️ PII Protection: Customer emails/names anonymized
🛡️ Rate Limiting: Max 1000 emails per run
🛡️ Human Review: Negative sentiment cases flagged
🛡️ 强制执行策略,违规率为 0%
- 6 项内置策略(PII、速率限制、成本控制、数据删除、密钥、人工审核)
- 实时策略评估
- 自动拦截违规行为
- 清晰的说明和替代方案
✅ 人机协同审批工作流
- 基于风险的审批要求
- 关键操作需多方审批
- 电子邮件/Slack 通知
- 过期处理
📊 完整的审计追踪
- 以不可变方式记录每项操作
- 记录策略评估
- 生成合规报告
- 导出供审计人员使用
📋 模板库
- 10 多种 Agent 模板(数据处理器、电子邮件助手、备份、抓取工具等)
- 6 种以上策略模板(GDPR、SOC 2、HIPAA、PCI DSS 等)
- 行业专属合规框架
🏛️ 满足合规要求
- SOC 2 - 安全性与可用性控制
- GDPR - 欧盟数据保护
- HIPAA - 医疗健康数据隐私
- PCI DSS - 支付卡安全
- CCPA - 加州隐私保护
- NIST - 网络安全框架
- ISO 27001 - 信息安全
- FedRAMP - 联邦授权
🚀 快速入门
第 1 步:配置 Claude Desktop
将以下内容添加到 claude_desktop_config.json:
Windows: %APPDATA%\Claude\claude_desktop_config.json
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Linux: ~/.config/Claude/claude_desktop_config.json
{
"mcpServers": {
"agentos": {
"command": "npx",
"args": ["-y", "agentos-mcp-server"],
"env": {
"AGENTOS_POLICY_MODE": "strict"
}
}
}
}
第 2 步:重启 Claude Desktop
关闭并重新打开 Claude Desktop,以加载 MCP 服务。
第 3 步:开始构建 Agent!
只需自然地向 Claude 提出请求:
"Create an agent that backs up my Documents folder to Google Drive every night"
Claude 将会:
- 使用合适的配置创建 Agent
- 根据任务推荐安全策略
- 让你在部署前进行测试
- 启用监控后进行部署
💬 对话示例
创建数据处理 Agent
User: I need an agent that processes customer feedback from support emails daily
Claude: ✅ Agent Created Successfully!
Agent: customer-feedback-processor
ID: a1b2c3d4-e5f6-7890-abcd-ef1234567890
Status: draft
Language: python
Task:
Process customer feedback from support emails daily
Workflow Steps:
1. connect_email: email.connect
2. process_data: execute
3. output_results: output
Safety Policies Applied:
🛡️ PII Protection: Customer emails/names anonymized
🛡️ Rate Limiting: Max 1000 emails per run
🛡️ Human Review: Negative sentiment cases flagged
Next Steps:
1. Use `test_agent` to run a dry-run test
2. Use `attach_policy` to add more safety policies
3. Use `deploy_agent` when ready to run
部署前测试
User: Test this agent with a scenario of processing 100 emails
Claude: ✅ Test PASSED
Agent: customer-feedback-processor
Scenario: Process 100 customer emails
Mode: Dry Run (no changes)
Configuration Check: ✅ Valid
Workflow Check: ✅ Valid (3 steps)
Policy Evaluation: ✅ No violations detected
Warnings:
⚠️ PII access logged
Resource Estimates:
- Duration: ~30 seconds
- Cost: $0.05
Next Step: Use `deploy_agent` to deploy this agent.
检查合规性
User: Check if this agent is SOC 2 compliant
Claude: # Compliance Report: SOC2
Agent: customer-feedback-processor
Framework: SOC2
Date: 2026-01-30
## Summary
✅ COMPLIANT
Score: 100% (4/4 controls passed)
## Control Assessment
✅ CC6.1: Logical Access Controls
Restrict logical access to information assets
Evidence: Policy enforcement enabled, Access logging active
✅ CC6.6: Security Event Monitoring
Detect and respond to security events
Evidence: Audit logging enabled, Event timestamps recorded
✅ CC7.2: Incident Response
Respond to security incidents
Evidence: Human review enabled, Escalation procedures in place
✅ CC8.1: Change Management
Manage changes to system components
Evidence: Deployment approval required, Version control enabled
创建自定义策略
User: Create a policy that blocks access to customer credit card data
Claude: ✅ Custom Policy Created
Policy: Block Access To Customer
ID: custom-a1b2c3d4
Category: security
Description:
Block access to customer credit card data
Rules Generated (1):
🟠 custom_block_rule [high]
Block actions based on: block access to customer credit card data
Action: deny
Usage:
1. Attach to agent: `attach_policy` with policyId "custom-a1b2c3d4"
2. Test enforcement: `test_agent` with policy scenarios
3. View active policies: `get_agent_status`
🔧 可用工具
| 工具 | 描述 |
|---|---|
create_agent | 根据自然语言描述创建 Agent |
attach_policy | 为 Agent 添加安全策略 |
test_agent | 部署前进行试运行测试 |
deploy_agent | 在本地或云端部署 Agent |
get_agent_status | 获取 Agent 状态和指标 |
list_templates | 浏览 Agent 和策略模板 |
request_approval | 为敏感操作创建审批请求 |
audit_log | 查询审计追踪 |
create_policy | 根据描述创建自定义策略 |
check_compliance | 对照合规框架进行检查 |
工具详情
create_agent
根据自然语言描述创建新的 AI Agent,并自动推荐策略。
参数:
| 参数 | 类型 | 必填 | 描述 |
|---|---|---|---|
description | string | ✅ | 对 Agent 任务的自然语言描述 |
policies | string[] | 要应用的策略模板 | |
approvalRequired | boolean | 执行前是否需要人工审批 | |
language | string | python、typescript、javascript、go | |
schedule | string | 定期执行的 Cron 计划 |
attach_policy
为 Agent 附加安全策略,并检测冲突。
参数:
| 参数 | 类型 | 必填 | 描述 |
|---|---|---|---|
agentId | string | ✅ | 要附加策略的 Agent ID |
policyId | string | ✅ | 策略模板 ID |
customRules | object[] | 其他自定义规则 |
test_agent
使用模拟场景运行试运行测试。
参数:
| 参数 | 类型 | 必填 | 描述 |
|---|---|---|---|
agentId | string | ✅ | 要测试的 Agent ID |
scenario | string | ✅ | 测试场景描述 |
mockData | object | 用于测试的模拟数据 | |
dryRun | boolean | 无副作用地运行(默认值:true) |
deploy_agent
将 Agent 部署到本地或云环境。
参数:
| 参数 | 类型 | 必填 | 描述 |
|---|---|---|---|
agentId | string | ✅ | 要部署的 Agent ID |
environment | string | local 或 cloud | |
autoStart | boolean | 部署后立即启动 |
check_compliance
检查 Agent 是否符合监管框架要求。
参数:
| 参数 | 类型 | 必填 | 描述 |
|---|---|---|---|
agentId | string | ✅ | 要检查的 Agent ID |
framework | string | ✅ | SOC2、GDPR、HIPAA、PCI_DSS、CCPA、NIST、ISO27001、FEDRAMP |
generateReport | boolean | 生成详细报告 |
📋 策略模板
内置安全策略
| 策略 ID | 名称 | 描述 |
|---|---|---|
pii-protection | PII 保护 | 保护个人身份信息(GDPR) |
rate-limiting | 速率限制 | 通过速率限制防止资源滥用 |
cost-control | 成本控制 | 防止自动化导致成本失控 |
data-deletion | 数据删除安全 | 防止意外数据丢失 |
secrets-protection | 密钥保护 | 防止凭据泄露 |
human-review | 需要人工审核 | 对敏感操作要求审批 |
合规模板
| 模板 ID | 框架 | 描述 |
|---|---|---|
gdpr-compliance | GDPR | 欧盟《通用数据保护条例》 |
soc2-security | SOC 2 | SOC 2 Type II 安全控制 |
hipaa-healthcare | HIPAA | 医疗保健数据隐私(PHI 保护) |
pci-dss-payments | PCI DSS | 支付卡数据安全 |
read-only-access | 安全 | 将数据库限制为只读 |
production-safety | 运维 | 为生产环境提供额外防护 |
🤖 Agent 模板
数据处理
| 模板 | 描述 | 默认策略 |
|---|---|---|
data-processor | 处理和转换数据文件 | rate-limiting、cost-control |
web-scraper | 抓取网站以收集数据 | rate-limiting、cost-control |
report-generator | 生成定期报告 | pii-protection、rate-limiting |
通信
| 模板 | 描述 | 默认策略 |
|---|---|---|
email-assistant | 监控和处理电子邮件 | pii-protection、human-review |
slack-bot | 自动发送 Slack 通知 | human-review、rate-limiting |
基础设施
| 模板 | 描述 | 默认策略 |
|---|---|---|
backup-agent | 将文件备份到云存储 | cost-control |
api-monitor | 监控 API 的健康状况和性能 | rate-limiting |
file-organizer | 根据规则整理文件 | data-deletion |
分析
| 模板 | 描述 | 默认策略 |
|---|---|---|
database-analyst | 查询数据库并生成报告 | data-deletion, pii-protection |
content-moderator | 审核用户生成的内容 | human-review, pii-protection |
⚙️ 配置
环境变量
| 变量 | 描述 | 默认值 |
|---|---|---|
AGENTOS_API_KEY | 云功能的 API 密钥 | (无) |
AGENTOS_POLICY_MODE | strict 或 permissive | strict |
AGENTOS_DATA_DIR | 本地数据目录 | .agentos |
AGENTOS_LOG_LEVEL | debug、info、warn、error | info |
策略模式
| 模式 | 行为 |
|---|---|
| strict | 任何策略违规都会阻止操作 |
| permissive | 仅严重违规会阻止操作(警告会记录到日志) |
数据存储
所有数据都存储在本地的 AGENTOS_DATA_DIR 中:
.agentos/
├── agents/ # Agent configurations
│ └── {id}.json
├── approvals/ # Approval requests
│ └── {id}.json
└── audit/ # Audit logs (JSONL format)
└── {date}.jsonl
🏗️ 架构
┌─────────────────────────────────────────────────────────────┐
│ Claude Desktop │
│ ┌────────────────────────────────────────────────────────┐ │
│ │ Claude AI Model │ │
│ │ Natural language understanding & orchestration │ │
│ └──────────────────────┬─────────────────────────────────┘ │
│ │ MCP Protocol │
│ ┌──────────────────────▼─────────────────────────────────┐ │
│ │ MCP Client │ │
│ │ Tool discovery & request handling │ │
│ └──────────────────────┬─────────────────────────────────┘ │
└─────────────────────────┼───────────────────────────────────┘
│ stdio
┌─────────────────────────▼───────────────────────────────────┐
│ @agentos/mcp-server (Node.js) │
│ ┌────────────────────────────────────────────────────────┐ │
│ │ MCP Server │ │
│ │ Tool/Resource/Prompt handlers │ │
│ └────────────────────────────────────────────────────────┘ │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌───────────────┐ │
│ │ Agent │ │ Policy │ │ Approval │ │ Audit │ │
│ │ Manager │ │ Engine │ │ Workflow │ │ Logger │ │
│ └──────────┘ └──────────┘ └──────────┘ └───────────────┘ │
│ ┌────────────────────────────────────────────────────────┐ │
│ │ Template Library (50+ templates) │ │
│ └────────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────┘
│ HTTPS (optional)
┌─────────────────────────▼───────────────────────────────────┐
│ AgentOS Cloud Platform (Future) │
│ • Persistent storage • Multi-tenant • Enterprise │
└─────────────────────────────────────────────────────────────┘
🔒 安全
| 功能 | 描述 |
|---|---|
| 策略执行 | 执行前根据策略验证所有操作 |
| 数据脱敏 | 自动从日志中移除敏感数据 |
| 密钥保护 | 密钥绝不会以明文形式存储 |
| 审计跟踪 | 用于合规审查的完整、不可变日志 |
| 人工审批 | 高风险操作必须经过审批 |
| 本地优先 | 默认将所有数据存储在本地 |
💻 开发
本地开发
# Clone the repository
git clone https://github.com/imran-siddique/agent-os
cd agent-os/packages/mcp-server
# Install dependencies
npm install
# Build
npm run build
# Run in stdio mode (for Claude Desktop)
npm start -- --stdio
# Run in HTTP mode (for development)
npm start -- --http --port 3000
项目结构
packages/mcp-server/
├── src/
│ ├── index.ts # Main entry point
│ ├── cli.ts # CLI with --stdio/--http modes
│ ├── server.ts # MCP server implementation
│ ├── tools/ # 10 MCP tools
│ │ ├── create-agent.ts
│ │ ├── attach-policy.ts
│ │ ├── test-agent.ts
│ │ ├── deploy-agent.ts
│ │ ├── get-agent-status.ts
│ │ ├── list-templates.ts
│ │ ├── request-approval.ts
│ │ ├── audit-log.ts
│ │ ├── create-policy.ts
│ │ └── check-compliance.ts
│ ├── services/ # Core business logic
│ │ ├── agent-manager.ts
│ │ ├── policy-engine.ts
│ │ ├── approval-workflow.ts
│ │ ├── audit-logger.ts
│ │ └── template-library.ts
│ ├── prompts/ # MCP prompts
│ └── types/ # TypeScript definitions
├── package.json
├── tsconfig.json
└── README.md
运行测试
npm test
npm run test:coverage
📊 性能
| 指标 | 目标 |
|---|---|
| MCP 服务启动时间 | <2 秒 |
| 工具响应时间 | <500ms(p95) |
| 内存占用 | <100MB |
| 策略评估时间 | <50ms |
📜 许可证
MIT 许可证 - 参见 LICENSE。
评论
一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。