Skip to content

MCP Overview

MCP (Model Context Protocol) is a standard for connecting AI models to external tools and data sources. Greentic implements MCP for:

  • Tool execution in sandboxed WASM environment
  • Secure external API access
  • Database queries
  • File system operations

WASM Sandboxing

MCP tools run in isolated WebAssembly environments for security.

Tool Discovery

Automatic tool registration and capability advertisement.

Type Safety

WIT interfaces ensure type-safe tool invocations.

Observability

Built-in tracing and logging for tool executions.

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 provides several built-in MCP tools:

ToolDescription
http_requestMake HTTP requests
database_queryQuery databases
file_readRead files (sandboxed)
file_writeWrite files (sandboxed)
send_emailSend emails
create_ticketCreate support tickets

All MCP tools run in WASM sandboxes:

  • No direct filesystem access
  • No network access unless explicitly granted
  • Memory isolation
  • CPU time limits

Tools declare required capabilities:

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