~15 min

T3 · Tools via MCP

Connect a tool Claude doesn’t have out of the box: install a local MCP server, approve it, and make a tool call.

Knowledge refresher — MCP, transports, and scope levels

  • What MCP is — Model Context Protocol, an open standard for connecting AI assistants to external tools and data sources. Implement a server once; any MCP client (Claude Code, Claude Desktop, Cursor, Zed, etc.) can use it. — MCP introduction
  • Two connection methods — Local (stdio): Claude Code spawns the server as a subprocess on your machine — no port, runs only while Claude is active. Remote (HTTP/SSE): Claude connects to a URL — persistent service, can serve many clients. — Connecting local servers
  • Four scope levels — Claude Code stores MCP server configs at different levels, each controlling who gets the server:
    1. Local — private to you in this project only. Stored in ~/.claude.json but scoped to the current project. This is the default when no --scope flag is passed. Not committed to the repo — safe for evaluating untrusted servers.
    2. User — available in all your projects on this machine. Stored in ~/.claude.json. Use for personal tools you always want available.
    3. Project — shared with everyone who clones the repo. Stored in .mcp.json at the project root (committed to git). Use only when the server has no secrets in the command.
    4. Organisation (Connectors) — managed centrally by your org admin. Read-only for end users. Often the first place to check for approved servers.

    MCP servers can also be distributed as part of a plugin.

    These scope levels are analogous to CLAUDE.md memory levels from T1 — the same layered-override principle applies.

    — MCP scopes

Before you start

If your environment is not ready, follow along and complete it afterwards.


Steps

Which path is yours?
  • Option 1: Sample project (signup-api) — I don’t have an MCP server to connect yet → use the workshop’s FastMCP example.
  • Option 2: Your own project — I already have a local or remote server to connect.

Sample project (signup-api)

1

Create mcp/helper_server.py inside signup-api.

signup-api/ ← VS Code workspace root
├── mcp/
│   └── helper_server.py ← create this

Paste the following content and save (Cmd+S / Ctrl+S):

File contents — not a command:

from mcp.server.fastmcp import FastMCP

mcp = FastMCP("project-helper")

@mcp.tool()
def check_deploy_status(env: str) -> str:
    """Check mock deployment status for an environment (staging or prod)."""
    statuses = {"staging": "Healthy (v1.4.2)", "prod": "Healthy (v1.4.1)"}
    return statuses.get(env.lower(), f"Unknown environment: {env}")

if __name__ == "__main__":
    mcp.run()
No install step needed
The mcp package is downloaded automatically by uv run --with mcp on first run. No separate install step needed.
Done when
helper_server.py exists in signup-api/mcp/.
2

Register the server with Claude Code.

Choose your surface:

  1. In the Claude Code chat panel in VS Code, type /mcp.
  2. Scroll to the very bottom of the /mcp panel.
  3. Click “Add server”.
  4. A form slides in. Fill it in as follows:
  • Name: project-helper
  • Transport: Local command (stdio) — runs a command on your machine
  • Command: uv
  • Arguments (one per line in the form):
    run
    --with
    mcp
    python
    mcp/helper_server.py
  • Scope: Project — shared via .mcp.json in this project
  • Click Add server
VS Code MCP Add Server form showing Name, Transport, Command, Arguments and Scope fields
VS Code MCP Add Server form

After adding the server, type /mcp in the Claude Code chat panel. You should now see the server in the list.

Project scope — committed to the repo
Selecting “Project” scope means .mcp.json is committed to the repo — everyone who clones and trusts the project gets this server. Only use “Project” scope for servers with no secrets in the command. Use “Local” scope while evaluating.
signup-api/ ← VS Code workspace root
└── .mcp.json ← created by Add server

File contents — not a command:

{
  "mcpServers": {
    "project-helper": {
      "command": "uv",
      "args": ["run", "--with", "mcp", "python", "mcp/helper_server.py"]
    }
  }
}
Done when
.mcp.json exists in the project root and claude mcp list (run in terminal) shows project-helper.

Want to connect a hosted remote server instead? → Appendix 1

Diagnosis — if something went wrong

D.1 — Org-level configuration conflict

The error message from claude mcp add tells you exactly which policy is in effect.

1. Custom remote MCP server (HTTP transport) — try adding it:

In the VS Code integrated terminal:

claude mcp add --transport http test https://example.com/mcp
  • Succeeds and shows up in /mcp → allowed.
  • Cannot add MCP server: enterprise MCP configuration is active and has exclusive control over MCP servers → org deployed managed-mcp.json (fixed set only).
  • Cannot add MCP server “<name>”: server is explicitly blocked by enterprise policy → hit a deniedMcpServers entry.
  • Cannot add MCP server “<name>”: not allowed by enterprise policy → an allowedMcpServers allowlist is active and this server isn’t on it.

2. Custom local (stdio) MCP server

