Skip to content

MCP Client

Wayland Core is an MCP client. It connects to any Model Context Protocol server and registers that server’s tools alongside the built-in eight, so the model can call them the same way it calls Read or Bash. You declare servers in the config file.

Each server is a [mcp.servers.*] table. Pick a transport and supply the connection details:

# stdio: launch a local subprocess
[mcp.servers.filesystem]
transport = "stdio"
command = "npx"
args = ["-y", "@modelcontextprotocol/server-filesystem", "/Users/me/project"]
# stdio with an environment variable
[mcp.servers.github]
transport = "stdio"
command = "npx"
args = ["-y", "@modelcontextprotocol/server-github"]
env = { GITHUB_TOKEN = "ghp_xxx" }
# SSE: connect to a remote event-stream server
[mcp.servers.database]
transport = "sse"
url = "http://localhost:3001/sse"
# streamable HTTP: POST with optional headers
[mcp.servers.remote-tools]
transport = "streamable-http"
url = "https://tools.example.com/mcp"
headers = { Authorization = "Bearer xxx" }
TransportHow it connectsUse case
stdioLaunches a local subprocess, speaks over stdin and stdout.Local servers run with npx or uvx.
sseGET for the event stream, POST for requests.Remote servers.
streamable-httpHTTP POST, with SSE for streaming responses.Remote servers.

Config-file MCP servers are deferred by default: their schemas are not loaded into the system prompt at startup, only the tool names are registered, and the model loads a schema on demand with ToolSearch. This keeps the prompt small when a server exposes many tools.

To send a server’s full schemas from the first turn instead, set deferred = false:

[mcp.servers.small-toolset]
transport = "stdio"
command = "npx"
args = ["-y", "my-mcp-server"]
deferred = false

MCP tool names are used directly when there is no conflict. When a name collides with a built-in tool or another server’s tool, the engine auto-prefixes it as mcp__{server}__{tool}.

On launch the engine connects to every configured server, runs the MCP initialize handshake, calls tools/list to discover tools, registers them, and closes all connections cleanly on exit.