Loading learning content…
Loading learning content…
Extend Claude Code with Model Context Protocol servers — connecting databases, APIs, and custom tools.
Read through the lesson, mark it complete when the concept is clear, then move to the next lesson in the sequence or jump back to the module map.
Model Context Protocol (MCP) is an open standard that lets Claude Code connect to external tools, databases, and services via a standardized interface. Instead of writing custom integrations, you install an MCP server and Claude gets immediate access to its capabilities.
MCP servers are configured in ~/.claude/settings.json:
{
"mcpServers": {
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_..."
}
}
}
}
Restart Claude Code and the server's tools are immediately available.
| Server | What It Provides |
|---|---|
server-github |
PR review, issue creation, code search |
server-postgres |
Direct database queries |
server-filesystem |
Extended file operations |
server-puppeteer |
Browser automation |
server-slack |
Slack messages and channels |
server-linear |
Issue tracking and project management |
Once installed, MCP tools appear alongside built-in tools. Ask Claude to use them naturally:
Create a GitHub issue for the bug we just fixed. Title it "Fix JWT expiry calculation"
and include the root cause analysis and the commit hash.
Claude calls the MCP tool, you approve, and the issue is created — no context switching.
If no existing server fits your needs, build one in TypeScript:
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
const server = new Server({ name: "my-tool", version: "1.0.0" });
server.setRequestHandler("tools/list", async () => ({
tools: [{
name: "query_analytics",
description: "Query our analytics database",
inputSchema: { type: "object", properties: { query: { type: "string" } } }
}]
}));
The real power comes from composing servers. In one session, Claude can:
This end-to-end automation happens in a single conversational session.