WASM Sandboxing
MCP ツールは security のために分離された WebAssembly environment で実行されます。
MCP (Model Context Protocol) は、AI model を external tool や data source に接続するための標準です。Greentic では次の用途で MCP を実装しています。
WASM Sandboxing
MCP ツールは security のために分離された WebAssembly environment で実行されます。
Tool Discovery
自動的なツール登録と capability advertisement を提供します。
Type Safety
WIT interface により type-safe な tool invocation を実現します。
Observability
tool execution のための tracing と logging を標準で備えています。
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 には、いくつかの built-in MCP tool が用意されています。
| Tool | Description |
|---|---|
http_request | HTTP request を実行する |
database_query | database を query する |
file_read | file を読み取る(sandboxed) |
file_write | file に書き込む(sandboxed) |
send_email | email を送信する |
create_ticket | support ticket を作成する |
すべての MCP tool は WASM sandbox で実行されます。
ツールは必要な capability を宣言します。
capabilities: - network:outbound # Can make outbound requests - filesystem:read # Can read files in sandbox