MCP servers
Connect an MCP server once, in Settings › MCP Servers, and every coding agent you start in Next Term can use it: Claude Code, Codex, Gemini CLI, Qwen Code, OpenCode and the rest. You don’t set it up for each agent, or for each session. Any key the server needs stays in Secrets, never in a file. A server that asks you to sign in gets Sign In…, and Next Term keeps it signed in for every agent.
Nothing changes until you add your first server. Until then there is no file, and agents see Next Term exactly as before.
Add a server
Section titled “Add a server”Open Settings › MCP Servers, or choose Agents › MCP Servers…, then one of these.
- Add Server… asks for a Name, what it Runs (a Command, such as
npx -y @modelcontextprotocol/server-github, or a URL), a Key, and where it Applies to. The key is one stored in Secrets, or New Key… to type or paste one now. A command gets the key in its environment, under the variable you give in Passed as. A URL gets it as anAuthorization: Bearerheader, which Next Term fills in. A URL with no key is asked once, when you stop typing it: when the server asks for a sign-in, the sheet says so and its button becomes Sign In… (see Servers that ask you to sign in). - Paste a Config… takes the snippet from a server’s README. It reads the common shapes: an
mcpServersblock, VS Code’sservers, OpenCode’smcp, the servers alone, or one server on its own. Comments, trailing commas and a Markdown fence around it are fine. Each server shows with its name and the command it runs, and each key it found with the name it’s saved under in Secrets. Add asks once before it copies the keys into Secrets, then adds every server.
A name is lowercase letters, digits and - between them, at most 32 characters. next-term is Next Term’s own.
Keys stay in Secrets
Section titled “Keys stay in Secrets”A value that looks like a key is never saved in the list. Paste a Config… takes it out and moves it into Secrets. Elsewhere it is refused, with where it goes instead:
- A command starts with
nxtrm secret run NAME --in front, so the key reaches only that server’s environment. See Keys for MCP servers. - A URL or a header names the key as
${secret:NAME}. Only Next Term fills it in, when it sends the request. It works only in a URL or a header, never in a command.
A URL is https://, or http:// to this Mac or to a Tailscale name (see Servers in your own network). A user name or password in the URL is refused: move it to Secrets and send it in a header.
Servers at a URL
Section titled “Servers at a URL”Next Term reaches a server at a URL itself, for every agent. It speaks MCP’s Streamable HTTP, the transport most servers offer now.
- The key stays with Next Term. It fills each
${secret:NAME}in the URL or headers when it sends the request. The agent never sees the key. - You approve the key in Secrets’ panel, which names the server and its URL. For this session, in Remember, lets that agent session use it again without asking. See Approving a use.
- It can be allowed always, the safest case, since the agent never sees the key: Always in a project, a worktree or a folder, for that agent and this server (Allow always). An agent that reaches a server through a bridge such as
npx mcp-remote https://…gets Use as an MCP Server… in the panel, which adds the server here so Next Term sends the key itself. - One connection a server, shared by every agent that uses it.
- The internet, your own network, or this Mac. See Servers in your own network for what is reached and what is refused. Next Term checks again against the address it connected to, and follows no redirect to another server.
- A refused key. When a server answers 401 or 403 to a key, the agent is told to ask you to check the server’s key in Settings › MCP Servers. A server that asks for a sign-in instead shows Needs sign-in.
- Older servers. A server that speaks only the older HTTP+SSE transport shows Not reached (SSE). Most of them also answer at a Streamable HTTP URL, often ending in
/mcp: use that one. - Limits are a local server’s: 30 seconds to connect, 50 for a call.
Servers in your own network
Section titled “Servers in your own network”A server at a URL can be on the internet, on this Mac, or in your own network. Use https with your own domain, a Cloudflare Tunnel, or a Tailscale name (machine.tailnet.ts.net).
- https with a domain name may resolve to public addresses or to private ones, in your own network. The Mac’s own certificate check, which Next Term never skips, makes sure the server is the one the name says, so a key never reaches another machine on a name’s say.
- A Cloudflare Tunnel works as any https server does.
- Cloudflare Access in front of a server takes a service token’s two headers,
CF-Access-Client-IdandCF-Access-Client-Secret, each a key from Secrets. Paste a Config… takes both and moves them into Secrets, each named for its header. An Access login page is never followed: the agent is told it is behind Cloudflare Access, and to ask you to add the two headers. - Tailscale: https, or http to a
*.ts.netname whose every address is one of Tailscale’s. Tailscale encrypts that traffic itself. - This Mac:
localhost, over http or https, when the name resolves only to this Mac.
Refused, with a sentence that says why:
- Plain http to any other machine.
- A private IP address written in the URL, such as
https://192.168.1.20/mcp. No certificate can be checked for it. Use the server’s own domain over https instead. - Link-local and reserved addresses, such as
169.254.169.254, where cloud metadata lives. They are never a server’s, by name or by address. - A name that resolves to this Mac but isn’t
localhost. For a server on this Mac, uselocalhost.
Servers that ask you to sign in
Section titled “Servers that ask you to sign in”Some servers at a URL ask you to sign in (OAuth) instead of taking a key. Next Term signs in for you, once, and keeps the server signed in for every agent. No agent signs in, starts a sign-in or sees a token.
Sign in
Section titled “Sign in”- Add the server by its URL, with no key. Once you stop typing, Next Term asks the server once. When it asks for a sign-in, the Key row says “linear asks you to sign in. Next Term keeps you signed in for every agent.”, and Sign In… takes the place of Add. Use a key instead goes back to a key. For a server already in your list, select it and click Sign In… under the table.
- The first sign-in asks for Touch ID (or your password), to make the key that seals your sign-ins in Secrets.
- Your own browser opens at the server’s sign-in page, never a page inside Next Term, so your passwords, passkeys and existing sessions work as usual. Settings says “Finish signing in to linear in your browser (mcp.linear.app).”, and Cancel Sign-In stops it. A sign-in waits 10 minutes at most.
- The browser comes back to this Mac. Next Term listens once, on
127.0.0.1only, for this one sign-in’s answer. Anything else that reaches it is turned away. It registers itself with bothhttp://127.0.0.1/callbackand the port it listens on, and listens on that port again next time, so a server that holds a sign-in to its exact port works too. The page says “Signed in to linear. You can close this tab and go back to Next Term.” - The server is added, signed in.
Next Term registers itself with the server as an app named “Next Term” (dynamic client registration), once for each sign-in server. A server that doesn’t let apps register themselves, such as GitHub’s or Slack’s, takes your own OAuth app instead, or a key in a header, such as a personal access token.
Your own OAuth app
Section titled “Your own OAuth app”Some servers, such as GitHub’s and Slack’s, don’t let apps register themselves. Make an OAuth app at the provider, and Next Term signs in with it.
- When the sheet shows it. When the server can’t register Next Term, the sheet says “github asks you to sign in, and doesn’t let apps register themselves: sign in with your own OAuth app.”, and the Client ID and Secret rows open by themselves. For another server that asks you to sign in, or when you edit one, Use your own OAuth app opens them. Sign In… in Settings does the same for a server already in your list: when it can’t register Next Term, it opens that server’s sheet with these rows open, the client ID to type, and Sign In… as its one button, which saves the app once you’re signed in.
- Client ID is kept in the server’s entry, as
nextTerm.oauth. It isn’t a secret. - Secret is a key in Secrets: pick one, or choose New Key… and paste it, under a name such as
GITHUB_OAUTH_CLIENT_SECRET. The entry names the key and never holds its value. GitHub needs the secret. An app that has none can leave it at None. - The callback URL. A line under the rows says what to register at the provider:
http://127.0.0.1/callback. For GitHub it reads “In GitHub › Settings › Developer settings › OAuth Apps, set the app’s Authorization callback URL tohttp://127.0.0.1/callback. GitHub takes it on any port, so it works as written.” Next Term listens on a port of its own each time, and GitHub accepts any port on a loopback callback URL (see GitHub’s loopback redirect URLs). - Callback, for a provider that holds the callback to its port. Slack does: give the exact callback URL your app registers, and Next Term listens at that port when you sign in. For Slack the field fills in
http://localhost:47819/callback, and the line under it reads “In your Slack app (api.slack.com/apps) › OAuth & Permissions, addhttp://localhost:47819/callbackunder Redirect URLs, exactly as written.” Left empty, the callback ishttp://127.0.0.1/callbackon any port. If another program is using the port, the sign-in says so. - Then choose Sign In… The sign-in goes as above, and every agent in Next Term uses that one sign-in.
Where the secret goes, and how it is kept:
- Only to the server’s own sign-in service. The secret is sent only to the sign-in server’s own address: the same scheme, host and port. When its token address is anywhere else, Next Term doesn’t send the secret, and says so. Ending a sign-in at an address elsewhere sends the client ID alone.
- The app stays with its sign-in server. Once an app has signed in at one sign-in server, Next Term won’t send its secret to another. If the server moves its sign-in, Next Term asks for an app made at the new one.
- Sealed for refreshes. At sign-in, Next Term reads the secret from Secrets and keeps a sealed copy with your sign-ins, so a refresh needs no Touch ID. Each client ID keeps its own, so two servers with two apps at one provider each stay signed in.
- When the provider refuses it, Settings says “github refused the client ID or secret. Check them in Settings › MCP Servers › Edit…”, or, for the callback, “github refused Next Term’s sign-in address. Set your OAuth app’s callback URL to
http://127.0.0.1/callback.”
Each agent asks once
Section titled “Each agent asks once”The first time each kind of agent uses a signed-in server, Next Term asks on the Mac, with Allow and Don’t Allow. The panel names that server and every other sign-in the agent isn’t allowed yet, for example “Codex wants to use your sign-ins to linear, notion and slack”, so an agent asks once, not once for each server. Allow covers each one named, and is kept, so that agent isn’t asked again for them, in any project where they apply. Don’t Allow refuses the server it needed then, until Next Term quits; the others are asked about when it needs them. Settings shows who is allowed (“Used by Claude Code, Codex”), and Change… takes an agent off the list, so it is asked again. An agent running in another terminal can use a sign-in too: the panel says “Claude Code outside Next Term wants to use your sign-ins to …”, and Allow lasts only while that agent runs, is never saved, and is asked again for its next session. A program that isn’t a coding agent, such as a shell running nxtrm mcp by hand, can’t use a sign-in. Agents see each server’s state too: mcp_servers says when one needs a sign-in or a reconnect, before an agent calls it.
Kept signed in
Section titled “Kept signed in”- One refresh for every agent. Next Term is the server’s one app and its one refresher. When the sign-in needs a new token, one refresh serves every agent waiting for it, and a refresh token is never sent twice. Nothing refreshes on a timer: only when an agent needs the server.
- Touch ID once a launch. The first time an agent uses a signed-in server after Next Term opens, Touch ID unlocks your sign-ins. They stay unlocked until Next Term quits, the Mac locking included, so an agent working overnight stays signed in. A launch that never uses a signed-in server asks nothing.
- A key wins. A server given its own
Authorizationheader uses that key, and no sign-in is added to it.
When a server needs you
Section titled “When a server needs you”A server can end a sign-in, ask for more access than it gave, stop answering, or fail to start. When an agent needs it then:
- A bar at the foot of that window says so in one line, such as “linear signed out. Claude Code is waiting to use it.”, with one button that mends it: Sign In, Reconnect, Allow More Access, Retry Now or Open MCP Servers…. Reconnect signs in in your browser, the bar showing its progress, then that the server is connected.
- Only where it matters. The bar shows in the window whose agent asked, never at launch, and never for a server no agent used. It takes no keyboard, so Return still goes to the terminal. Several servers share one bar.
- Not Now hides it for that server until it needs something else.
- A server out of reach is tried again on its own while Next Term is open, waiting a little longer each time (15 seconds up to 10 minutes), and at once when your Mac wakes or the network comes back. The bar says so, and goes once the server is back. Servers that need a key from Secrets or your sign-in are left for you.
- Settings shows it too, as Signed out or Needs more access, with Reconnect… under the table.
- One notice for each lapse, “linear signed out”, when no window in front shows the bar. A click opens Settings at that server. It comes while Programs is on in Settings › Notifications.
- The agent is told that you’re being asked, and nothing is sent. Once you’ve reconnected, its same call works, with no restart.
Sign out
Section titled “Sign out”Sign Out, under the table, takes the sign-in out of Next Term and ends it at the server, where the server allows it. Removing the last entry for a server’s URL does the same. Where the server can’t end it, Next Term says how to remove its access in that server’s own settings. Settings › Secrets › Sign Out of All… signs out of every server at once.
What is sent, and where
Section titled “What is sent, and where”Nothing about you or your sign-ins goes to Next Term’s website, or to any server but the MCP server and the sign-in server it names. What is stored on this Mac, and how, is in Security and privacy.
Where a server applies
Section titled “Where a server applies”Applies to picks one of these:
- All projects. The default.
- Only in one project. The server applies in that folder and every folder inside it.
- A project’s list, for its team. The server goes into the project’s own
.next-term/mcp.json, to commit with the repository.
Your own servers live in ~/Library/Application Support/Next Term/mcp.json, readable only by you. Both files use the common mcpServers shape, so a block from a README reads as it is.
A project’s list
Section titled “A project’s list”A project’s list comes with the repository, so anyone who can commit to it wrote it. Its servers start nothing until you approve the list. Approve… shows every server in it, with what it runs and what it sets in its environment or headers. Your approval is of the list as it is now, by its content. A commit that changes the list waits for you again.
Next Term finds a project’s list in the agent’s folder and in each folder above it, up to the repository’s top. So a package in a monorepo can have its own list, and the repository’s still applies.
When two lists name the same server, one is used, in this order:
- your server set for this project;
- the project’s, the nearest list first;
- your server for all projects.
The others show as Replaced by another.
Managing servers
Section titled “Managing servers”The switch at the top shows Personal (your servers) or Project (what agents get in a project: your servers and the project’s list). Select a server to Edit…, Remove or Turn Off. In Project, Turn Off Here turns a server off for that project alone, a team’s server included. Undo takes back the last change.
Each server’s State:
| State | Meaning |
|---|---|
| Ready | It starts, or is reached, the first time an agent uses it. Once it has, with its tool count. |
| Needs sign-in | A server at a URL asked for a sign-in Next Term doesn’t have. Sign In… is under the table. |
| Signed in | Next Term keeps it signed in for every agent. Once an agent has used it, with its tool count: Signed in · 12 tools. |
| Signed out | The sign-in lapsed. Reconnect… is under the table. |
| Needs more access | The server asked for more than the sign-in gave. Reconnect… is under the table. |
| Didn’t start | Its last start failed; the tooltip says why. |
| Couldn’t reach | A server at a URL: the last time an agent used it, Next Term couldn’t reach it. The tooltip says why. |
| Off / Off in this project | Agents don’t get it. |
| Needs your approval | It is in a project’s list you haven’t approved as it is now. |
| Not reached (SSE) | A server at a URL that speaks only the older HTTP+SSE transport. |
| Can’t be used | It breaks a rule; the tooltip says which. |
| Replaced by another | A server of the same name nearer this project is used instead. |
A broken hand edit, or a file from a newer Next Term, is never overwritten. Next Term says why it can’t use the file, and leaves it for you to fix.
Found in your agents
Section titled “Found in your agents”Below your servers, Found in your agents lists the servers already set up in your agents’ own configs, with the agents that have each one. Next Term reads the same files as Secrets’ import: the agents’ own settings, Claude Code’s ~/.claude.json, VS Code’s user mcp.json, and in each open project its .mcp.json, .cursor/mcp.json, .vscode/mcp.json, .gemini/settings.json, .codex/config.toml and opencode.json.
Add… opens the server as Paste a Config… would read it, its keys taken out for Secrets. A server already in your list, by its name or by what it runs, isn’t listed. The agents’ files are only read, never changed.
A server you add to an agent later
Section titled “A server you add to an agent later”Add a server to one agent’s own config after updating, and Next Term asks once, for example:
“linear” is new in Codex. Use it in every agent?
Add… opens Settings at that server; Not Now leaves it. Either way it isn’t offered again. The rules keep it calm:
- Never for what was there. Every server your agents had before this version first looked is never offered. It is listed under Found in your agents.
- Once a server, whatever the answer.
- At a quiet moment: never while you type, while the agent in front works or asks, or while another notice is up. It shows at the bottom of the window and takes no keyboard.
- Only the agents’ own configs. A project’s files aren’t read for it, so opening a project is not news.
Nothing is offered while “Let agents control Next Term” is off.
Ask your agent
Section titled “Ask your agent”Say “connect the GitHub MCP server”, and the agent asks Next Term with add_mcp_server. You approve on the Mac, in a window titled “An agent asks to connect an MCP server”. It shows exactly what will run or be reached, which keys from Secrets it uses, and where it applies. Decline, and nothing is added. It is always asked on the Mac.
- Keys go by name. The agent names stored keys in
secrets. A value that looks like a key is refused before anything is asked, and the agent is told to ask you for it withrequest_secret. - Where:
projectlimits it to one open project. Without it, every project. - Undo: the server shows in Settings › MCP Servers, and Undo takes it out.
list_mcp_servers shows an agent what is connected: each server’s name, kind (local or remote), where it applies and its state, and what applies in its own project. Never a key.
Both tools are always in Next Term’s tool list, deferred, so an agent can add the first server. They work for agents on this Mac only. See the tools.
How agents reach the servers
Section titled “How agents reach the servers”Agents reach the servers through the connection they already have to Next Term, its own next-term MCP server. An agent’s own config is never changed, so nothing changes outside Next Term.
- Three tools appear once a server that can start applies where the agent works:
mcp_serverslists the servers and their state,mcp_toolsfinds and describes their tools, andmcp_callcalls one. Until then, the agent’s tool list is as it was. - Fixed for a session. An agent’s tool list is set when its session starts. After you add your first server, start a new agent session to get the three tools. A server you connect later reaches a session that already has them, through
mcp_call. An agent started while Next Term wasn’t running yet, or didn’t answer in time, still gets the three tools once you have servers, and its first call picks them up. - Searching never asks you.
mcp_toolssearching across servers leaves out a server whose key comes from Secrets, or whose sign-in that agent isn’t allowed yet, and names it so the agent can ask for that one alone. - Local servers start on first need, in the agent tab’s folder, with your login shell’s
PATH. Each agent session gets its own copy, and it stops when the session ends. - Keys at start. A server started through
nxtrm secret rungets its keys when it starts, after you approve the use as Secrets asks. - Failures are a sentence. A program not found, no tool list within 30 seconds, a call over 50 seconds (5 minutes in Claude Code, which has no short timer of its own), a crash: the agent gets a plain sentence saying why, never a hang. What a server wrote is quoted with anything that looks like a key masked.
- A server that stops starts again. The next call starts a local server that stopped. One that fails twice in a row, by not starting or by stopping soon after its start, waits before it is started again: 5 seconds, then twice as long after each further failure, up to 5 minutes. Meanwhile a call to it is told at once why and when it is tried again, and a server that gets its keys through
nxtrm secret rundoesn’t ask you for them over and over. A run that lasts a minute, or any call it answers, clears the count. - Large results are cut at 100,000 characters, and the agent is told so.
A server’s tools as the agent’s own
Section titled “A server’s tools as the agent’s own”A new agent session also lists each server’s tools as its own, so the agent calls them as it calls any tool.
- Names. A tool is named
<server>__<tool>, such asgithub__create_issue. Any character but letters, digits,_and-becomes_, and a name is at most 48 characters, so it fits every agent. A name that had to change, runs over, or clashes with another ends in_and six characters of a hash instead, the same in every session. - Up to 40 a session, or 300 for Claude Code. A server’s tools come all or none, in name order, while they fit. Claude Code’s tool search loads an MCP tool only when it’s wanted, so it gets every server’s tools, listed to load on demand, without filling its context. The rest are reached through
mcp_call, as is a tool whose input an agent can’t take. - From the session after a server’s first use. Next Term learns a server’s tools when an agent first uses it, and the next new session lists them. Until then,
mcp_callreaches them. mcp_serverssays which. Each server showsdirect_tools, how many of its tools the agent has as its own, or why it has none, and the agent’s instructions name the servers it reaches throughmcp_toolsandmcp_call.
Agents on this Mac get the servers in any terminal, through Next Term’s entry in their own settings, while Settings › Editor › Agents: “Let agents control Next Term” is on. An agent in a remote tab runs on its host, and doesn’t get them.
What isn’t there yet
Section titled “What isn’t there yet”- A server an agent already has in its own config isn’t left out, so that agent may see it twice.
