WASM Sandboxing
MCP tools 在隔离的 WebAssembly 环境中运行,以保障安全。
MCP (Model Context Protocol) 是一个将 AI 模型连接到外部工具和数据源的标准。Greentic 对 MCP 的实现支持:
WASM Sandboxing
MCP tools 在隔离的 WebAssembly 环境中运行,以保障安全。
Tool Discovery
自动完成 tool 注册和能力声明。
Type Safety
WIT interfaces 确保类型安全的 tool 调用。
Observability
内置 tracing 和 logging,用于观察 tool 执行情况。
LLM (with tool use) │ ▼ Tool Call Request┌─────────────────────────────────┐│ greentic-mcp ││ (MCP Executor / WASI Bridge) │└─────────────────────────────────┘ │ ▼┌─────────────────────────────────┐│ WASM Tool Component ││ (Sandboxed execution) │└─────────────────────────────────┘ │ ▼ Tool ResultBack to LLMname: database_querydescription: Query the customer databaseparameters: - name: query type: string description: SQL query to execute required: true - name: limit type: integer description: Maximum rows to return default: 10returns: type: array items: type: object- id: query_orders type: mcp-tool config: tool: "database_query" parameters: query: "SELECT * FROM orders WHERE customer_id = '{{customer_id}}'" limit: 5 output: orders_result next: process_orders- id: agent_step type: llm config: model: "gpt-4" system_prompt: "You are a helpful assistant with database access." tools: - database_query - send_email - create_ticket tool_choice: "auto" next: handle_responseGreentic 提供了多个内置 MCP tools:
| Tool | 描述 |
|---|---|
http_request | 发起 HTTP 请求 |
database_query | 查询数据库 |
file_read | 读取文件(沙箱内) |
file_write | 写入文件(沙箱内) |
send_email | 发送邮件 |
create_ticket | 创建支持工单 |
所有 MCP tools 都在 WASM 沙箱中运行:
tools 需要声明所需能力:
capabilities: - network:outbound # Can make outbound requests - filesystem:read # Can read files in sandbox