Single logo
  • Courses
  • Blog
  • About
Join on SkoolJoin on Skool

In this topic

AI Engineering
  • The AI Stack in One Picture: Six Layers Every AI Product Is Built From
  • Tokenization: What an LLM Actually Sees When You Type
  • LLM Tokens, Context Windows and Cost: What One Question Really Costs
  • What an LLM Can and Cannot Do: One Prediction Loop, Its Strengths and Its Gaps
  • Structured LLM Output with Pydantic: Describe the Shape Once, Check Every Reply
  • Temperature, Top-p and Sampling: Why the Same Prompt Gives a Different Answer
  • Open vs Closed LLMs: Cost, Control, Privacy and Capability, Decided per Workload
  • Streaming and Error Handling for LLM Calls: Show the First Word Early, Retry Politely, Fail Calmly
  • Practice: Build a CLI Chat Tool with Memory, Commands, Error Handling and a History Cap
  • Explicit Criteria vs Vague Prompts: Turn Every Adjective Into a Check a Script Can Run
  • Few-Shot Prompting Done Right: How Many Examples, How Different, What Order, and the Leak That Lies
  • Prompt Caching: Keep the Start of Every Request Identical and Pay for the Long Part Once
  • Prompt Versioning and Testing in a Repo: Prompt Files, a Registry, a Hash per Answer and Tests That Gate
  • Context Engineering: What Belongs in the Context Window, Turn by Turn
  • Context Engineering for a Long-Running Agent: Clear, Compact, Take Notes, Prove It
  • What an Embedding Actually Is: Meaning as Numbers, Search by Closeness, and Where Hand-Made Numbers Break
  • The RAG Pipeline Explained: 7 Stages From Documents to a Cited Answer
  • Similarity Search: Finding the Closest Vectors with NumPy and NearestNeighbors
  • Why RAG Exists: The Problem It Solves, Compared With Pasting Everything and Fine-Tuning
  • Real Embedding Models: an Open Model or a Provider API, Then Search, Duplicates and Recommendations
  • Chunking Strategies for RAG: Fixed Size, Sentences or Headings, Measured on One Handbook
  • Vector Databases Hands-On: The Same Search in Chroma and pgvector
  • RAG Prompt Assembly and Citations: Number the Blocks, Fit a Token Budget, Check Every Claim
  • Hybrid Search: BM25 Plus Dense Embeddings, Merged With Reciprocal Rank Fusion
  • Reranking With a Cross-Encoder: When the Second Pass Helps, and When It Doesn't
  • Retrieval Evals: Score the Retriever With Recall@K, MRR and nDCG Before Blaming the Model
  • Choosing a Vector Index: Flat, HNSW or IVF-PQ, a Memory Estimate, and Filters That Starve Small Customers
  • Citations and Abstention in RAG: What a Citation Proves, and When the Right Answer Is "It's Not in the Documents"
  • Embedding Migration With Zero Downtime: Two Indexes, a Dual-Write Backfill, a Shadow Check and a Flag
  • Cosine, Dot Product or Euclidean Distance: Why Three Measures Pick Three Winners, and the One Fix
  • Choosing an Embedding Model: Dimension, Context Length, Domain and Cost, Tested on Your Own Questions
  • Loading and Parsing Real Documents for RAG: PDF Headers, Wrapped Lines, Tables and HTML Chrome, Scored
  • Where Naive RAG Fails: Five Ways the Simplest Retriever Hands the Model the Wrong Pages
  • RAG Generation Metrics: Faithfulness, Groundedness and Relevance, One Claim at a Time
  • Capstone: A Production RAG Service Over the Python Standard Library, With an Eval a Hiring Manager Can Rerun
  • Context Engineering for a Long-Running Agent: Clear, Compact, Take Notes, Prove It
  • What LangChain Is For, and When to Skip It: Five Standard Parts, One Pipe, and a Decision Table
  • Why Chains Break: No Branch, No Retry, No Pause, and the Same Refund Assistant as a LangGraph Graph
  • LangGraph Nodes, Edges and State: Build Your First Graph, Route With a Conditional Edge, and Read the Run Three Ways
  • Human-in-the-Loop and Checkpointing in LangGraph: interrupt, a SQLite Save Slot and Command(resume=...)
  • Multi-Agent Patterns: Hub and Spoke in LangGraph, With Short Briefs, Owned Tools and a Retry the Hub Decides
  • A Research Agent in LangGraph: Plan, Search, Read, Write, and a Check Node That Rejects Citations Nobody Read
  • What Is MCP? One Plug Between AI Apps and Tools: Host, Client, Server and the Three Messages
  • Configuring MCP Servers in Claude Code: A Command or a URL, Three Scopes, and Three Moves When One Breaks
  • Workflow or Agent: Decide Who Picks the Next Step, Then Let the Constraints Choose the Design
  • Custom Agent Loops and Harnesses: A Dispatch Table, an Approval Hold, Error Results and a Turn Budget
  • Building an MCP Server: Tools, Resources and Prompts in Python and TypeScript
  • MCP Transports: stdio or Streamable HTTP, and Who Starts the Server
  • Deploying and Authenticating an MCP Server: Environment Keys for stdio, Bearer Tokens and Scopes for HTTP
  • From ML Metrics to LLM Evals: Same Ruler, New Targets
  • Why You Cannot Ship an LLM Feature Without an Eval: Five Parts, Three Graders, One Tiny Eval
  • Building a Golden Dataset for LLM Evals: Cases, a Schema, a Coverage Table and a Seeded Split
  • Retrieval Evals: Score the Retriever With Recall@K, MRR and nDCG Before Blaming the Model
  • Regression Testing an LLM Bot in CI: A Golden Set, Two pytest Gates and GitHub Actions
  • Testing a RAG Bot Before It Ships: Slices, a Release Gate per Slice, and the Week After
  • RAG Generation Metrics: Faithfulness, Groundedness and Relevance, One Claim at a Time
  • LLM-as-Judge: Write a Rubric, Check Every Verdict, and Trust the Grader Only After Kappa Says So
  • RAGAS and Custom Evals: Framework Faithfulness Plus Your Own Citation and Required-Fact Checks, Behind One Gate
  • Which Test Layer Owns the Failure? Unit, Functional, Integration and End-to-End Tests for a Claude App
  • Six Ways a 200 Can Still Be Wrong: Hallucination, Refusal, Under-Acting, Context Loss, Format Drift and Inconsistency
  • Proving a Model Upgrade Is Ready: A Frozen Golden Set, a Calibrated Judge, the Right Layer and a Release Gate
  • Fallback Models for an LLM App: A Chain That Checks Region and Fit, Flags Degraded Answers and Gets Rehearsed
  • Back Pressure for LLM Traffic: Bound the Queue, Give Chat Its Own Lane, Count Tokens, Cancel When the Caller Leaves
  • Load Balancing LLM Traffic: Count the Work, Weigh the Prefix Cache, Check Real Health, Drain Before Deploys
  • A Message Queue for Document Ingestion: At Least Once, Leases, an Idempotent Consumer and a Dead Letter Queue
  • Caching for AI Apps: Four Layers, What Goes in Each Key, and How a Delete Travels
  • Semantic Caching: Why a Similarity Threshold Can't Stop Confident Wrong Answers
  • LLM Model Routing: Rules, a Classifier or a Cascade, Judged on Cost per Win and Every Topic
  • Cutting p95 and Cost in Half for an LLM App: Read the Bill, Match the Lever, Guard Success
  • Observability and Tracing for LLM Apps: A Span per Stage, Redaction First, Bad Traces Become Tests
  • Guardrails for an LLM Agent: Check What Comes In, What It Wants to Do, and What Goes Out
  • Embedding Migration With Zero Downtime: Two Indexes, a Dual-Write Backfill, a Shadow Check and a Flag
  • Design a Multi-Tenant RAG Assistant, Part 1: Requirements, Rough Numbers and a Contract
  • Design a Multi-Tenant RAG Assistant, Part 2: Tenant Isolation, a Scoped Cache and Walking an Outage
  • A 500 MB PDF Takes 50 s to Answer, Get It to 2 s: Measure First, Then Promise Per Path
  • A 500 MB PDF From 50 s to 2 s, the Fast Path: Queue, Status, Streaming and an Acceptance Test That Fails
  • FastAPI for AI Services: Schemas at the Door, Load Once in the Lifespan, Depends, and def vs async def
  • Streaming LLM Answers From FastAPI: Sources First, Token Events Over SSE, and the Same Events Over a WebSocket
  • Docker for AI Apps: Bake the Model Weights In at Build Time, Use CPU-Only PyTorch, and Run Offline
  • Deploy a RAG Service: A Service Key, Health and Ready Checks, Caddy in Front and a Smoke Test
  • Cost Tracking and Budget Guards for an LLM App: Count the Tokens, Log Every Call, Check Before You Spend
  • Versioning Prompts, Models and Indexes: Three Moving Parts, One Release File and a One-Line Rollback
  • Guardrails for an LLM Agent: Check What Comes In, What It Wants to Do, and What Goes Out
  • The Agent Attack Surface: Blast Radius, Narrow Tools, Scoped Keys and the Dangerous Three
  • Prompt Injection, Jailbreaks and Untrusted Input: Label What Comes In, Gate What Goes Out
  • Injection Exposure Review for an Agent: Map Inputs, Data and Effects, Layer Every Path, Retest the Job
  • Data Leakage and PII in LLM Apps: Redact, Minimize, Log Safely and Count Every Place
  • Hooks That Block Destructive Actions: a PreToolUse Gate That Allows, Asks or Denies
  • Claude API Keys: Keep the Key on a Server Proxy, One Key per Environment, Rotate and Scope It
  1. Blog
  2. /
  3. AI Engineering
  4. /
  5. Agents and MCP

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.

