How to Add an MCP Server to Claude Code and Check It Works

Download Hemory
On this page

You ran the command to add an MCP server to Claude Code, and it printed a success message. Then you ask Claude Code to use the server and it acts as if the server does not exist. Registering a server and having its tools available in a session are two separate results, and most setup guides only cover the first.

This guide covers both. It gives the general way to register a server with Claude Code, shows where to look to confirm it is present, and ends with a small first task that tells you whether the tools work.

TL;DR

  • Registering a server needs two things from the server’s own documentation: how Claude Code should reach it (a URL, or a command it can run on your machine) and how it signs in, if it does.
  • A successful registration message does not prove the server is usable. Confirm it in two places: the registered-server list and the server status inside a running session.
  • Test with one small, read-only request whose answer you can check yourself. Do not start with a task that changes anything.
  • Commands and configuration belong to Claude Code and to each server, and both can change. Treat the examples here as the general shape and check them against the current Claude Code documentation and claude mcp --help.

What you are connecting

MCP (Model Context Protocol) is a standard way for an AI client to use tools offered by an external server. Three parts matter in setup:

  • The client is Claude Code, running on your machine.
  • The server is the thing that offers tools, such as access to a notes system, a database, or a memory source. It may run remotely at a URL or locally as a program that Claude Code starts.
  • The connection details tell the client where the server is and how to authenticate. Only the server’s own documentation can supply these.

The last point is why instructions vary so much. The client side of the setup stays similar from server to server, while the connection details come from each server’s documentation and differ every time.

This guide describes Claude Code only. Other clients, including editors and other command-line agents, register servers differently, so do not copy these steps to them.

Before you start

Gather these from the server’s documentation:

  1. How it is reached. A remote server gives you a URL and says which transport it uses. A local server gives you a command to run, such as a package runner plus a package name.
  2. How it authenticates. Some servers need an API key or token passed as a header or environment variable. Others start a browser sign-in the first time you use them.
  3. What it is meant to do. Note one or two things the server’s tools are supposed to do. You need them for the first test.

Also confirm that Claude Code itself is installed and starts normally on the machine where you are setting this up.

Step 1: Register the server

Claude Code registers servers through a claude mcp add command run in your terminal, not inside a Claude Code session. The general shape has two forms, depending on how the server is reached. The names in capitals are placeholders for your own values.

# A remote server reached at a URL
claude mcp add --transport http SERVER_NAME SERVER_URL

# A local server that Claude Code starts by running a command
claude mcp add SERVER_NAME -- COMMAND ARG1 ARG2

A few choices affect how it behaves:

  • Name. Pick a short name you will recognize in lists and logs.
  • Transport. Servers differ in how they are exposed. Use the one the server’s documentation specifies rather than guessing, since a wrong transport can register cleanly and still fail to connect.
  • Scope. Claude Code can store a server for just you in the current project, for everyone who shares the project, or for you across all projects. A --scope option on the add command selects this. Choose the narrowest scope that fits. Before you use a shared project scope, keep in mind that its configuration is meant to be shared, so do not put a personal key or token in it.
  • Credentials. Where the server needs a key, the add command has options for passing headers or environment variables. Run claude mcp add --help to see the current options instead of relying on a remembered flag.

These commands and options are specific to Claude Code and may change between versions. If the help output disagrees with an example here, follow the help output.

Step 2: Confirm the server is registered

Run the list command in your terminal:

claude mcp list

Your server’s name should appear, usually with a connection status. To see the stored details for one server, including the scope and the command or URL it will use, ask for it by name:

claude mcp get SERVER_NAME

Then open Claude Code and check from the inside:

/mcp

This shows the servers the current session knows about and their status. It is the more important check. A server can appear in the registered list and still fail to start or sign in when a session begins.

If a server is listed but not connected, or if it is missing from the session, stop here and read the troubleshooting section below. A first task will not tell you anything useful until this step is clean.

Step 3: Confirm the tools are actually exposed

A connected server should expose tools you can use. A short request in the session checks this without doing any real work:

List the tools available from the SERVER_NAME MCP server. Give each tool's name and a one-line description. Do not call any of them yet.

The answer should name tools that match what the server is supposed to do. Three outcomes are common:

What you seeWhat it usually means
A list of tools that match the server’s purposeThe connection and tool discovery both worked. Continue to the first task.
The server is connected but the tool list is emptyThe server started but exposes nothing to this session, often because of sign-in, permissions, or a server-side configuration problem.
Claude Code does not recognize the server at allThe session did not load it. Check scope, the directory you started Claude Code in, and whether you need to start a new session.

