Zum Inhalt springen
Developer Preview — APIs and language features may change before 1.0

mcp

Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.

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:

SettingScopeDescription
Trust levelCellSystem (local stdio), Authenticated (API key), or Untrusted (no auth)
Rate limitingCellPer-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:

MachineMCP tool name
classify_emailclassify_email
data_pipeline (single chain)data_pipeline
multi_tool with chains search, countmulti_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 boolean

Produces:

{
"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:

  1. Governance permissions from ensures are checked
  2. Inputs are validated against accepts
  3. The machine executes
  4. A SurfaceAccess event is recorded with :mcp surface in the behavioral ledger
  5. 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.

See also

  • expresses - Parent section for all surfaces
  • api - REST API surface
  • a2a - Agent-to-Agent protocol surface