Skip to content

Client setup

Move a fetch server from Claude Desktop to Claude Code

Copy a fetch server from claude_desktop_config.json into Claude Code with add-from-claude-desktop or claude mcp add-json, fix the two entries that fail, and check it.

By Lucian Dyer, FetchMCP team · Published

This article was drafted with AI assistance from the sources listed below and edited and published by the FetchMCP team. Disclosure: the FetchMCP API, which this article mentions, is this site's own product.

Claude Desktop entry to Claude Code entry
  1. 1Open the Desktop configclaude_desktop_config.json, under the mcpServers key.
  2. 2Import or convertadd-from-claude-desktop on macOS or WSL; claude mcp add-json anywhere.
  3. 3Pass the inner objectadd-json takes the object inside mcpServers, not the wrapper.
  4. 4Repair two casesAdd "type": "http" to a url entry; rename keys with other characters.
  5. 5Check itclaude mcp list for the status, claude mcp get for the scope.

Your fetch server already works in Claude Desktop. Now you want the same tool in Claude Code, without retyping it and without a key ending up in the wrong file. Claude Code has two routes: an import command and claude mcp add-json.

Checked against the Claude Code MCP docs, the MCP docs and the fetch server README on 2026-11-29.

1. Find the entry you want to move

claude_desktop_config.json holds every Claude Desktop server under the mcpServers key. It lives here:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

In Claude Desktop, Settings, then Developer, then "Edit Config" opens it. The reference fetch server's README gives this entry for the app:

{
  "mcpServers": {
    "fetch": {
      "command": "uvx",
      "args": ["mcp-server-fetch"]
    }
  }
}

Do not copy the file into a Claude Code folder. Claude Code reads ~/.claude.json and <project>/.mcp.json; it does not read paths such as ~/.claude/mcp.json or %APPDATA%\Claude\mcp.json.

2. Import it on macOS or WSL

claude mcp add-from-claude-desktop copies servers from claude_desktop_config.json into the CLI. The Claude Code docs limit it to macOS and WSL.

claude mcp add-from-claude-desktop

Then skip to step 5 and check what it added.

3. Convert it with add-json everywhere else

claude mcp add-json takes a server name and the JSON for that one server. Pass the object inside mcpServers, not the wrapper:

claude mcp add-json --scope user fetch '{"command":"uvx","args":["mcp-server-fetch"]}'

fetch is the name; the JSON is everything that sat under "fetch" in the Desktop file.

--scope user makes the server active in every project, private to you. Without it, add-json writes to local scope: only you, only the current project. For a fetch tool you use everywhere, user scope is usually the one you want; Claude Code MCP scopes explains the three.

An entry with command and no type is read as a stdio server, so the uvx entry above works as written.

4. Repair the two entries that fail

Two kinds of entry need a fix before you run add-json.

  1. A url with no type. Claude Code reads an entry with no type as stdio, so it skips the server and reports that the entry has a "url" but no "type". Add "type": "http", "type": "sse" or "type": "ws" to match the endpoint. streamable-http is accepted as an alias for http.
  2. A name with other characters. A key with anything other than letters, numbers, hyphens and underscores needs a new name that uses only those. "Fetch Server" becomes fetch-server.

A remote entry fixed for add-json looks like this:

claude mcp add-json --scope user docs '{"type":"http","url":"https://mcp.example.com/mcp"}'

Add a remote server directly

Claude Code connects to remote HTTP servers directly, so for a hosted server you can add the URL itself:

claude mcp add --scope user --transport http fetchmcp https://fetchmcp.net/mcp \
  --header "Authorization: Bearer $FETCHMCP_API_KEY"

Put the key in an environment variable first, not in a JSON string you paste. The remote setup guide covers the header and the other clients.

5. Check what Claude Code saved

claude mcp add-json prints an Added ... line on success. That means the entry was saved, not that it connects.

claude mcp list
claude mcp get fetch

claude mcp list shows a status next to each server:

StatusWhat it means
✔ ConnectedReady to use
! Needs authenticationReachable, but it wants a sign-in or a token passed with --header
✘ Failed to connectThe server did not start or the URL did not respond

claude mcp get <name> shows which scope holds the entry. For a stdio server that fails, run its command in your terminal, here uvx mcp-server-fetch, to see the underlying error. Local and user entries both live in ~/.claude.json: local under the entry for the project, user under the top-level mcpServers key.

If the same name already exists at that scope, Claude Code refuses the add. Remove the old entry with claude mcp remove <name> or pick another name.

Try it with a real server

FetchMCP API's server is a Streamable HTTP endpoint with a bearer key, the case the remote section describes. "The MCP server registers 2 tools." The config is in the MCP docs, and a key comes from sign-up.

Frequently asked questions

How do I copy MCP servers from Claude Desktop to Claude Code?

On macOS or WSL, run claude mcp add-from-claude-desktop. Elsewhere, take each entry inside mcpServers in claude_desktop_config.json and pass it to claude mcp add-json with a server name.

What JSON does claude mcp add-json expect?

The object for one server, the part inside mcpServers, such as {"command":"uvx","args":["mcp-server-fetch"]}. The server name goes in the command, before the JSON.

Why does Claude Code skip a server entry that has a url?

An entry with no type is read as a stdio server, so a url with no type is a configuration error. Add "type": "http" (or "sse" or "ws") to match the endpoint.

Which scope does claude mcp add-json use?

local, unless you pass --scope user or --scope project. Use user scope for a fetch server you want in every project.

Sources

  1. Connect Claude Code to tools via MCP (Claude Code docs) (Documentation)
  2. Connect to MCP servers (Claude Code docs) (Documentation)
  3. Connect to local MCP servers (Model Context Protocol docs) (Documentation)
  4. Fetch MCP server README (modelcontextprotocol/servers) (Documentation)