Skip to content
docs

MCP

MCP (Model Context Protocol) connects tools from external servers to the agent. The agent sees the create_issue tool of the github server as mcp__github__create_issue and calls it the same way as its built-in tools: through the same permission checks and hooks, and every call is written to the audit log. The text of a server’s response is marked as external data, the same as the content of a fetched web page.

Transports:

  • stdio: the agent starts the server as a process and talks to it over stdin and stdout;
  • http: Streamable HTTP;
  • sse: the older HTTP+SSE transport, where the server sends an event stream over GET and names the address for POST in it. The scheme, host, and port of that address must match url. An http entry whose server answers the first request with 400, 404, or 405 switches to this transport on its own.

HTTP redirects are followed only when the scheme, host, and port match; headers and the token are never sent to a different address.

Add a server in /mcp, on the extensions page in the browser, with waibee mcp add, or by editing a settings file.

~/.waibee/settings.json
{
"mcp": {
"servers": {
"github": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": { "GITHUB_PERSONAL_ACCESS_TOKEN": "${GITHUB_TOKEN}" },
"permission_level": "read_only",
"disabled_tools": ["create_issue"]
},
"docs": {
"type": "http",
"url": "https://mcp.example.com",
"headers": { "Authorization": "Bearer ${DOCS_TOKEN}" }
}
}
}
}
FieldValue
typestdio, http, or sse; streamable-http means the same as http. Without the field, an entry with url is read as http, and any other entry as stdio. An unknown value is read as stdio
command, args, envthe launch command, its arguments, and environment variables, for stdio
url, headersthe address and headers, for http and sse
auth{"type": "oauth"} to sign in with OAuth. See OAuth. You can add scopes, client_id, callback_port, redirect_uri
timeout_mshow long to wait for a response to a tool call, in milliseconds; 0 removes the limit. Without the field, see Call timeout
disabledtrue turns the server off: it does not start, and the model does not see its tools
disabled_toolsnames of the server’s tools that the model does not see and cannot call
permission_levelread_only, edit, execute (default), or dangerous. See Permissions

${VAR} and ${VAR:-default} are expanded in command, args, env, url, and headers on connection, from the environment the agent runs in. A variable with no value and no fallback stays in the string as is.

Do not write a secret into the file; write a reference to a variable. .mcp.json lives in the repository, and a key written there goes out to the whole team.

An entry in Claude Code format is read as is, including the "oauth": {"clientId": "...", "callbackPort": 8765} block: it means the same as client_id and callback_port in auth.

The time to wait for a tool call’s response comes from the first of these that is set:

  1. timeout_ms in the server entry;
  2. the mcp.default_timeout_ms key next to servers: a shared timeout in milliseconds for every server without its own timeout_ms;
  3. the WAIBEE_MCP_TOOL_TIMEOUT_SECS environment variable, in seconds;
  4. 300000 ms, which is five minutes.

At any level, 0 removes the limit. A call that does not respond in time ends with an error.

~/.waibee/settings.json
{
"mcp": {
"default_timeout_ms": 600000,
"servers": { }
}
}

Servers are read from the mcpServers or mcp.servers key in each of these files. If a name appears twice, the entry from the file lower in the list wins:

  1. ~/.claude/settings.json
  2. ~/.waibee/settings.json (on Windows, %APPDATA%\waibee\settings.json)
  3. the project’s .mcp.json
  4. the project’s .claude/settings.json, then .waibee/settings.json
  5. the project’s .claude/settings.local.json, then .waibee/settings.local.json
  6. the organization’s managed file. See Configuration

Claude Code servers from ~/.claude.json are not read. Move them to ~/.waibee/settings.json or add them with waibee mcp add.

Project files are taken only from the directory the agent was started in. Parent directories are not searched, so a session opened in a subfolder of a repository does not see the .mcp.json at its root. waibee doctor prints every candidate file marked read, missing, or untrusted in the “Where servers are read from” check. After you change directory (/cd), and when you switch to a tab with a different directory, the TUI connects the servers from that directory’s files.

Servers from project files start only in a folder you trust. See Folder trust. Global files do not depend on trust.

Servers of enabled plugins are added under the name plugin_<plugin>_<server>. Only the plugin can change their entry: such a server shows up in /mcp but cannot be edited there. Do not edit files in an installed plugin’s directory; an update overwrites them. Such a server is turned off together with its plugin. See Plugins.

The /mcp overlay in the TUI shows the servers, their status, and their tools, and it is also where you add, change, and remove a server.

KeyAction
aAdd a server: a three-step wizard (name and scope, transport, address)
eChange the selected server with the same wizard
EOpen the settings file in an external editor
SpaceTurn the server on or off
EnterExpand the server’s tools. There, Space turns an individual tool on or off
dDelete the entry, with confirmation
lSign in with OAuth
oSign out of OAuth
Esc, qBack, from tools to servers, then close

