What Is MCP?
The built-in tools (Bash, Read, Write) let your agent interact with the local file system. But real-world agents need to talk to everything — databases, APIs, cloud services, Slack, GitHub, Google Calendar, and more. That is what MCP (Model Context Protocol) is for.
MCP is an open standard that defines how AI agents connect to external tools and data sources. Instead of writing custom integration code for every service, you plug in an MCP server and your agent immediately knows how to use it. One protocol, infinite connections.
How MCP Works in the Agent SDK
The SDK makes MCP integration straightforward. You define MCP servers in your agent configuration, and the agent can use their tools alongside the built-in ones:
import { Claude } from "@anthropic-ai/claude-agent";
const agent = new Claude({
model: "claude-sonnet-4-6",
tools: "defaults",
// Connect MCP servers — each one adds new tools
mcpServers: {
// A database server that gives Claude SQL access
database: {
command: "npx",
args: ["@anthropic-ai/mcp-server-sqlite", "./data.db"],
},
// A GitHub server for repo operations
github: {
command: "npx",
args: ["@modelcontextprotocol/server-github"],
env: {
GITHUB_TOKEN: process.env.GITHUB_TOKEN,
},
},
},
});
// Now Claude can query the database AND interact with GitHub
const result = await agent.query(
"Check the database for users who signed up this week, then create a GitHub issue summarizing the count."
);
console.log(result.text);