MCP (the Model Context Protocol) lets Claude Code call outside tools: a database, a browser, your issue tracker, your own internal API. An MCP server is a small program that offers those tools; Claude Code starts it and uses its tools next to the built-in ones. This lesson connects one in Config Studio for Claude Code, and then writes one.
Add a server
Open MCP servers. Its fields start empty, with the filesystem server as a grey example to type over:
| Field | Example | What it is |
|---|---|---|
| Where it lives | project | Yours in every project, or this repository's |
| Server name | filesystem | Becomes the prefix of its tools, as in mcp__filesystem__read_file |
| How it is reached | (unset) | stdio for a program it starts, http for a server at an address |
| Command | npx | The program that starts the server, usually npx, uvx or a path |
| Arguments | -y, @modelcontextprotocol/server-filesystem, . | One per line |
Read the arguments before you run anything. They decide what the server can reach: here, the . gives it the current folder and nothing above it.
A remote server
Some servers run somewhere else and answer on an address. Set How it is reached to http, put the URL in Address, and add any Headers it needs, one per line as Name=value. Write a token as ${API_TOKEN}: Claude Code reads it from your environment, so it stays out of the file.
{
"mcpServers": {
"docs": {
"type": "http",
"url": "https://mcp.example.com/mcp",
"headers": { "Authorization": "Bearer ${API_TOKEN}" }
}
}
}The studio always writes the type, because an entry with a url and no type is read as a program to start, and fails. sse is the older remote transport; use http where the server offers it.
Choose where it lives
Where it lives decides the file:
- user writes to
~/.claude.json: the server is there for you in every project - project writes to
.mcp.jsonin the repository: committed, so everyone who works on the project gets it
The file preview shows the mcpServers block that will be merged in:
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "."]
}
}
}A server that needs a token reads it from its environment. Keep tokens out of a committed .mcp.json; put them in your own environment instead.
Allow its tools
MCP tools go through permissions like any other tool. Their names start with mcp__ and the server name, so you can allow or refuse a whole server or one tool in Permissions:
mcp__filesystem every tool of the filesystem server
mcp__filesystem__read_file one toolA server added to a project asks once before it is used, so a cloned repository cannot quietly start programs on your machine.
Scaffold your own server
Write an MCP server is for when the tool you want does not exist yet. You name the tools and describe their parameters, and it writes a project that starts, registers the tools and answers, with a marked stub where your code goes.
- Written in picks TypeScript (the official Node SDK) or Python (the official
mcppackage) - Each tool's description is coached, because it is all the model has to go on when deciding to call it
The files are written to a folder named after your server, with the command to register it with Claude Code.
Control servers for a whole organisation
MCP allowlist (administrators) is for people who manage many machines. It decides which MCP servers may be loaded at all, matched by URL or command rather than by a name anybody could claim, and it goes in the managed policy that users cannot override.
You do not need it on your own machine, but it is worth knowing it exists before your company asks.
The next lesson runs Claude Code with nobody watching: headless runs, schedules and the sandbox.