Chaand Sheikh

·27 November 2026Agents and MCP

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:

ShapeYou give Claude CodeExample here
A program on your machine (stdio)the command that starts itthe filesystem server, through npx
A URL on the internet (HTTP)the address, then you sign inJira, 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 npx works. The filesystem server is an npm package.
  • A project folder to work in. Here it's C:\demo\mcp-walkthrough, with a package.json, a README.md and a src\ 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.

  1. Look at the data first. Open the Jira board in the browser. In the lesson it's a throwaway site with a project keyed DEMO and four open bugs of different priority. Claude can't see any of it yet; without this, the answer later proves nothing.
  2. Register the server: a URL, not a token.
    claude mcp add --transport http atlassian https://mcp.atlassian.com/v2/mcp
    
    claude mcp list
    atlassian: https://mcp.atlassian.com/v2/mcp (HTTP) - ! Needs authentication
  3. Open the MCP panel. Start claude, type /mcp, select atlassian and choose Authenticate.
  4. The browser opens by itself. Approve access on Atlassian's consent screen, pick the site if it asks, and come back. /mcp now shows the server as connected, with a tool count.
  5. Ask a real question, naming the server.
    > Using the atlassian tools, list the open bugs in project DEMO with their priority, highest first.
    The answer should match the board from step 1.

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
Three scopes for an MCP server local (default) no flag your personal config, keyed to this project only you, only here project --scope project .mcp.json in the repo root, committed the whole team user --scope user your personal config, top level you, in every project A URL you sign in to can go in the repo. Anything with a token or key stays local.
Same server, three places it can be written. Pick by who should get it.

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 claude exists 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?

Tried the exercise? Share your answer or ask a question.

The StudyEasy AI Community is free to join, with the lesson files, notebooks and code.

Join free on Skool

Keep going in AI Engineering · 44 of 89

Previous
What Is MCP? One Plug Between AI Apps and Tools: Host, Client, Server and the Three Messages
Next post
Workflow or Agent: Decide Who Picks the Next Step, Then Let the Constraints Choose the Design

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.

On this page

  • Before you start
  • Shape 1: a program on your machine
  • Shape 2: a URL you sign in to
  • Where those servers got saved
  • Break it, then fix it
  • Common mistakes
  • Recap: the whole lesson on one card
  • Try it yourself
Community · Free to join
Single logo

StudyEasy AI Community

Hosted onSkool

Learn AI engineering, share what you build, and connect with other learners.

  • Free resources: lesson files, notebooks and code

  • Ask questions and join engineering discussions

  • Meet real people learning and building with AI

Join free on Skool

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)

Single logo

Empowering Education, One Course at a Time

About
About usContact usFAQs
Legal
Terms of ServicePrivacy Policy

© 2026 StudyEasy Organization. All rights reserved.