Claude Code MCP Setup: Add a Server by Command or Edit the Config?

Download Hemory
On this page

Claude Code users may encounter two ways to register an MCP server: run a supported command or edit a configuration file. The right choice depends on what your installed client documents, where you want the server available, and how you plan to review or remove the setup. The method alone does not establish its scope or permissions.

TL;DR

  • Use a command when Claude Code’s current documentation supports it for your setup and you want the client to add the entry.
  • Edit a configuration file when you need to inspect or manage the entry directly—and you know which file and scope the client uses.
  • After either method, confirm the server appears in Claude Code and test a limited, appropriate request. Don’t infer permissions from a successful connection.
  • If connecting Hemory, check its in-app MCP connection route. Its public setup description does not specify Claude Code’s command-line or configuration-file steps.

Command or configuration file: what changes?

A command uses the client’s supported interface to add or update a server entry. Editing a configuration file means changing the settings the client reads. These are two ways to make a connection available; neither is automatically safer, more shareable, or easier to undo in every setup.

ConsiderationUse a documented command when…Edit configuration when…
SupportThe command is documented for your Claude Code version and connection type.Claude Code documents the file format and location for your version.
VisibilityYou’re comfortable reviewing the command’s stated effect and its output.You want to inspect the server entry and its settings directly.
ScopeThe command’s documented target matches the users or projects that need the server.You have confirmed the file’s scope and want to manage that entry there.
MaintenanceThe client documents how to inspect, update, or remove the entry.You can identify the exact entry and make a controlled change to it.

The words “command” and “config file” do not tell you whether a server is available to one project, your user account, or a wider environment. Check Claude Code’s current documentation for the relevant scope and settings. Avoid copying an entry between projects or machines until you understand what it exposes and whether it contains sensitive values.

When is the command the better choice?

Prefer the command if Claude Code documents it for the connection you’re making and it clearly targets the intended scope. It can be a straightforward way to register a server without manually editing structured settings. Before running it, read the command’s documented effect, required inputs, and any instructions for checking or removing the entry.

Don’t guess a command from an example for another MCP client. A command shown for a different client, version, or server may use different options or behavior. If you cannot confirm that it applies to your setup, pause and consult the current Claude Code instructions rather than improvising.

When does editing the file make sense?

Direct editing can suit a setup where you need to review the server entry, keep a deliberate record of the change, or manage it alongside other client configuration. Choose this route only when you can identify the file Claude Code actually reads, the expected format, and the scope that file controls.

Make a backup or otherwise preserve the existing settings before changing them. Add or modify only the relevant server entry, then check the file for formatting errors. If you cannot confirm the correct file or format, editing by hand is not a shortcut—it adds uncertainty.

How to verify and undo either method

Use the same checks whichever route you choose:

  1. Confirm the setup source. Use current Claude Code documentation for the command, file location, format, and scope that apply to your installed client.
  2. Check that the entry is recognized. Follow Claude Code’s documented way to inspect MCP servers or connection status. Don’t rely on a command completing or a file saving as proof that the connection works.
  3. Try a limited request. Ask for a small, appropriate task that confirms the server is reachable. A response does not prove that every tool or permission is available.
  4. Review what the connection can do. Check the server’s documented tools and permissions. MCP connections can have capabilities beyond retrieval; don’t assume a connection is read-only.
  5. Know the removal path. Use the client’s documented removal method or remove the correct configuration entry. Then confirm the server is no longer available at the scope you intended to change.

If the server is missing, check for a version mismatch, incorrect configuration location, formatting issue, or client-specific connection requirement. A failed check does not, by itself, identify which one caused the problem.

If you’re connecting Hemory

Hemory’s Features page describes an in-app, one-click MCP connection for Claude and standard MCP clients. That page does not provide Claude Code-specific command-line steps, configuration paths, or confirmation commands. Check Hemory’s current in-app instructions and Claude Code’s current documentation before choosing between those setup methods; don’t assume the instructions for another client apply to Claude Code. Hemory’s Features page

Once connected through a supported route, Hemory provides captured Memory and retrieval for a connected agent; the agent performs its own reasoning and any drafting. Review the resulting work and confirm what the connection can access. A successful setup does not establish access to uncaptured conversations or permissions beyond those documented for the connection.

MCP settings panel with a masked key, agent labels, and a read-only note.

Review MCP connection options and access settings.

Bottom line

Use the documented command when it supports your version and gives you the scope and controls you need. Edit the file when direct inspection and maintenance matter and you’ve confirmed the correct location, format, and scope. If either detail is unclear, resolve it in the relevant client documentation before changing settings.

Start building your memory palace

Download Hemory — from today on, every real conversation becomes material you can generate from tomorrow.

Get Hemory for iOS Get Hemory for Android Download APK

macOS, Windows, Linux, Web, and Self-host coming soon