James had a working MCP server. Claude Code had built it, tested it, started it, and made a real tool call to prove it worked. But the server was sitting in his project directory, disconnected from everything.
"So I have a server that works," James said. "How do I get it into my agent?"
Emma did not look up. "You already know how. You did it in Module 9.1."
James thought about it. "The time server. I ran openclaw mcp set, restarted the gateway, and the tools appeared in the dashboard." He looked at his terminal. "Same thing?"
"Same thing. Different URL."
You are doing exactly what James is doing. Your server works. Now you connect it to your agent and test it for real.
Your server needs to be running before OpenClaw can talk to it. Open a terminal in your tutorclaw-mcp project directory and run:
You should see output ending with something like:
That means your server is listening. Keep this terminal open. If you close it, the server stops and the connection breaks.
Two Terminals
Use two terminal windows for this chapter. One runs the server. The other runs the OpenClaw commands.
Open your second terminal. Two commands:
That is the same pattern you used in Module 9.1 and Module 1, Chapter 7 when you connected the time server. The only difference is the URL: instead of pointing to a pre-built package, you are pointing to the server you just built.
You should see tutorclaw in the list. If you want to double-check the details:
Make sure the URL matches exactly what your server printed on startup. A single character off (missing /mcp, wrong port) breaks the connection silently — no error in chat, just silence.
Pick up your phone. Send a message to your agent:
Wait for the response. Your agent should:
You get something like: "Welcome, James Chen! Your learner ID is 5262ec54-8d3d-49fe-8ccd-5ede5b9d173f."
A message you typed on your phone triggered a tool that you described, Claude Code built, and your agent discovered through MCP.
Go back to the dashboard. Find the conversation log for the message you just sent. You should see a tool badge next to the response, showing the agent used register_learner.
This matters because a text response alone does not prove the tool ran. The agent is smart enough to make up a plausible answer. The tool badge is your proof that the full chain worked:
Without the badge, you cannot tell a real tool call from a made-up response. The dashboard is the source of truth.
What you are learning: Debugging connection issues follows a repeatable sequence: server running, URL correct, gateway restarted, gateway log. Building this into habit saves you from guessing.
What you are learning: The cycle from Module 9.2, Chapters 2 through 5 repeats for every tool. Each new tool follows the same pattern: describe, steer, build, connect, verify.
What you are learning: MCP does not care who built the server or how it runs. The config pattern is the same. The gateway treats both identically. This is what lets you scale from one tool to dozens.
James sent the WhatsApp message. Ten seconds later, his phone buzzed. "Welcome, James Chen! Your learner ID is 5262ec54-8d3d-49fe-8ccd-5ede5b9d173f."
He stared at the screen. "I described this tool an hour ago. Told Claude Code what I wanted. It built the server, tested it, proved it worked. I connected with two commands. And it just worked from my phone." He shook his head. "When we connected our inventory system to the supplier's order platform at the warehouse, that took three weeks and two consultants. Same idea, different century."
He opened the dashboard. Tool badge confirmed: register_learner, called once, result returned.
Emma leaned over. "That feeling? I still get it. My first MCP server was a document lookup tool for a legal team. Three tools, nothing fancy. When the partner sent a WhatsApp message asking about a contract clause and the agent pulled the actual document section, not a summary, the actual text, I just sat there."
"How long ago was that?"
"Eight months. And I still remember the exact message." She paused. "I also remember my second server. Worked perfectly in tests. Connected to OpenClaw. The dashboard showed the tools. I sent a WhatsApp message and got... nothing. No error in chat. No tool badge. Thirty minutes of debugging."
"What was it?"
"I forgot to restart the gateway after changing the URL. Thirty minutes because the fix was one command."
James laughed. "I almost did the same thing."
"The pattern sticks after you almost lose time to it." Emma straightened up. "You proved the cycle works: describe, build, connect, verify. One tool, start to finish." She nodded toward his screen. "Module 9.3 takes this server and turns it into a product. More tools, persistent storage, payment gates. But the pattern is the same. Every new tool follows this cycle."
James took a screenshot of the WhatsApp conversation. "First thing I am showing the team on Monday."