The wizard asks for a scope: global (~/.waibee/settings.json), the repository (.mcp.json), or personal for the project (.waibee/settings.local.json). Editing a server and turning a server or tool off are written to the scope’s standard file. If the entry came from another file, edit it there by hand: it may override your changes.

The last step of the wizard sets up OAuth sign-in and KEY=VALUE pairs: environment variables for stdio, headers for http and sse.

On the extensions page in the browser, the form connects to the server first and saves the entry only if the server responds. The exception is a server with OAuth enabled that asks you to sign in: it is saved without the check, and you sign in on the same page.

/reload picks up an edit to a file on disk: it connects new servers and reconnects changed ones.

Terminal window
waibee mcp add <name> <url> # remote server, http
waibee mcp add <name> -- <command> [args] # local server, stdio
waibee mcp add-json <name> '<entry>' # entry in .mcp.json format
waibee mcp list [--json] # servers and the file of each; without --json, also sign-in status
waibee mcp get <name> [--json] # one server
waibee mcp login <name> # OAuth sign-in, --no-browser for an SSH session
waibee mcp logout <name> # forget the token
waibee mcp remove <name> [-s <scope>]

Examples:

Terminal window
# stdio: everything after -- goes to the command, including its own flags
waibee mcp add github -e 'GITHUB_PERSONAL_ACCESS_TOKEN=${GITHUB_TOKEN}' \
-- npx -y @modelcontextprotocol/server-github
# http: address and headers
waibee mcp add docs https://mcp.example.com -H 'Authorization: Bearer ${DOCS_TOKEN}'
# server with OAuth: sign in as a separate step
waibee mcp add tracker https://mcp.example.com/mcp --oauth
waibee mcp login tracker

Flags of add:

FlagWhat it sets
-s, --scopeThe file the entry is written to: user (default) for ~/.waibee/settings.json, project for .mcp.json, local for .waibee/settings.local.json.
-t, --transportstdio, http, or sse. Without the flag, an address means http and a command means stdio. --type means the same as --transport
-e, --env KEY=VALUEAn environment variable for stdio
-H, --header 'Name: value'A header for http and sse. The form Name=value is also accepted
--url, --command, --argThe address, the command, and its arguments as flags, instead of the form after the name
--oauthOAuth sign-in, only for http and sse
--client-id, --client-secret, --callback-portA client the provider issued in advance. See Pre-registered client

A name starts with a letter or digit and consists of Latin letters, digits, and the characters .-_. At the end, add prints the path of the file it wrote to.

--arg, --env, and --header can be repeated. A variable is split at the first =, and a header at the first : or =, so the remaining characters stay in the value: --env 'URL=https://host/?a=b' writes the whole address. The quotes are needed: without them, the shell expands the variable itself, and the secret ends up in the file.

Only stdio has environment variables, and only http and sse have headers. The command rejects a mismatched flag and writes nothing. An address together with a command is also rejected: a server has one or the other.

waibee mcp add-json takes a server entry in the form it has in .mcp.json, validates it, and writes it as is, so fields that add has no flags for are kept. The same -s flag as in add chooses the file, user by default. The client secret from the entry (auth.client_secret, or oauth.clientSecret as in Claude Code) does not go into the file; it goes to the secret store:

Terminal window
waibee mcp add-json docs '{"type":"http","url":"https://mcp.example.com","timeout_ms":600000}'

waibee mcp list shows, under each server, the file it was read from and its OAuth sign-in: until when it is valid, or that it has expired, with the command to sign in again.

waibee mcp list --json and waibee mcp get keep ${VAR} references but replace literal values with •••: the values of environment variables (NAME=VALUE), headers, and recognized secret flags, and arguments like GITHUB_TOKEN=… or Authorization: …. In a URL, the password or a lone token before @ and the parameter values after ? are hidden; fields with tokens and the OAuth secret are not printed. The URL path and ordinary arguments stay visible, so check the output before you share it. In JSON, a server has name, type, the address or the command with arguments, env or headers, the scope, and the file.

waibee mcp remove <name> and the d key in /mcp remove the entry from the standard file of the active server’s scope. -s chooses the scope to remove from. Entries with the same name in other files stay; if the standard file has no entry, the command names the source file so you can remove it by hand.

waibee mcp login <name> (or l in /mcp) opens a browser to sign in to an http or sse server. Sign-in to a server that does not publish OAuth metadata is rejected. The token is saved on disk and refreshes on its own. The auth field is not required for this: the saved token is used on every connection, and the Authorization header from headers is then not sent. If auth is set and there is no token yet, the server does not connect and asks you to run waibee mcp login. Sign-in has a time limit: if you miss it, run waibee mcp login again.

