mcpField
A
agentos

agentos

本地服务
github.com/imran-siddiqueAI 与智能体7434 周前更新

关于 agentos

AgentOS MCP Server 让用户通过自然语言在 Claude Desktop、Copilot、Cursor 等 MCP 客户端中创建、测试和部署 AI Agent,并附带安全策略、审批和审计功能。适合需要合规管理的自动化场景。

主要功能

  1. 01通过自然语言描述创建 Agent
  2. 02内置 6 种安全策略并可执行策略评估
  3. 03高风险操作的人工审批流程
  4. 04不可变审计日志与合规报告
  5. 05提供 10 个 Agent 模板

适用场景

  1. 01创建每晚备份文件的 Agent 并附加安全策略
  2. 02在部署前以 dry-run 方式测试 Agent
  3. 03按 SOC 2 或 GDPR 等框架检查 Agent 的合规性

MCP 相关

AgentOS MCP Server 是 MCP 服务,向 MCP 客户端暴露 create_agent、test_agent、deploy_agent、audit_log、check_compliance 等 10 个工具。

配置

本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。

mcp.json · 通用配置
{
"mcpServers": {
"imran-siddique-agentos": {
"command": "npx",
"args": [
"-y",
"agentos-mcp-server"
],
"env": {
"AGENTOS_POLICY_MODE": "<AGENTOS_POLICY_MODE>",
"AGENTOS_LOG_LEVEL": "<AGENTOS_LOG_LEVEL>"
}
}
}
}
启动命令npx -y agentos-mcp-server
需要配置的环境变量
AGENTOS_POLICY_MODEPolicy enforcement mode: strict (block all violations) or permissive (warn only)
AGENTOS_LOG_LEVELLog level: debug, info, warn, or error

本地服务需要在你的电脑上安装运行环境(如 Node.js 18+)。各客户端的配置文件位置不同,请参考客户端文档。

安装包
npmagentos-mcp-server1.0.1

工具

10

收录的工具列表 · 更新于 2 周前

参数类型必填说明
languageenum否Agent 使用的编程语言python | typescript | javascript | go
policiesarray否要应用的策略模板(例如:"pii-protection"、"rate-limiting")
schedulestring否用于定期执行的 Cron 计划(例如:"0 9 * * *" 表示每天上午 9 点)
descriptionstring是对 Agent 应执行任务的自然语言描述
approvalRequiredboolean否执行前是否需要人工审批

详细介绍

AgentOS MCP 服务

使用自然语言构建安全的 AI Agent,实现 0% 的策略违规

README 配图

npm version MCP Registry License: MIT

属于 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 将会:

  1. 使用合适的配置创建 Agent
  2. 根据任务推荐安全策略
  3. 让你在部署前进行测试
  4. 启用监控后进行部署

💬 对话示例

创建数据处理 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,并自动推荐策略。

参数:

参数类型必填描述
descriptionstring✅对 Agent 任务的自然语言描述
policiesstring[]要应用的策略模板
approvalRequiredboolean执行前是否需要人工审批
languagestringpython、typescript、javascript、go
schedulestring定期执行的 Cron 计划
attach_policy

为 Agent 附加安全策略,并检测冲突。

参数:

参数类型必填描述
agentIdstring✅要附加策略的 Agent ID
policyIdstring✅策略模板 ID
customRulesobject[]其他自定义规则
test_agent

使用模拟场景运行试运行测试。

参数:

参数类型必填描述
agentIdstring✅要测试的 Agent ID
scenariostring✅测试场景描述
mockDataobject用于测试的模拟数据
dryRunboolean无副作用地运行(默认值:true)
deploy_agent

将 Agent 部署到本地或云环境。

参数:

参数类型必填描述
agentIdstring✅要部署的 Agent ID
environmentstringlocal 或 cloud
autoStartboolean部署后立即启动
check_compliance

检查 Agent 是否符合监管框架要求。

参数:

参数类型必填描述
agentIdstring✅要检查的 Agent ID
frameworkstring✅SOC2、GDPR、HIPAA、PCI_DSS、CCPA、NIST、ISO27001、FEDRAMP
generateReportboolean生成详细报告

📋 策略模板

内置安全策略
策略 ID名称描述
pii-protectionPII 保护保护个人身份信息(GDPR)
rate-limiting速率限制通过速率限制防止资源滥用
cost-control成本控制防止自动化导致成本失控
data-deletion数据删除安全防止意外数据丢失
secrets-protection密钥保护防止凭据泄露
human-review需要人工审核对敏感操作要求审批
合规模板
模板 ID框架描述
gdpr-complianceGDPR欧盟《通用数据保护条例》
soc2-securitySOC 2SOC 2 Type II 安全控制
hipaa-healthcareHIPAA医疗保健数据隐私(PHI 保护)
pci-dss-paymentsPCI 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_MODEstrict 或 permissivestrict
AGENTOS_DATA_DIR本地数据目录.agentos
AGENTOS_LOG_LEVELdebug、info、warn、errorinfo
策略模式
模式行为
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。


使用 AgentOS 构建安全的 AI Agent

GitHub · 文档 · 报告问题

由 Agent OS 团队倾力打造 🛡️

评论

支持 Markdown

第一次接触 MCP?

从协议是什么,到在客户端里装上第一个服务,这几条回答覆盖了大多数入门问题。

一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。