Guides
Connect an MCP server
Add an MCP server's tools to your catalog and check they work.
Add a server to config.toml and its tools join your catalog as <name>__<tool>, ready for agents and plan steps.
Before you start
You need the server's launch command or its URL. If it needs a token, put the token in an environment variable rather than in the file.
Add the server
Add an [mcp.<name>] table
The table name becomes the prefix of every tool from the server. Use command for a server Dive starts itself over stdio, or url for a streamable HTTP server.
[mcp.everything]
description = "MCP reference server for testing"
command = "npx"
args = ["-y", "@modelcontextprotocol/server-everything"]description is optional, but setting it generally improves how well the planner chooses the server's tools. Values in env and headers expand ${VAR} from your environment. If a variable isn't set, Dive doesn't connect to that server and names the missing variable.
Test the connection
dive mcp test everythingok: 'everything' initialized in 1.37s — 13 tools (1 declare output schemas)Sign in to a server that uses OAuth
Many hosted servers ask you to sign in instead of handing out a token. Add them with just a url; when one answers that it needs a sign-in, dive mcp test and any tool call say so:
mcp server 'linear' needs sign-in: run `dive mcp login linear`Sign in from your browser:
dive mcp login linearDive opens the server's sign-in page, registers itself with the server's authorization server, and waits up to 5 minutes for you to approve. If no browser opens, visit the address it prints. When you approve, the browser returns to a temporary address on 127.0.0.1, and Dive saves the sign-in in the OS credential store, the same place dive secret set uses. It refreshes on its own; you sign in again only if the server stops accepting it.
Sign-ins follow projects the way secrets do:
- A server defined in a project's
.dive/config.tomlsigns in for that project. One defined in the global config signs in for every project. --projectsigns a globally defined server in for this project alone, for example to use a different account here. That project's sign-in is used instead of the global one.- No project ever sees another project's sign-in.
dive mcp list shows which sign-in each server uses. dive mcp logout linear removes the one this project uses: its own if it has one, which falls back to the global sign-in, else the global one, which signs out every project that shares it.
A server whose headers set Authorization keeps using that header and never signs in.
Servers that need an OAuth app
Dive gets a client ID one of two ways. If the authorization server lets apps register themselves, Dive registers. If it accepts a URL as the client ID instead, Dive uses https://loon.rocks/dive/oauth-client.json, which describes Dive and its http://127.0.0.1/callback redirect. Either way there's nothing to set up.
Some authorization servers, GitHub's among them, do neither. Signing in to one stops with:
github doesn't let apps register themselves: create an OAuth app with the callback URL http://127.0.0.1/callback, then add its client_id and client_secret under [mcp.github.oauth]Create an OAuth app in the provider's developer settings with the callback URL http://127.0.0.1/callback. Dive picks a free port each time it signs in, and providers that follow the loopback rules for native apps accept any port on that address. Then give Dive the app's details, keeping the secret out of the file:
[mcp.github]
url = "https://api.githubcopilot.com/mcp/"
[mcp.github.oauth]
client_id = "Ov23liAbC9xYz12345"
client_secret = "${GITHUB_OAUTH_SECRET}"
scopes = ["repo", "read:org"]dive secret set GITHUB_OAUTH_SECRET
dive mcp login githubscopes is optional. Without it, Dive asks for everything the server lists.
When an agent hits a server that needs sign-in
A tool call to a server that isn't signed in fails with the same message, and its result names the server under needs_sign_in, which the agent sees and a front end can act on:
{"error": "mcp server 'linear' needs sign-in: run `dive mcp login linear`", "needs_sign_in": "linear"}Check it worked
List the server's tools, then call one through Dive:
dive mcp tools everything
dive tool test everything__echo --input message=hello{
"text": "Echo: hello"
}Dive returns a tool's structured content when the server sends it. Otherwise it parses the text the tool returns as JSON, or wraps plain text as {"text": ...}, as here.
To load only some of a server's tools, or fix a tool's description, see Filter and override a server's tools. If the server won't connect, see Test an MCP server.
Related config.toml options
MCP servers, as [mcp.<name>]. Their tools join the catalog as <name>__<tool>.
What the server is for, read by drafters choosing tools.
Executable for a stdio server. Use command or url, not both.
Arguments for command.
Environment for a stdio server. Values expand ${NAME} references.
Endpoint for a streamable HTTP server.
HTTP headers. Values expand ${NAME} references.
Load only these tools.
Skip these tools.
How a file reference (blob:sha256-…) in a tool call's arguments reaches the server: path as a local file path, url as a link the server can fetch, base64 as the file's contents, off as the reference text unchanged.
Available options: path, url, base64, off
The OAuth app Dive signs in with, as [mcp.<name>.oauth], for servers whose authorization server doesn't let apps register themselves. Register the app with the callback URL http://127.0.0.1/callback.
The app's client ID.
The app's client secret. Keep it out of the file with a ${NAME} reference.
The access to ask for. Without it, Dive asks for what the server lists.
Per-tool corrections, as [mcp.<name>.tool_overrides.<tool>].
Replaces the server's description of the tool.
The tool's output shape.
An example of the tool's output.