Loading lesson…
Model Context Protocol lets agents plug into your tools. A 40-line server exposes a real capability to Claude.
An MCP server exposes tools over stdio or HTTP. Any MCP-capable client (Claude Desktop, Cursor, Claude Code) can call them. Build once, use everywhere.
npm install @modelcontextprotocol/sdk zodOfficial SDK plus Zod for schemas.// server.ts
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
import { z } from "zod";
const server = new McpServer({
name: "word-tools",
version: "0.1.0",
});
server.tool(
"word_count",
"Count words in a string.",
{ text: z.string().min(1) },
async ({ text }) => {
const count = text.trim().split(/\s+/).length;
return {
content: [{ type: "text", text: String(count) }],
};
}
);
server.tool(
"reverse",
"Reverse a string.",
{ text: z.string() },
async ({ text }) => ({
content: [{ type: "text", text: [...text].reverse().join("") }],
})
);
const transport = new StdioServerTransport();
await server.connect(transport);Two tools, typed inputs, string outputs. Run with `node server.js` from an MCP-capable client config.// claude_desktop_config.json snippet
{
"mcpServers": {
"word-tools": {
"command": "node",
"args": ["/absolute/path/to/server.js"]
}
}
}Point Claude Desktop at your script. Restart, and the tools appear.Understanding "Building a Minimal MCP Server" in practice: AI-assisted coding shifts work from syntax recall to design thinking — models handle boilerplate so you focus on architecture. Model Context Protocol lets agents plug into your tools. A 40-line server exposes a real capability to Claude — and knowing how to apply this gives you a concrete advantage.
The big idea: MCP is the USB port for agents. Write a tiny server once, and every MCP client can use your tools.
15 questions · take it digitally for instant feedback at tendril.neural-forge.io/learn/quiz/end-progx-mcp-server-creators
What does MCP stand for in the context of AI agent tool integration?
Which transport mechanism uses stdout to send JSON-RPC messages?
A developer adds a console.log() statement to their MCP server for debugging. What problem does this cause when using stdio transport?
Where should a developer send log messages in an MCP server using stdio transport?
What analogy does the lesson use to describe MCP?
Which three clients are mentioned as examples of MCP-capable clients in the lesson?
What is JSON-RPC in the context of MCP servers?
What is the primary benefit of MCP's standardization described in the lesson?
Why does stdout need to be reserved exclusively for JSON-RPC messages in stdio transport?
A student builds an MCP server with exactly three tools. Based on the lesson, why might this be better than a version with ten tools?
What happens when an MCP-capable client connects to an MCP server?
What is a key characteristic of tools exposed by an MCP server using stdio transport?
What problem does the lesson identify with building an MCP server that exposes every possible tool?
What distinguishes focused tools from a comprehensive tool collection in MCP server design?
A developer wants to make their custom tool available to multiple different AI assistants. Based on the lesson, what is the most efficient approach?