Configuring MCP Servers in Claude Code: A Command or a URL, Three Scopes, and Three Moves When One Breaks
Every MCP server is one of two shapes: a program on your machine, which you add with the command that starts it, or a URL on the internet, which you add and then sign in to. Add a filesystem server and Jira to Claude Code, prove where each one was saved with .mcp.json and a second repo, then break one on purpose and fix it in three moves.
What you will learn
- Add a local MCP server to Claude Code with the command that starts it
- Add a remote MCP server by its URL and sign in through the browser, with no token in a file
- Choose the local, project or user scope, and know where each one is written
- Fix a server that won't connect: list it, get it, run its command yourself
Before you start
- What Is MCP? Host, Client and Server
- MCP Transports: stdio or Streamable HTTP
Once you know what an MCP server is, the next question is practical: how do you tell an AI app which servers to use? In this article we do it in Claude Code, on native Windows in PowerShell. We add one server that runs as a program on your machine and one that lives at a URL, see exactly where each one gets saved, and then break one on purpose to learn how to fix it.
The whole lesson hangs on one idea. Every MCP server is one of two shapes:
| Shape | You give Claude Code | Example here |
|---|---|---|
| A program on your machine (stdio) | the command that starts it | the filesystem server, through npx |
| A URL on the internet (HTTP) | the address, then you sign in | Jira, through Atlassian's server |
Everything else, scopes and debugging, is bookkeeping around those two. This lesson is a screencast walk-through, so the status lines below show what you should see, something like these; your version numbers, paths and wording may differ slightly.
Before you start
- Claude Code, which needs a paid Claude plan (Pro, Max, Team or Enterprise). The free claude.ai plan doesn't include it.
- Node.js, so
npxworks. The filesystem server is an npm package. - A project folder to work in. Here it's
C:\demo\mcp-walkthrough, with apackage.json, aREADME.mdand asrc\folder, plus an empty second folder,C:\demo\other-project. - Optionally, Git for Windows. Without it Claude Code uses PowerShell for shell commands; with it you get Git Bash.
If Claude Code isn't installed yet, it's one line in PowerShell, with no admin rights and no WSL needed:
irm https://claude.ai/install.ps1 | iex
Then close the terminal and open a new one, so PATH picks up claude. This is the most common "it didn't work" on Windows.
claude --version # prints the version
claude doctor # read-only health check: install, settings, warnings
cd C:\demo\mcp-walkthrough
claude # the first run signs you in through the browser, then /exit
Start from a clean slate:
claude mcp list
No MCP servers configured.
Shape 1: a program on your machine
Everything after -- is the command Claude Code will run to start the server:
claude mcp add filesystem -- npx -y @modelcontextprotocol/server-filesystem C:\demo\mcp-walkthrough
claude mcp list
claude mcp get filesystem # show what was actually stored
filesystem: npx -y @modelcontextprotocol/server-filesystem ... - ✔ Connected
Look at the path at the end of the add command. That folder is the fence: the server can't read anything outside it. That's least privilege in one argument.
Windows note. npm installs .cmd shims, so an npx server sometimes has to start through cmd /c. If the plain form lists the server but it never connects, use the JSON form, which keeps the arguments exactly as written:
claude mcp add-json filesystem '{"type":"stdio","command":"cmd","args":["/c","npx","-y","@modelcontextprotocol/server-filesystem","C:\\demo\\mcp-walkthrough"]}'Now use it. Start claude and ask:
> Using the filesystem server, list the files in src/ and tell me what this project does.
Shape 2: a URL you sign in to
This is the step people get lost in, so do it in this order.
- Look at the data first. Open the Jira board in the browser. In the lesson it's a throwaway site with a project keyed
DEMOand four open bugs of different priority. Claude can't see any of it yet; without this, the answer later proves nothing. - Register the server: a URL, not a token.
claude mcp add --transport http atlassian https://mcp.atlassian.com/v2/mcp claude mcp listatlassian: https://mcp.atlassian.com/v2/mcp (HTTP) - ! Needs authentication - Open the MCP panel. Start
claude, type/mcp, selectatlassianand choose Authenticate. - The browser opens by itself. Approve access on Atlassian's consent screen, pick the site if it asks, and come back.
/mcpnow shows the server as connected, with a tool count. - Ask a real question, naming the server.
The answer should match the board from step 1.> Using the atlassian tools, list the open bugs in project DEMO with their priority, highest first.
Notice what didn't happen. No API token was created, nothing was pasted into a config file, and access is revoked from Atlassian's side, not by deleting a line on your disk. If the panel misbehaves, the shell does the same: claude mcp login atlassian (add --no-browser over SSH), and claude mcp logout atlassian to reset.
Where those servers got saved
cd C:\demo\other-project
claude mcp list
No MCP servers configured.
They didn't follow us. By default a server is added in the local scope: your personal Claude config, keyed to that one project. To share a server with your team, add it in the project scope, which writes a file into the repo:
cd C:\demo\mcp-walkthrough
claude mcp add --scope project figma --transport http https://mcp.figma.com/mcp
cat .mcp.json
claude mcp remove figma # tidy up
The rule to keep: a URL you sign in to is safe to commit in .mcp.json. Anything that carries a token or key, like --header "Authorization: Bearer ...", stays in the local scope. MCP servers aren't configured in settings.json; the project scope writes .mcp.json, and local and user scope write your personal Claude config.
Break it, then fix it
Point the filesystem server at a folder that doesn't exist:
claude mcp remove filesystem
claude mcp add filesystem -- npx -y @modelcontextprotocol/server-filesystem C:\demo\typo-does-not-exist
Now three moves, always in this order:
# MOVE 1: is it connected?
claude mcp list
filesystem: ... - ✘ Failed to connect
# MOVE 2: what was it actually told to run?
claude mcp get filesystem
# MOVE 3: run that exact command yourself
npx -y @modelcontextprotocol/server-filesystem C:\demo\typo-does-not-exist
Error: ENOENT: no such file or directory ...
The third move shows the real error, the one Claude Code can't show you. Fix the path and check again:
claude mcp remove filesystem
claude mcp add filesystem -- npx -y @modelcontextprotocol/server-filesystem C:\demo\mcp-walkthrough
claude mcp list
For a remote server the loop ends differently: reconnect from /mcp, and if it's an auth problem, claude mcp logout <name> then claude mcp login <name>. There's no claude mcp logs or claude mcp restart command; get plus running the command yourself is the diagnosis.
Common mistakes
- Not opening a new terminal after installing. The old one doesn't know
claudeexists yet. - Pasting a token where a sign-in would do. For a server that supports OAuth, register the URL and authenticate in the browser.
- Committing a key in
.mcp.json. Project scope is for URLs and commands with no secrets. - Giving the filesystem server your whole disk. The path you pass is the fence; make it the project folder.
- Guessing at a "Failed to connect". Run the stored command yourself and read its error.
Recap: the whole lesson on one card
claude mcp add <name> -- <command> [args...] # a program (stdio)
claude mcp add-json <name> '<json>' # same, when Windows needs cmd /c
claude mcp add --transport http <name> <url> # a URL (HTTP)
claude mcp add --scope project|user|local ... # where it gets written
claude mcp list # status of everything
claude mcp get <name> # what was stored
claude mcp remove <name> # delete it
claude mcp login <name> / logout <name> # OAuth from the shell
/mcp # inside Claude Code: panel + Authenticate
Two shapes: a command on your machine, or a URL you sign in to. Three scopes: local for you, project for the repo, user for every project. And three moves when it breaks: list it, get it, run it yourself. For what the two shapes mean on the wire, see MCP transports; for the roles behind them, what is MCP.
Try it yourself
Add the filesystem server in the user scope instead, pointed at one folder, and check that claude mcp list now shows it in both demo folders. Then remove it, add it again in the project scope, and read the .mcp.json it writes. Would you commit that file? Why, or why not?
Related course on Udemy
Become an AI Engineer: LLMs, RAG, Agents and MCP
Build real AI systems in Python: LLM APIs, RAG, evals, agents and MCP.View on Udemy ↗: Become an AI Engineer: LLMs, RAG, Agents and MCP (paid course, opens in a new tab)Related posts
Context Engineering for a Long-Running Agent: Clear, Compact, Take Notes, Prove It
A support agent forgets the customer's name, order and contact choice after twenty turns and fails 0 of 4 checks. Measure the window, clear old tool output, compact old turns and keep a notes file, and the same chat passes 4 of 4 with 470 tokens instead of 2,945.
What LangChain Is For, and When to Skip It: Five Standard Parts, One Pipe, and a Decision Table
LangChain is a box of standard parts (models, prompts, retrievers, tools, parsers) that snap together with a pipe. The same refund question through the plain Anthropic SDK (1 import, 13 lines) and a chain (3 imports, 14 lines) gives the same answer word for word. It pays off when the bot grows; for one call, the SDK is simpler, with 16 packages instead of 38.
Why Chains Break: No Branch, No Retry, No Pause, and the Same Refund Assistant as a LangGraph Graph
A refund assistant built three ways. The chain runs classify, retrieve, reply once: it answers an opening-hours question with the billing line, misses the 30-day window, and sends a $150 refund with approved False. Plain if/while fixes it but hides the flow; a LangGraph StateGraph puts the branch, the retry loop and the approval stop in the arrows.
LangGraph Nodes, Edges and State: Build Your First Graph, Route With a Conditional Edge, and Read the Run Three Ways
Two small graphs. A refund skeleton: SupportState, a classify node, a route function on a conditional edge, and an Annotated log that appends instead of overwriting. A help desk: classify and answer call a scripted test model, spam goes straight to END after one model call instead of two, and the same run read with invoke, stream values and stream updates.