Skip to content
Mia Automation
NLEN Sign in Put Mia to workGet started

Claude Code MCP Servers: Add Them, Test Them, Remove Them

Run claude mcp add to connect an MCP server to Claude Code, claude mcp list to test it and claude mcp remove to take it out again. An MCP server gives Claude access to something outside your project, such as a folder, a database or Notion. We added three servers on a Windows PC and had Claude Code remember a customer note across two separate sessions through a memory server. Along the way we hit two mistakes that are easy to miss.

Claude in practiceUpdated 5 min read

Tested by us on 11 November 2026.

Animated diagram: in session 1 Claude Code stores a customer note through the MCP memory server in a file; in session 2 it asks for the note and gets back that the customer delivers every Tuesday

Add a server: the three commands we used

There are two kinds. A local server is a program Claude Code starts on your machine, called stdio; everything after the -- is that program's command line. A remote server is reached over a URL, called http. These are the three commands from our test:

bash
# Local server: read and write access to one folder
claude mcp add --transport stdio files -- npx -y @modelcontextprotocol/server-filesystem C:\Users\Public\voorbeeld\project

# Local server your whole team gets, through .mcp.json
claude mcp add --scope project --transport stdio memory -- npx -y @modelcontextprotocol/server-memory

# Remote server, available in all your projects
claude mcp add --scope user --transport http context7 https://mcp.context7.com/mcp

Run from the project folder. Swap the path for your own project.

From the Claude Code MCP docs, checked November 11, 2026.
ScopeStored inWho gets it
local (default)Your own .claude.json, under this projectYou, in this project only
project.mcp.json in the project rootEveryone who pulls the repo
userYour own .claude.jsonYou, in every project
PowerShell window: three MCP servers added with claude mcp add; the local one goes into .claude.json, the project one into .mcp.json, and claude mcp list shows two connected and one pending approval (opens at full size)
The "File modified" lines tell you which file each server landed in. Our test names were Dutch; the commands are identical.

Check that it connects

claude mcp list starts each server briefly and reports Connected or an error. The file server and the remote server connected straight away. The memory server from .mcp.json showed Pending approval: Claude Code asks, at the first interactive session, whether you trust servers from a shared project file. Someone else may have committed that file, so the prompt is there for a reason.

One catch: claude -p loads project servers without asking. The docs say so, and our script runs did exactly that. If you run Claude Code in scripts against someone else's repository, read its .mcp.json first.

Test it in a real session

Connected doesn't mean working. We gave Claude Code two prompts in two separate sessions. First: store in the MCP memory that the customer Bakkerij De Vries delivers every Tuesday and wants a call before 7 a.m. After 9.2 seconds the note was in the memory server's file. In the second session we asked when that customer delivers. Claude searched the memory and answered in 6.2 seconds with Tuesday and the early call.

Claude Code names a server's tools mcp__<server>__<tool>, as in mcp__memory__search_nodes. In scripts, --allowedTools "mcp__memory__*" allows every tool of that one server and nothing else.

Two mistakes we made

  1. The position of -e matters. Our first try was --transport stdio -e MEMORY_FILE_PATH=… memory. Claude Code read the server name as a second environment variable and failed. Put -e before --transport, or put any other option between -e and the name.
  2. Without the server, Claude found another way. Because of that failure the memory server didn't exist. Claude Code still said the note was saved, and wrote it to its own memory files instead. The answer looked right, but no MCP server was involved. When you test, check which tool ran: Ctrl+O in a session, --output-format stream-json in a script.

On Windows, npx worked as the command directly in our test, without wrapping it in cmd /c. That was with Node.js 22 and Claude Code 2.1.322.

Remove a server

claude mcp get <name> shows a server's scope and prints the matching remove command. Pass the same scope you added it with, or Claude Code won't find it.

bash
claude mcp get files
claude mcp remove memory --scope project
claude mcp remove context7 --scope user
PowerShell window: claude mcp get shows the file server's scope, status and remove command; then two servers are removed and only the file server remains (opens at full size)

The connections we run ourselves

We connect few things, and connect them carefully: email and calendar, documents and spreadsheets, a browser for jobs without their own connector, and our own search memory. Some of these servers we built ourselves with the official SDKs. Every connection gets its own narrow account, and reading mail and sending mail run through different accounts.

Before adding a connection we answer four questions. Which task needs it? Read only, or write too? Which account does it get? And what happens if the agent misuses it? Start with read access. Grant write access only once you have an answer to the last question.

Questions

How do I add an MCP server to Claude Code?

claude mcp add <name> -- <command> for a local server, or claude mcp add --transport http <name> <url> for a remote one. Add --scope project to share it with your team through .mcp.json.

Where is the Claude Code MCP config?

Local and user servers live in your .claude.json; project servers in .mcp.json at the project root.

How do I know Claude used the server?

Look for tool calls named mcp__<server>__… in the transcript (Ctrl+O) or in stream-json output. A good-looking answer alone doesn't prove it.

Why does my project server say Pending approval?

Servers from .mcp.json need your approval in an interactive session first. Start claude in the project and accept them, or reset earlier choices with claude mcp reset-project-choices.

Sources