Set Up the Workshop
James opened his laptop. He had the concept from Lesson 1: MCP servers give an agent hands. Now he wanted to build one.
He stared at the empty terminal. "Where do I even start? I need the protocol spec, the SDK docs, the testing tools..."
Emma pulled up a chair. "You know the pattern from Chapter 14. CLAUDE.md plus a skill. Set up the same way: empty directory, configuration file, domain skill. You do not need to become an MCP expert; you need to make Claude Code one."
You are doing exactly what James is doing. Before building an MCP server, you set up Claude Code with the knowledge to build one properly. This takes about 15 minutes: create a project, install one skill, write a configuration file.
Create Your Project Directory
Start with an empty directory. Every MCP server you build in this chapter lives here.
mkdir tutorclaw-mcp
cd tutorclaw-mcp
Nothing else in it yet. No package.json, no requirements.txt, no boilerplate. Claude Code will generate the right project structure in Lesson 4 when you ask it to build. The .claude/skills/ directory you create next will survive that process; Claude Code adds project files alongside it, not instead of it.
Install the mcp-builder Skill
Run one command to install Anthropic's official mcp-builder skill:
npx skills add https://github.com/anthropics/skills --skill mcp-builder
The installer creates a .claude/skills/mcp-builder/ directory inside your project. Look at what it added:
ls -la .claude/skills/mcp-builder/
You see a SKILL.md file and supporting directories (reference/, scripts/). The SKILL.md is the core: it contains the protocol knowledge, SDK patterns, best practices, and testing approaches that Claude Code loads when it works in this project.
This is the same skill mechanism you encountered in Chapter 56 (Lesson 6), but now you are installing a skill that teaches Claude Code how to build something, not just how to use something.
Create Your CLAUDE.md
Create a CLAUDE.md file in the project root. This is the file Claude Code reads every time it starts a session in this directory:
# TutorClaw MCP Server
## Rules
- Use the mcp-builder skill for all MCP work
- Use uv for Python projects
- Follow spec-first development: discuss requirements, output spec, then build
- Use flat Annotated parameters on tools, not Pydantic BaseModel wrappers
## After every build
1. Write and run tests. Fix any failures before continuing.
2. Start the server and confirm it boots without errors.
3. Make real HTTP tool calls against the running server to verify end-to-end. And write integration tests
4. Kill the server process.
5. Report results, and ask: if user wants to start the server connect with MCP Inspector"
Three rules. Each one prevents a specific failure:
| Rule | What It Prevents |
|---|---|
| Use the mcp-builder skill | Claude Code ignoring the installed skill and relying on generic (possibly outdated) knowledge |
| Use uv for Python projects | Claude Code defaulting to pip or poetry when uv is faster and produces reproducible environments |
| Spec-first development | Claude Code jumping straight to code without agreeing on requirements, leading to rework |
Notice that transport and port are not in the CLAUDE.md yet. You choose those in Lesson 3 and add them afterward.
You wrote CLAUDE.md files in Chapter 14 to shape Claude Code as a general agent. This CLAUDE.md is narrower: it configures Claude Code for one specific job, building MCP servers with a defined workflow.
Choose Your Language
The mcp-builder skill supports both Python (using FastMCP) and TypeScript (using the TypeScript MCP SDK). Before you pick one, ask Claude Code:
The mcp-builder skill supports Python and TypeScript for MCP servers.
I know Python from Part 4. Which language should I use for my first
MCP server, and what are the tradeoffs?
Claude Code gives you a detailed comparison because it has the skill loaded. It knows both SDKs, their strengths, their ecosystem differences, and which one fits your background.
For this chapter, Python aligns with what you learned in Part 4. The FastMCP library gives you a clean, decorator-based API for defining tools. TypeScript is equally valid; if you prefer it, every concept in this chapter translates directly.
Whichever language you pick, the remaining lessons in Chapter 57 follow that choice. The concepts (tools, transports, testing, connecting to OpenClaw) are identical in both languages. Only the syntax and package manager differ.
Verify the Skill Works
Ask Claude Code any MCP question to confirm the skill is loaded and active:
What is an MCP server and what are its main responsibilities?
Claude Code should give you a detailed, structured answer that covers the protocol, tool declarations, transport mechanisms, and the server lifecycle. This is not generic chatbot knowledge; it comes from the mcp-builder skill's reference material.
If the answer feels vague or surface-level (just a paragraph saying "MCP stands for Model Context Protocol"), the skill may not have loaded. Check:
ls .claude/skills/mcp-builder/SKILL.md
If the file exists, open a fresh Claude Code session in the tutorclaw-mcp directory. Claude Code reads skills on session start, not mid-conversation.
The difference between Claude Code with and without this skill is the difference between asking a colleague who read the MCP documentation yesterday and asking someone who has never heard of the protocol. The skill is domain expertise, packaged as a file.
What You Just Built
Your project directory now looks like this:
tutorclaw-mcp/
├── CLAUDE.md
└── .claude/
└── skills/
└── mcp-builder/
├── SKILL.md
├── reference/
└── scripts/
No code yet. No server. No configuration files. Just a CLAUDE.md that sets the rules and a skill that provides the knowledge. This is the same pattern from Chapter 14: you configured the agent's brain before asking it to do any work.
In the next lesson, you make one decision that shapes your entire server: how it communicates with the outside world.
Try With AI
Exercise 1: Inspect the Skill
Open Claude Code in your tutorclaw-mcp directory and send:
I just installed the mcp-builder skill. Explain what files were added
to my project and what each one does.
What you are learning: Claude Code reads its own skill files and can explain them to you. This is metacognition for agents: the tool knows what it knows.
Exercise 2: Customize Your CLAUDE.md
Send this prompt:
What should I add to my CLAUDE.md for a [your domain] MCP server?
Write me a project-specific CLAUDE.md that goes beyond the four
basic rules.
Replace [your domain] with your actual field (education, finance, healthcare, e-commerce). Claude Code uses the mcp-builder skill to suggest domain-appropriate rules.
What you are learning: CLAUDE.md is not a template you copy; it is a living document you refine as your project evolves. Domain-specific rules make the agent sharper.
Exercise 3: Skill vs. No Skill
Send this prompt:
Compare building an MCP server with the mcp-builder skill versus
building from scratch. What does the skill give me that I would
otherwise have to figure out myself?
What you are learning: The skill encapsulates hours of documentation reading, SDK exploration, and best-practice research. This is the value proposition of skills from Chapter 56, Lesson 6, now applied to building instead of using.
James leaned back from the screen. "Three files. That is the whole setup."
"Three files and a pattern," Emma said. "CLAUDE.md plus a skill turns a general-purpose agent into a specialist. You did this in Chapter 14 when you configured Claude Code for your warehouse inventory project. Same idea, different domain."
James thought about his old warehouse. "When I trained a new forklift operator, I did not teach them mechanical engineering. I gave them the manual, the safety checklist, and the keys. The skill is the manual. The CLAUDE.md is the checklist."
Emma paused. "Manual, checklist, keys. That is better than how I have been explaining it." She closed her laptop halfway. "Your workshop is ready. But before you build, you need one decision: how will your server talk to the agent? That is what we figure out next."