Connect an MCP client
The command for Claude Code, the block for any other MCP client, and what each OpenCode configuration hands the model: the fourteen tools, and possibly a shell beside them.
Claude Code, or any other client
The server speaks MCP over standard input and output: the client starts it as a child process. With Claude Code:
claude mcp add --scope user diwall-browser \
-e MCP_DIWALL_BROWSER_PROFILE="$HOME/.config/mcp-server-diwall-browser/profile.json" \
-- "$HOME/mcp-server-diwall-browser/.venv/bin/python" -m mcp_server_diwall_browser
With a package installed, the command is mcp-server-diwall-browser and the
profile is read from its standard place:
claude mcp add --scope user diwall-browser -- mcp-server-diwall-browser
For a clone, the command above applies.
For another client, the usual mcpServers block. The client does not expand
~: this command prints the block with your home directory in the paths, ready
to paste into its configuration:
cat <<EOF
{
"mcpServers": {
"diwall-browser": {
"command": "$HOME/mcp-server-diwall-browser/.venv/bin/python",
"args": ["-m", "mcp_server_diwall_browser"],
"env": {
"MCP_DIWALL_BROWSER_PROFILE": "$HOME/.config/mcp-server-diwall-browser/profile.json"
}
}
}
}
EOF
Adapt ~/mcp-server-diwall-browser to your clone and the profile
path to yours. The variable can go when the profile is at its standard place,
~/.config/mcp-server-diwall-browser/profile.json. The operator ran the Claude
Code command on Debian, and claude mcp list showed the server connected.
Which model gets the tools, and what else
The server gives fourteen tools to the model of the session that starts it. The client decides which model that is, and what it has beside them: a shell, the right to write files. A model with a shell under your account can edit the operator profile and add a site to it (Limits). With OpenCode, version 2.0.29 measured:
| Configuration | What the model gets |
|---|---|
A dedicated primary agent, navigateur (recommended) | the tools in that agent only; its shell and file writes ask for your answer. Every other agent, in every project, has no tool of the server |
The server declared in one project’s opencode.jsonc | the tools for every agent run in that directory, with the permissions it already has, a shell included if the global file allows it |
| The server declared in the global file | the tools in every session of every project and every model, including one that reads a repository that is not yours |
Measured with the first configuration and a model that is not Claude: the
navigateur agent called status and the journal got a line with client set
to opencode; the default agent, asked for the same tool, answered that it had
none, and the journal got no line; a shell command in an agent whose bash is
set to ask was not run in OpenCode’s non-interactive mode. The three blocks of
configuration are in
section 2.1 of the operator guide.
Check: status
Ask the model to call status. It changes nothing in the browser, works even
when nothing is configured, and then says what is missing and the two ways to
provide it. Read:
configured: true, or the path where the profile is expected;- the browser
attached, orbrowser_unreachablewhen no browser answers on the port of the profile; - the encrypted directory
mounted, orclosed_or_absent; confirmation_channel:nativemeans a window can open on your screen. Withnone, every action that needs your confirmation is refused; add your display to theenvblock of the connection, for example"DISPLAY": ":0"(echo $DISPLAYin your desktop session gives the value).
Claude Code started from a desktop terminal passed the display to the server
(status read native); so did OpenCode’s service. The MCP SDK’s own client
starts a server with HOME, LOGNAME, PATH, SHELL, TERM and USER
only. To know the server’s version, read server_version in status: the
version announced when a session opens is the MCP SDK’s.