A tool list from the client is the best evidence that the connection works. A success message from the add command is not.

Step 4: Run a small first task

Pick a first task that is low risk and checkable. A good first task has four properties:

  • It uses one tool, so a failure points to one place.
  • It only reads. A first test that creates, edits, or deletes something can leave you cleaning up while you are still unsure the connection works.
  • You already know the right answer, or can look it up quickly outside Claude Code.
  • It uses the server for what it is for, not something unrelated.

For example:

Using the SERVER_NAME server, run one read-only lookup for SOMETHING_YOU_CAN_CHECK. Tell me which tool you called and what it returned.

Asking Claude Code to name the tool it called matters. It shows the answer came from the server and not from general knowledge, and Claude Code usually asks permission before it first uses a tool from a new server, so you can also see which tool is about to run. Compare the result with what you know. If the answer is right and the named tool is one of the server’s tools, the connection works end to end.

If you have to choose between two possible first tasks, choose the one with the more obvious right answer. A vague first request that returns something plausible tells you very little.

If the server is registered but nothing works

Work from the outside in. The first row that matches what you see is usually the right place to start.

SymptomThings to check
Not in claude mcp listWhether the add command actually ran without an error, and whether you registered it in a scope you are not currently in, for example a project scope while working in another directory.
Listed but shows as not connectedFor a local server, whether the command runs on its own in your terminal and whether any program it depends on is installed. For a remote server, whether the URL and transport match the documentation.
Connected, no toolsSign-in or token problems, a key passed in the wrong place, or permissions on the server’s side. Check the server’s documentation for what it needs before it will list tools.
Missing only in the current sessionStart a new Claude Code session so it loads the updated configuration. For a shared project scope, Claude Code may ask you to approve the server before using it.
Tools listed, but the first task failsRead the error text. Authentication errors and permission errors point to the server’s account setup, not to the Claude Code registration.

If you cannot tell which layer is failing, test the server on its own where that is possible, for example by running its local command directly or following any connection check in its documentation. That separates a server problem from a Claude Code problem.

To change a registration, remove it and add it again with the corrected details:

claude mcp remove SERVER_NAME

If the server you are adding is Hemory

Hemory’s Features page lists Claude Code among the mainstream agents Hemory is adapted for and says Hemory provides a standard MCP server. That public listing does not include Claude Code connection steps, an endpoint, or sign-in details, so this guide does not give them. Use Hemory’s own current connection instructions for those values, then apply the same register, confirm, and test sequence above.

The first task has one extra condition. Hemory can only return conversations it has already captured, so test with a conversation you know was recorded. Ask Claude Code to retrieve a detail from it, then compare the answer with that conversation’s transcript. Hemory’s Features page shows retrieval examples that use a tool called search_memory, but check the tool list your own session shows rather than assuming exact names.

Keep that first test to retrieval. Hemory’s MCP capabilities are not entirely read-only, because speaker management is documented, so a read-only request is the safer way to confirm the connection before you try anything else. If it works, the practical gain is that Claude Code can pull background from your captured conversations while you work, so you do not have to paste transcripts or retell what was said. Claude Code does its own reasoning and drafting with what it retrieves, and you review the result.

What to do next

Once the server is listed, shows tools, and passes a small first task, you have a connection you can rely on for real work. From here, widen the tasks one step at a time and keep naming the tool Claude Code used. When a later request behaves oddly, return to the same two checks: the server’s status in /mcp, and the tool list.

FAQ

Do I need to restart Claude Code after adding a server?

Often a new session is enough, and starting one is a cheap first fix when a server you just added is missing from the session. Behavior can differ between versions, so check the current Claude Code documentation if a new session does not help.

Does the same command work in other MCP clients?

No. The claude mcp commands belong to Claude Code. Other clients use their own commands or configuration files, and the server’s documentation often gives separate instructions per client.

Why does the server show up but with no tools?

The client found the server but the server returned no tools to this session. The usual causes are sign-in that did not complete, a credential in the wrong place, or permissions on the server’s side. Check the server’s documentation for what it needs before it lists tools.

Is it safe to try a new server on real data?

Start with a read-only request and review the permission prompt before approving a tool. Only add servers whose source you trust, since a server’s tools run with whatever access you give them.

Related reading

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