~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:
- Local — private to you in this project only. Stored in
~/.claude.jsonbut scoped to the current project. This is the default when no--scopeflag is passed. Not committed to the repo — safe for evaluating untrusted servers. - User — available in all your projects on this machine. Stored in
~/.claude.json. Use for personal tools you always want available. - Project — shared with everyone who clones the repo. Stored in
.mcp.jsonat the project root (committed to git). Use only when the server has no secrets in the command. - 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 - Local — private to you in this project only. Stored in
Before you start
- Check:
claude --versionprints a version in the VS Code integrated terminal. - Check:
uv --versionprints a version in the VS Code integrated terminal. - Check: T1 is complete, or your project is open in VS Code (T3 does not depend on T1 output).
If your environment is not ready, follow along and complete it afterwards.
Steps
- 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)
Create mcp/helper_server.py inside signup-api.
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()
mcp package is downloaded automatically by uv run --with mcp on first run. No separate install step needed.
helper_server.py exists in signup-api/mcp/.
Register the server with Claude Code.
Choose your surface:
- In the Claude Code chat panel in VS Code, type
/mcp. - Scroll to the very bottom of the
/mcppanel. - Click “Add server”.
- 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.jsonin this project - Click Add server
After adding the server, type /mcp in the Claude Code chat panel. You should now see the server in the list.
In the VS Code integrated terminal:
claude mcp add --scope project project-helper -- uv run --with mcp python mcp/helper_server.py
Some developers prefer the CLI, especially those who have configured the Claude Code extension to run in CLI mode via VS Code settings.
After adding the server, type /mcp in the Claude Code chat panel. You should now see the server in the list.
.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.
File contents — not a command:
{
"mcpServers": {
"project-helper": {
"command": "uv",
"args": ["run", "--with", "mcp", "python", "mcp/helper_server.py"]
}
}
}
.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 deployedmanaged-mcp.json(fixed set only).Cannot add MCP server “<name>”: server is explicitly blocked by enterprise policy→ hit adeniedMcpServersentry.Cannot add MCP server “<name>”: not allowed by enterprise policy→ anallowedMcpServersallowlist 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: [2]
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.
- Start a new session: click + New session in the Claude Code extension tab in VS Code.
- When prompted to approve the new project MCP server, approve it.
- Type
/mcpin the chat —project-helpershould appear as connected.
/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:
.mcp.jsonis committed — the server config is shared with the team.- Approval choices are stored in
.claude/settings.local.jsonand are not committed — each developer approves for themselves when they first open the project.
| Scope | Approval stored in | Committed? |
|---|---|---|
| Local | ~/.claude.json | No — private to your machine |
| User | ~/.claude.json | No — private to your machine |
| Project | .claude/settings.local.json | No — 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.
File contents — not a command:
{
"mcpServers": {
"project-helper": {
"command": "uv",
"args": ["run", "--with", "mcp", "python", "mcp/helper_server.py"]
}
}
}
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.
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)”.
Your own project
Register your server with Claude Code.
Choose your surface:
- In the Claude Code chat panel in VS Code, type
/mcp. - Scroll to the very bottom of the
/mcppanel. - Click “Add server”.
- A form slides in. Fill it in as follows:
- Name: your server name
- Transport: “Local command (stdio)” for a local server, or “HTTP (remote)” for a URL
- Command and Arguments: the command that starts your server, split at spaces — command is the first word, each argument on its own line in the form
- Scope: “Local” while evaluating; “Project” once you want to share it with the team
- Click Add server
After adding the server, type /mcp in the Claude Code chat panel. You should now see the server in the list.
Local stdio server (a command that starts a program on your machine):
In the VS Code integrated terminal:
claude mcp add --scope project <name> -- <command to start your server>
Remote HTTP server (a URL):
In the VS Code integrated terminal:
claude mcp add --scope project --transport http <name> <url>
Some developers prefer the CLI, especially those who have configured the Claude Code extension to run in CLI mode via VS Code settings. The commands above are equivalent to filling in the GUI form.
After adding the server, type /mcp in the Claude Code chat panel. You should now see the server in the list.
.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.
For a local server, .mcp.json looks like this (HTTP entries use type and url instead of command and args):
File contents — not a command:
{
"mcpServers": {
"<name>": {
"command": "<your-command>",
"args": ["<arg1>", "<arg2>"]
}
}
}
.mcp.json exists in the project root and claude mcp list (run in terminal) shows your server.
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 deployedmanaged-mcp.json(fixed set only).Cannot add MCP server “<name>”: server is explicitly blocked by enterprise policy→ hit adeniedMcpServersentry.Cannot add MCP server “<name>”: not allowed by enterprise policy→ anallowedMcpServersallowlist 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: [2]
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.
- Start a new session: click + New session in the Claude Code extension tab in VS Code.
- When prompted to approve the new project MCP server, approve it.
- Type
/mcpin the chat — your server should appear as connected.
/mcp lists your server 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:
.mcp.jsonis committed — the server config is shared with the team.- Approval choices are stored in
.claude/settings.local.jsonand are not committed — each developer approves for themselves when they first open the project.
| Scope | Approval stored in | Committed? |
|---|---|---|
| Local | ~/.claude.json | No — private to your machine |
| User | ~/.claude.json | No — private to your machine |
| Project | .claude/settings.local.json | No — 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.
File contents — not a command:
{
"mcpServers": {
"<name>": {
"command": "<your-command>",
"args": ["<arg1>", "<arg2>"]
}
}
}
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.
Make one real tool call from your server.
Type a request in the Claude Code chat that will trigger a tool from your server. Claude shows which tool it called and displays the result.
Read the tool list with claude mcp get <name>. For tools that only read data, add them to allow. For tools that write, send, or delete, leave them on ask (the default prompt).
File contents — not a command:
{
"permissions": {
"allow": ["mcp__<name>__<read_tool>"],
"ask": ["mcp__<name>__<write_tool>"]
}
}
Add this to .claude/settings.json in your project. Replace <name>, <read_tool>, and <write_tool> with your values.
allow-listed tools, without asking for permission).
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).
Choose your surface:
- In the Claude Code chat panel in VS Code, type
/mcp. - Scroll to the very bottom of the
/mcppanel. - Click “Add server”.
- 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
- Name:
- Type
/mcp— you should seeclaude-code-docsas connected. - Start a session and ask:
In the Claude Code chat panel:
Use the claude-code-docs server to look up what /mcp does - Remove when done: type
/mcp, find the server in the list, and click Remove.
-
Add the server.
In the VS Code integrated terminal:
claude mcp add --transport http claude-code-docs https://code.claude.com/docs/mcp -
Check the connection.
In the VS Code integrated terminal:
You should seeclaude mcp listclaude-code-docswith statusConnected. -
Use the server. Start a session and ask:
In the Claude Code chat panel:
Use the claude-code-docs server to look up what /mcp does -
Remove it when done (optional):
In the VS Code integrated terminal:
claude mcp remove claude-code-docs
Sources: MCP quickstart · MCP Registry · MCP examples
2 — Claude Academy — MCP in depth
A full course covering MCP architecture, server development, and advanced patterns.
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