Skip to content

MCP

OpenMotoko supports the Model Context Protocol in both directions: as a client connecting to external MCP servers, and as a server exposing its own tools.

Connect OpenMotoko to external MCP servers to give the agent access to third-party tools.

Add servers to openmotoko.json under the mcp key:

{
"mcp": {
"servers": [
{
"id": "filesystem",
"name": "Local Files",
"transport": "stdio",
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/home/user/docs"]
},
{
"id": "weather",
"name": "Weather API",
"transport": "http",
"url": "https://mcp.example.com/weather"
}
]
}
}
TransportFieldDescription
stdiocommand, argsSpawns a local process, communicates over stdin/stdout
httpurlConnects to a remote StreamableHTTP endpoint

Pass environment variables to stdio servers:

{
"id": "github",
"transport": "stdio",
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {
"GITHUB_TOKEN": "ghp_..."
}
}

External tools are namespaced as mcp_{serverId}_{toolName} to avoid conflicts. For example, a tool called search from a server with ID docs becomes mcp_docs_search.

Expose OpenMotoko’s tools to other MCP clients.

Set expose: true in the MCP config:

{
"mcp": {
"expose": true
}
}

This starts an MCP server over stdio transport using the @modelcontextprotocol/sdk. All enabled skill tools are registered and available to connecting clients.

  • Connect Claude Desktop or other MCP clients to OpenMotoko
  • Chain multiple AI agents, each accessing the other’s tools
  • Build workflows where one system delegates tasks to OpenMotoko
{
"mcp": {
"servers": [
{
"id": "string (required)",
"name": "string (optional display name)",
"transport": "stdio | http",
"command": "string (stdio only)",
"args": ["string[]", "(stdio only)"],
"url": "string (http only)",
"env": { "KEY": "VALUE" }
}
],
"expose": false
}
}