Renaming a server
An upstream server's name is its key everywhere in MCPProxy: in the configuration,
in config.db, in profile rules and agent-token scopes, and in the <server>:<tool>
names agents call. Renaming it is one operation:
mcpproxy upstream rename gh github
The same operation is available as POST /api/v1/servers/{name}/rename with
{"new_name": "github"}, as the upstream_servers MCP tool's rename operation
(name and new_name), and as Actions → Rename… on the server's page in the
Web UI. Agent tokens cannot rename servers, and the MCP operation is refused
unless both allow_server_add and allow_server_remove are on.
Do not edit the name by hand
Changing "name" in mcp_config.json is a removal of the old server and an
addition of a new one. The removal purges everything stored under the old name
(see Removal and incarnation): tool
approvals and the tool baseline, the OAuth login and DCR client, scan evidence. The
new name starts over, and nothing that pointed at the old name follows it: a
profile that listed it loses the server, a deny rule such as old:delete_repo no
longer applies, and an agent token scoped to it loses access.
What a rename keeps
One config commit renames the entry, and in the same config.db transaction
moves the server's records to the new name:
| Moved to the new name | How |
|---|---|
| Tool and prompt approvals, tool hashes, the tool baseline marker | re-keyed new:<tool>; the approval hashes do not include the server name, so nothing is re-reviewed |
| Skill reviews and skill files | re-keyed and bound to the new incarnation |
| OAuth tokens and the DCR client registration | re-keyed to the new name's key and written again, so an encrypted row is sealed for its new key |
| Integrity baseline, scan reports and scan jobs | the records' server name is rewritten |
| Quarantine state | the entry keeps its quarantined value: a rename is never a way out of review |
and rewrites every reference in the configuration:
- profile
serverslists,tools.allow/tools.denypatterns whose server part is the old name, andtools.classifykeys; server_edition.accessgroup_serversanddefault_servers(server edition);- the
allowed_serversof every agent token and client credential that names the server (owned server-edition tokens are tenant state and are left alone).
What changes
- The server reconnects under the new name (its process or container is
restarted). Agents see its tools as
<new>:<tool>, and clients configured with the single-server address/mcp/s/<old>must be pointed at/mcp/s/<new>. - The server's own tool-call history is cleared. It is the one thing a rename loses: that history is keyed by an identity hashed from the name, so it is purged with the old name, as on removal.
- Activity rows recorded before the rename keep the name they were recorded under.
A
config_changerow with actionserver_renamedon the new name carries the old one inprevious_values.name, linking the two.
When a rename is refused
The rename changes nothing and answers 409 when:
- a server with the new name is configured or still stored;
- something already names the new name: a profile's server list or rule, a classify key, an access grant, an agent token, or a stored record. Moving onto it would let that reference start reaching the renamed server, or merge two servers' records;
- a security scan of the server is still running (wait for it to finish, then rename);
- a wildcard rule matches the server's tools differently under the two names (for
example
deny: ["gh*:*"]when renamingghtocode): the rename would silently change what the rule allows.
Edit the reference first, then rename. A name that is empty or contains : or *
(the wildcard of token scopes and tool rules) is a 400, and so is a name that
would make a rewritten profile rule invalid (for example one with a space).
Renaming needs the running daemon; the CLI refuses in standalone mode rather
than fall back to the lossy file edit.