MCP

Connect Model Context Protocol servers to add tools and resources, manage connections, and control tool exposure.

What MCP adds

Jouzu connects to Model Context Protocol (MCP) servers over stdio or streamable HTTP and makes their tools and resources available to the agent. Tools from a server named docs are registered as mcp__docs__<tool>.

Put user-level servers in mcp.json inside your agent/config directory (the agent path in the locations table), or project servers in .pi/mcp.json in the project root. Project configuration is read only after you trust the project. Keep credentials and personal servers in the user-level file.

Configure servers

A streamable HTTP server with a bearer token from the environment:

JSON
{
  "mcpServers": {
    "docs": {
      "url": "https://example.com/mcp",
      "headers": { "Authorization": "Bearer ${DOCS_TOKEN}" },
      "description": "Search the team's documentation"
    }
  }
}

Replace the URL with your server and set DOCS_TOKEN in the environment. A local stdio server uses command, args, and optional env instead of url and headers:

JSON
{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-filesystem", "."]
    }
  }
}

command is one executable, not a shell string; a leading ~/ in command, an argument, or cwd names the home directory. Values in env and headers can use environment variables such as ${GITHUB_TOKEN}. The legacy SSE transport is not supported; servers that document SSE usually offer streamable HTTP at /mcp instead.

FieldPurpose
timeoutPer-request timeout in seconds (default 60). Progress notifications reset it.
enabled: falseKeep the entry without connecting to it.
descriptionOne sentence on what the server offers. It lists the server in the system prompt and ranks its tools in tool search.
exposure, toolExposureControl how the server's tools reach the model; see Tool exposure.

Server names may contain only letters, digits, _, and -. Invalid entries are reported and skipped without preventing other servers from connecting. You can move entries converted from other MCP clients (Claude Desktop, Cursor, VS Code, Codex, OpenCode) under mcpServers with small edits.

Manage connections in a session

Use /mcp to inspect connections, sign in, reconnect, or enable and disable servers. It lists configured servers with their state, tool count, exposure, and configuration source, and servers that need attention appear first. Select a server to inspect its tools and connection details, including the full connection error and the tail of stderr from a failed stdio server.

Jouzu
/mcp

Run /reload after editing the configuration outside the session. Jouzu connects every enabled server in the background when a session starts; a server's tools appear once it connects, and a dropped connection reconnects on the next call.

Exposure and enabled-state changes are saved to the file that defines the server without replacing unrelated content. In a trusted project, "Enable in this project" and "Disable in this project" add a project override for a user-level server.

Tool exposure

By default, server tools are deferred: the agent uses tool_search to find them, then calls the matched tools directly. Jouzu also maps a saved codemode exposure to deferred without rewriting your configuration.

ExposureBehavior
deferred (default)Not declared until tool_search loads a match for the next model call.
directDeclared to the model like a built-in tool.
hiddenRegistered but unreachable.

toolExposure overrides the server exposure per tool. Keys are exact server tool names or patterns where * matches any characters; exact names win over patterns:

JSON
{
  "mcpServers": {
    "github": {
      "url": "https://api.githubcopilot.com/mcp/",
      "exposure": "deferred",
      "toolExposure": {
        "search_code": "direct",
        "get_*": "deferred",
        "delete_*": "hidden"
      }
    }
  }
}

OAuth sign-in

Remote servers that use OAuth, such as Sentry, need no credentials in mcp.json:

JSON
{
  "mcpServers": {
    "sentry": { "url": "https://mcp.sentry.dev/mcp" }
  }
}

When the server rejects an unauthenticated connection, /mcp shows that it needs sign-in. Select "Sign in" or run /mcp login sentry; Jouzu opens the authorization page and waits for approval. If the browser runs on another machine, such as over SSH, paste the redirected URL into the sign-in screen. A running session uses the new credentials on its next turn.

Tokens are stored in the agent configuration directory and refreshed when they expire. For a server without dynamic client registration, configure a registered client with oauth.clientId, optional clientSecret, and a loopback callbackPort or callbackUrl.

Safety and scanning

Local servers run with your user permissions, so review their configuration before connecting. Every MCP call passes through the tool pipeline, so permission gates apply to MCP tools as well.

MCP tool results and resources pass through TextGuard local scanning by default. The default mode (/textguard on) annotates flagged visible content and omits structured metadata; strict mode (/textguard strict) withholds flagged results until you approve them. See Commands for the scanning commands.