MCP Servers Explained
What MCP servers are, how AI clients like Claude Code call their tools, how to add one through .mcp.json, and how to build your own in TypeScript.

Last updated: April 2, 2026
MCP Servers Explained
Prerequisites: Node.js 18+, an AI coding tool that supports MCP (Claude Code, Cursor, or Windsurf), and basic TypeScript/JavaScript knowledge.
MCP (Model Context Protocol) lets AI tools connect to external services. Think of it as USB ports for AI -- plug in any tool and your AI agent can use it.
How it works
- An MCP server exposes tools (functions the AI can call)
- Your AI client (Claude Code, Cursor, etc.) connects to the server
- The AI can now call those tools as part of its workflow
Example: DevDigest MCP Server
The dd mcp command starts an MCP server with these tools:
init_project-- Scaffold a new projectlist_commands-- Show available commands
Add to Claude Code
In your project's .mcp.json:
{
"mcpServers": {
"devdigest": {
"command": "dd",
"args": ["mcp"]
}
}
}
Build your own MCP server
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: "my-server",
version: "1.0.0",
});
server.tool(
"hello",
"Say hello",
{ name: z.string() },
async ({ name }) => ({
content: [{ type: "text", text: `Hello, ${name}!` }],
})
);
const transport = new StdioServerTransport();
await server.connect(transport);
Agent prompt
Copy this to give your AI agent MCP context:
This project uses MCP servers for external tool integration. Check .mcp.json for available servers. You can call MCP tools directly -- they appear as regular tools in your tool list.
FAQ
What is an MCP server?
An MCP server exposes tools, which are functions an AI can call, over the Model Context Protocol. Your AI client, such as Claude Code or Cursor, connects to the server and can then call those tools as part of its workflow. Think of it as USB ports for AI.
How do I add an MCP server to Claude Code?
Add an entry under mcpServers in your project's .mcp.json, giving the server a name plus the command and args that start it. For the DevDigest server that is "command": "dd" with "args": ["mcp"].
What do I need to build my own MCP server?
Node.js 18+, basic TypeScript or JavaScript knowledge, and the @modelcontextprotocol/sdk package. Create an McpServer, register a tool with a name, description and a zod input schema, then connect it to a StdioServerTransport.
Continue Reading
Technical content at the intersection of AI and development. Building with AI agents, Claude Code, and modern dev tools - then showing you exactly how it works.
Was this helpful?
Related Guides
Claude Code Setup Guide
Configure Claude Code for maximum productivity -- CLAUDE.md, sub-agents, MCP servers, and autonomous workflows.
Building Your First MCP Server
Step-by-step guide to building an MCP server in TypeScript - from project setup to tool definitions, resource handling, testing, and deployment.
AI Agent Frameworks Compared: LangGraph vs CrewAI vs Mastra vs CopilotKit
Deep comparison of the top AI agent frameworks - LangGraph, CrewAI, Mastra, CopilotKit, AutoGen, and Claude Code.
Related Tools
DeepSeek-TUI
Open-source (MIT) terminal coding agent, renamed Codewhale, with Plan, Work, and Operate modes, approval postures, /undo...
View ToolMCP Inspector
Visual testing tool for Model Context Protocol servers. Like Postman for MCP - call tools, browse resources, and view...
View ToolMCP Hub
Centralized manager for MCP servers. Connect once to localhost:37373 and access all your servers through a single endpoi...
View ToolSmithery
Registry and hosting platform for MCP servers, now part of Arcade.dev. 27,300+ MCPs listed. One-command install and conf...
View ToolRelated Videos
Related Posts

Anthropic Cuts Disclosure to 30 Days: What Maintainers Do
Anthropic is cutting its vulnerability disclosure window from 90 days to 30 for high and critical bugs, effective Januar...

Coding Agent Harness Benchmark: Same Model, 17.5x Cost Gap
FrontierHarness ran one model through 9 coding agent harnesses. Pass rates sat within 17 points, median cost per pass sp...

Claude Code Code Mode: How to Turn It On and What It Changes
Claude Code Code Mode lets Claude write JavaScript that makes several tool calls in one step. Turn it on with CLAUDE_COD...

AI-Generated Code and Technical Debt: Is Your Codebase Fragile?
A viral essay argues AI-written code makes codebases fragile: shallow tests, needless complexity, lost understanding, no...

AlphaProof Code: AI Agents Formally Verified Signal's Code
Google DeepMind used AI agents to prove security properties of the libsignal machine code in Lean. What the paper actual...

Amazon Swapped Sonnet 4.6 for a Decision Model: What It Does and Doesn't Replace
Amazon engineers replaced Sonnet 4.6 on a 20-label ticket classifier with Strands Decider, a small decision model, at ab...