A token is bound to the address it was obtained for. A server with the same name at a different address, for example one added again or declared in the project’s .mcp.json, does not get the token and asks for its own sign-in.

In an SSH session, a browser does not open on that machine. waibee mcp login <name> --no-browser prints the sign-in address: open it in a browser on your computer and sign in. At the end, the browser goes to an address like http://127.0.0.1:<port>/callback?code=...&state=..., and the page does not load, because the remote machine is the one waiting for the response. Copy the address from the browser’s address bar and paste it into the terminal. Only the callback address of this sign-in is accepted, in full, with the code and state parameters.

Usually Waibee Code registers itself on the server as a new client. Some servers admit only clients the provider has approved. If the provider issued you a client ID, pass it when you add the server:

Terminal window
waibee mcp add docs https://mcp.example.com/mcp \
--client-id <client-id> --callback-port 8765 --client-secret
waibee mcp login docs
  • --client-id: sign-in goes as this client, and registration is skipped.
  • --callback-port: a fixed port for the callback address, if the client is registered with one. Without the flag, a free port is chosen.
  • --client-secret: the client has a secret. The flag takes no value: the secret comes from the MCP_CLIENT_SECRET variable, and if it is not set, the command asks for it in the terminal. It works only together with --client-id. add-json has the same flag; the client ID must then be in the entry itself.

The secret does not go into the settings file: it is kept in the system keychain, or, if that is unavailable, in the data directory. The secret is bound to the server name and the client ID, but not to the URL: if the address changes with the same pair, the secret is kept. The secret is deleted together with the server, but while the same server with the same client is recorded in another scope, the secret stays.

  • The server has no sign-in. waibee mcp login replies that no sign-in is needed, and /reload connects the server.
  • The server does not register the client. The response says the server refused to register Waibee Code as a client: some servers admit only approved ones. If the provider issues client IDs, a pre-registered client helps.

permission_level sets the level of all the server’s tools. Whether a call asks for approval depends on the level and the mode:

LevelAsks
read_onlynever
editin default
execute (default)in default and acceptEdits
dangerousin every mode except bypassPermissions

A rule in permissions.allow that matches the tool name ("^mcp__github__") skips the approval for edit and execute, but not for dangerous. A rule in permissions.deny forbids the tool in every mode. See Denying a tool. In headless mode, a call that would need approval is rejected. See Headless.

Tools from disabled_tools and from a disabled server do not appear in the list the model sees. If you turn off a tool or server during a session, it can no longer be called, but the description the model received earlier stays in its requests until a new session.

A permissions.deny rule with a plain name, such as mcp__github__create_issue, or mcp__github__* for the whole server, also removes the tool from the list when the session starts. A rule with a regular expression (^mcp__github__) leaves the tool in the list, and the call is refused when the model makes it. See Denying a tool.

The sandbox does not apply to MCP servers: a stdio server runs with your permissions, with no restrictions on writing.

Calls to read_only tools from one model response run in parallel, including calls to the same server; the rest run one at a time in the order of the response. There is no setting for the number of concurrent calls. For how long to wait for a response, see Call timeout.

A subagent uses the main agent’s connections. The mcpServers field in its definition sets servers of its own that start only for it. See Subagents.

The tool set the model sees is assembled on the first request of a session and does not change until the session ends. Tools of MCP servers connected by that point go into it directly, as long as their descriptions together take up little space. If there are many descriptions, or a server connected later, for example after /reload, the agent gets a list of such tools in the conversation: the name and purpose of each. To call a tool from this list, the model first loads its description with the ToolSearch tool, then calls it through CallTool.

A call through CallTool goes under the tool’s own name: the same permissions, permission_level, hooks, and audit log as a direct call, and the interface shows it as a call to that tool.

The agent reads resources on its own: ListMcpResources shows the servers’ resources, and ReadMcpResource reads one by server and uri. Text arrives as untrusted content with the same size limit as a tool result; images are passed to the model, and other binary data is named by address and type. Both tools work at the read_only level, or at the server’s permission_level if one is set explicitly.

Each server prompt becomes a /mcp__<server>__<prompt> command in the terminal, the browser, the IDE, and waibee run. Arguments are separated by spaces, in the order the server declared them. The prompt’s messages go to the agent as your prompt. If a required argument is missing, an extra one is passed, the server responds with an error, or the prompt text is larger than 50 KB, no request goes to the model and the run ends with an error; waibee run exits with code 1.

Registries and catalogs of MCP servers, the difference between official and third-party ones, and what to check before installing are in Finding extensions. Common combinations are collected in Recommended extensions.