mcp
이 콘텐츠는 아직 해당 언어로 제공되지 않습니다.
MCP (Model Context Protocol) is mashin’s implicit surface. Every machine is automatically available as an MCP tool with zero configuration. When you write a machine and start the MCP server, AI assistants like Claude, Cursor, ChatGPT, and VS Code can discover and call it.
No expresses declaration is required for MCP. It is always on.
Overview
MCP is the default way machines are consumed. The mashin MCP server implements the Model Context Protocol over stdio (JSON-RPC 2.0). It exposes every machine in the current cell as a callable tool, with input schemas derived from accepts and output schemas from responds with.
Because MCP is implicit, the expresses section is only needed when you want surfaces beyond MCP, such as REST APIs, webhooks, or web pages.
Syntax
MCP requires no syntax. Every machine is MCP-accessible by default:
machine classify_email
accepts subject as text, is required body as text, is required
responds with category as text priority as text
implements ask classify, using: "anthropic:claude-sonnet-4-6" with task "Classify this email by category and priority" returns category as text priority as text assuming category: "general" priority: "normal"Start the server with mashin mcp. The machine appears as a tool named classify_email.
Configuration options
MCP has no per-machine configuration. It is controlled at the cell level:
| Setting | Scope | Description |
|---|---|---|
| Trust level | Cell | System (local stdio), Authenticated (API key), or Untrusted (no auth) |
| Rate limiting | Cell | Per-organization, per-minute request limits |
Local connections from mashin mcp run at system trust. Remote MCP endpoints require authentication.
Tool naming
MCP tools are named after the machine. Multi-chain machines expose one tool per chain:
| Machine | MCP tool name |
|---|---|
classify_email | classify_email |
data_pipeline (single chain) | data_pipeline |
multi_tool with chains search, count | multi_tool/search, multi_tool/count |
Input schema generation
The accepts section maps directly to the MCP tool’s JSON Schema:
accepts query as text, is required max_results as number include_archived as booleanProduces:
{ "type": "object", "properties": { "query": {"type": "string"}, "max_results": {"type": "number"}, "include_archived": {"type": "boolean"} }, "required": ["query"]}Governance
Every tools/call invocation goes through the full governance pipeline:
- Governance permissions from
ensuresare checked - Inputs are validated against
accepts - The machine executes
- A
SurfaceAccessevent is recorded with:mcpsurface in the behavioral ledger - Budget limits are enforced
Denied calls return a structured error. The governance decision and reason are recorded in the ledger regardless of outcome.
Example
Connecting to Claude Desktop:
{ "mcpServers": { "mashin": { "command": "mashin", "args": ["mcp"] } }}After restarting Claude Desktop, all machines in your cell appear as tools. Ask Claude to classify an email and it calls the classify_email tool, which runs through governance, executes, and returns the result.