Lewati ke konten

Ringkasan MCP

MCP (Model Context Protocol) adalah standar untuk menghubungkan model AI ke tool dan sumber data eksternal. Greentic mengimplementasikan MCP untuk:

  • Eksekusi tool di lingkungan WASM yang ter-sandbox
  • Akses API eksternal yang aman
  • Query database
  • Operasi file system

Sandboxing WASM

Tool MCP berjalan di lingkungan WebAssembly yang terisolasi untuk keamanan.

Penemuan Tool

Pendaftaran tool otomatis dan iklan kapabilitas.

Keamanan Tipe

Antarmuka WIT memastikan pemanggilan tool yang type-safe.

Observabilitas

Tracing dan logging bawaan untuk eksekusi tool.

LLM (with tool use)
▼ Tool Call Request
┌─────────────────────────────────┐
│ greentic-mcp │
│ (MCP Executor / WASI Bridge) │
└─────────────────────────────────┘
┌─────────────────────────────────┐
│ WASM Tool Component │
│ (Sandboxed execution) │
└─────────────────────────────────┘
▼ Tool Result
Back to LLM
tools/database-query.yaml
name: database_query
description: Query the customer database
parameters:
- name: query
type: string
description: SQL query to execute
required: true
- name: limit
type: integer
description: Maximum rows to return
default: 10
returns:
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_response

Greentic menyediakan beberapa tool MCP bawaan:

ToolDeskripsi
http_requestMembuat request HTTP
database_queryMenjalankan query database
file_readMembaca file (sandboxed)
file_writeMenulis file (sandboxed)
send_emailMengirim email
create_ticketMembuat support ticket

Semua tool MCP berjalan di sandbox WASM:

  • Tidak ada akses file system langsung
  • Tidak ada akses jaringan kecuali diberikan secara eksplisit
  • Isolasi memori
  • Batas waktu CPU

Tool mendeklarasikan kapabilitas yang dibutuhkan:

capabilities:
- network:outbound # Can make outbound requests
- filesystem:read # Can read files in sandbox