Same mechanism — claude mcp add for a stdio server is checked the same way, just matched by serverCommand instead of serverUrl. You’ll see the same error set above if blocked.

General check anytime: run /status in the Claude Code chat (shows notices for blocked or withheld servers) or claude mcp list in the VS Code integrated terminal (shows what’s actually active).

Docs: [1]  ·  [2]

Docs: [2]

3

Start a new session and approve the server.

MCP servers from project files need one-time approval per session start. A repository cannot approve its own servers — you must do it interactively.

  1. Start a new session: click + New session in the Claude Code extension tab in VS Code.
  2. When prompted to approve the new project MCP server, approve it.
  3. Type /mcp in the chat — project-helper should appear as connected.
Done when
/mcp lists project-helper as connected.
What just happened — approval file explained

Your approval was recorded locally — it is not committed to the repo. Here is what each file does:

signup-api/ ← VS Code workspace root
├── .claude/
│   ├── settings.local.json ← your personal approval (not committed)
│   └── settings.json ← shared project rules (committed — from T1 if done)
└── .mcp.json ← server config (committed)
  • .mcp.json is committed — the server config is shared with the team.
  • Approval choices are stored in .claude/settings.local.json and are not committed — each developer approves for themselves when they first open the project.
Scope Approval stored in Committed?
Local~/.claude.jsonNo — private to your machine
User~/.claude.jsonNo — private to your machine
Project.claude/settings.local.jsonNo — each dev approves themselves

If you clone this repo on another machine, you’ll be asked to approve again — this is intentional. Each developer reviews the server for themselves.

Open .claude/settings.local.json to see your approval recorded there.

Open .mcp.json to confirm the config.

signup-api/ ← VS Code workspace root
└── .mcp.json ← open this

File contents — not a command:

{
  "mcpServers": {
    "project-helper": {
      "command": "uv",
      "args": ["run", "--with", "mcp", "python", "mcp/helper_server.py"]
    }
  }
}
If the server does not appear in /mcp
Run claude mcp list in the terminal to check its status. If it shows as failed, verify the command path is correct from the project root.
4

Ask Claude about the deployment status to trigger a tool call.

Claude will call check_deploy_status from your MCP server and return the result — not from its training data.

In the Claude Code chat panel:

What is the deployment status of the staging environment?

Expected: Claude calls check_deploy_status("staging") and returns “Healthy (v1.4.2)”.

Done when
Claude returned a response from the MCP server tool without asking for permission.
Look around — read-only, ~1 min

In the Claude Code chat panel (/ commands) or VS Code integrated terminal (claude commands):

/mcp                   — connected servers and their status
claude mcp list        — same, from the terminal (also runs a health check)
claude mcp get <name>  — tool list for a specific server
/context               — see how much context the tool schemas are using

No changes needed. These commands are always safe to run.

After this task, you should be able to

  • Register a local MCP server at project scope and share it with the team via .mcp.json
  • Approve a project server and verify it is connected with /mcp
  • Make a tool call and understand how MCP extends what Claude can do

To build on this

  • Remote MCP — connect a hosted server without installing anything locally → Appendix 1
  • Claude Academy MCP course — full architecture, server development, and advanced patterns → Appendix 2
  • Build your own on AWS — centrally expose APIs via AWS Bedrock AgentCore Gateway → Appendix 3

Appendix

1 — Remote MCP server (optional — skip if org restricts)

Connect to a hosted MCP server that runs as a persistent service — no subprocess on your machine. These steps use Anthropic’s example server (Claude Code documentation search, no auth required).

Only add servers your org approves
Only add remote servers approved by your org and that you have done due diligence on. Official servers are often published to Claude Connectors — check there first. Never paste real tokens into chat or into committed files.

Choose your surface:

  1. In the Claude Code chat panel in VS Code, type /mcp.
  2. Scroll to the very bottom of the /mcp panel.
  3. Click “Add server”.
  4. Fill in the form:
    • Name: claude-code-docs
    • Transport: HTTP (remote)
    • URL: https://code.claude.com/docs/mcp
    • Scope: Local (not committed — safe for evaluation)
    • Click Add server
  5. Type /mcp — you should see claude-code-docs as connected.
  6. Start a session and ask:

    In the Claude Code chat panel:

    Use the claude-code-docs server to look up what /mcp does
  7. Remove when done: type /mcp, find the server in the list, and click Remove.

Sources: MCP quickstart  ·  MCP Registry  ·  MCP examples

2 — Claude Academy — MCP in depth

A full course covering MCP architecture, server development, and advanced patterns.

Introduction to Model Context Protocol — Claude Academy

3 — Build your own MCP server on AWS

AWS Bedrock AgentCore Gateway lets you expose existing APIs as MCP servers centrally — no code needed to connect existing APIs, centralized management, works with any MCP client.

Introducing Amazon Bedrock AgentCore Gateway  ·  AgentCore Gateway developer guide


References

  1. Control MCP server access for your organisation
  2. MCP servers overview