Hey dev, how's it going?
A few months ago, everyone was talking about AI and Agents. Now, there’s a fresh buzzword lighting up the tech world: MCP. Don’t worry—it’s not the next Marvel villain or a secret NASA chip.
Honestly? Until recently, the only “agent” I knew was 007… 😂
But today, I’m going to walk you through how to build your own MCP (Model Context Protocol) server using Node.js (yes, Node, not Go!), integrate it with Claude Desktop, and give your AI assistant the superpower to interact directly with APIs—without you ever needing to copy and paste JSON manually.
Let’s break this down carefully so that both junior and senior developers can follow along.
What is MCP (Model Context Protocol)?
The MCP is an open, standardized protocol (released in early 2025) that allows applications and services to provide structured, live context to Large Language Models (LLMs) like Claude. In short, it’s a two-way communication bridge: your tools and data can now talk directly to your LLM.
Before MCP, if you wanted your assistant to know something, you had to copy-paste outputs, logs, or reports—or worse, manually describe data or system states. With MCP, your assistant can securely, reliably, and consistently access real-time external data.
The protocol defines:
- Metadata format: Describes what a server can do.
- Action format: Defines the operations (or tools) available.
- Request/response format: Structures how data is exchanged.
- Authentication & authorization: Ensures secure, controlled access.
How does MCP work?
Here’s the flow:
- MCP Servers: Any app or service that exposes MCP-compliant endpoints, declaring its tools and capabilities.
- MCP Clients: Systems like Claude Desktop that discover, connect to, and interact with available MCP servers.
- Communication flow:
- Claude Desktop discovers available MCP servers.
- The user makes a request needing live system context.
- Claude Desktop identifies the right MCP server.
- It sends a structured request.
- The server processes and returns structured data.
- Claude integrates the result into the user’s conversation.
Everything is explicitly authorized: the user decides which servers can talk to their assistant.
Why should you care?
This setup unlocks massive advantages:
✅ No more copy-pasting data: Claude can directly pull API results.
✅ Always live data: You get current, fresh responses.
✅ Accessible to non-technical users: Anyone can query complex systems using plain language.
✅ Huge productivity gains: You can stack or automate workflows that used to need multiple tools.
✅ Lower learning curve: Juniors don’t need to master every API; they just ask questions.
✅ Safe & private: Only explicitly permitted data flows through.
Imagine saying, “How many active users did we have last week?” and getting the precise answer without opening Postman, Kibana, or your database console.
Docker MCP: your launchpad
Docker MCP makes this even easier by packaging MCP servers as Docker containers. Here’s why that matters:
- Standardized: Everyone follows the same integration spec.
-
Easy to deploy:
docker run
and you’re off. - Portable: Runs anywhere Docker runs.
- Pre-built servers: Browse ready-to-use integrations in the Docker Hub MCP catalog.
Quickstart Docker setup
docker run -d -p 11434:11434 -v /var/run/docker.sock:/var/run/docker.sock docker/mcp-server
docker run -d --label mcp.enabled=true mcp/github
docker run -d --label mcp.enabled=true mcp/petstore
Once running, Claude Desktop connects to http://localhost:11434
and discovers all enabled MCP servers.
Diving into the PetStore API example
Let’s focus on the PetStore API—a demo API often used for testing. It’s great for practicing because it simulates a live system for managing pets, orders, and users.
Setting it up in Claude Desktop
In your Claude configuration, you’d link the PetStore MCP server like this:
{
"mcpServers": {
"petstoreGateway": {
"command": "docker",
"args": [
"run", "--rm", "-i",
"-e", "API_1_NAME=petstore",
"-e", "API_1_SWAGGER_URL=https://petstore.swagger.io/v2/swagger.json",
"-e", "API_1_BASE_URL=https://petstore.swagger.io/v2",
"rflpazini/mcp-api-gateway"
]
}
}
}
Sample use cases: talking to PetStore
Example 1: Querying Available Pets
User: "Claude, list all available pets for adoption."
Claude: [Fetching from PetStore API…]
"Here are the currently available pets:
- Dog (ID 101)
- Cat (ID 102)
- Parrot (ID 103)"
Example 2: Placing an order
User: "Claude, place an order for pet ID 101 for customer John Doe."
Claude: [Processing via MCP…]
"Order placed successfully:
- Order ID: 5001
- Pet ID: 101
- Customer: John Doe"
Example 3: Checking order status
User: "Claude, check the status of order 5001."
Claude: [Querying MCP…]
"Order 5001 is currently marked as 'Processing'."
Example 4: Adding a new pet
User: "Claude, add a new pet: name 'Buddy', type 'Dog', status 'Available'."
Claude: [Calling PetStore API…]
"New pet 'Buddy' has been successfully added to the inventory!"
Deep Dive: why this matters for all developers
For junior devs, MCP abstracts the complexity: they don’t need to memorize API endpoints, craft curl requests, or handle auth headers. They just interact through conversation.
For senior devs, MCP opens up automation, scalability, and integration potential: you can design multi-step workflows, run cross-service queries, and even set up self-updating dashboards powered by conversational requests.
Plus, you can extend the system: add more APIs, build custom MCP servers, and define fine-grained controls over what’s exposed.
Final thoughts
The MCP + Docker combo is a game changer for how we interact with APIs and systems. It flattens the learning curve, boosts team efficiency, and turns conversational interfaces into real power tools for both tech-savvy and non-technical users.
So... what API will you connect to Claude first?
Check out the complete project on GitHub and start transforming your workflow today!
Top comments (1)
Some comments may only be visible to logged-in visitors. Sign in to view all comments.