MCP Servers & Tools
Learning Outcomes
- Understand what MCP (Model Context Protocol) is and why it matters
- Install and configure MCP servers for Claude
- Use web search, GitHub, file system, and database MCP tools
- Scope MCP permissions and access
- Know when to use MCP vs when native Claude is enough
Lesson Plan
| Segment | Duration | Topic |
|---|---|---|
| Intro | 5 min | What MCP is and why it exists |
| Explain | 10 min | Architecture — servers, tools, resources |
| Demo | 15 min | Installing and configuring MCP servers |
| Demo | 12 min | Using MCP tools in practice |
| Explain | 8 min | Permissions and access |
| Demo | 7 min | Building a basic custom MCP server |
| Wrap-up | 3 min | Key takeaways |
Before You Begin
Pre-work:
- Complete Lesson 6
- Have Claude Code working in a project
Shopping List:
- Claude Code installed (recent version)
- npm/npx available
- Optional: GitHub account for GitHub MCP server
- Optional: a database (PostgreSQL, SQLite) for database MCP
Model Context Protocol (MCP) is an open standard that lets AI assistants connect to external tools and data sources. Think of it as a plugin system for Claude.
Without MCP: Claude can only read local files and run terminal commands.
With MCP: Claude can:
- Search the web for documentation
- Read and create GitHub issues and PRs
- Query databases directly
- Access your company's internal tools
- Interact with any API you connect
Architecture:
You ↔ Claude Code ↔ MCP Server ↔ External Service
│
(local process)
MCP servers run locally on your machine. They're bridges between Claude and external services. Claude "discovers" what tools a server offers and can use them when relevant.
Key concepts:
- MCP Server: A local process that exposes tools
- Tools: Actions Claude can take (search, create, read, write)
- Resources: Data sources Claude can access (files, databases, APIs)
MCP servers are configured in your Claude settings. Add them to .claude/settings.json or your global settings:
Configuration location:
- Project:
.claude/settings.json - Global:
~/.claude/settings.json
Example — adding a web search MCP:
{
"mcpServers": {
"web-search": {
"command": "npx",
"args": ["-y", "@anthropic-ai/mcp-server-web-search"],
"env": {
"BRAVE_API_KEY": "your-key-here"
}
}
}
}
Example — GitHub MCP:
{
"mcpServers": {
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {
"GITHUB_TOKEN": "ghp_your_token_here"
}
}
}
}
Example — filesystem MCP (for accessing files outside project):
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/allowed/dir"]
}
}
}
After adding configuration, restart Claude Code. Claude will detect the available MCP tools automatically.
env in the MCP config to reference them.Once configured, Claude uses MCP tools naturally when relevant:
Web search:
> What's the latest API for Next.js server actions?
> Search the documentation.
Claude searches the web, reads documentation, and gives you current information.
GitHub:
> What are the open issues labelled "bug" in this repository?
> Create an issue for the login timeout we discussed.
Claude reads issues, creates new ones, comments on PRs — all within conversation.
Database:
> Show me the schema of the users table.
> How many users signed up this week?
> What's the average order value for premium users?
Claude queries your database directly (read-only by default for safety).
You don't need to invoke tools explicitly. Claude decides when an MCP tool is relevant based on your request. If you ask about documentation and web search is available, it searches automatically.
Explicit tool use:
> Use web search to find the React 19 migration guide
> Use GitHub to check the status of PR #45
MCP servers are powerful — which means they require careful handling:
What MCP servers can do:
- Access external services with your credentials
- Read and write data
- Run network requests
- Access local files (if configured)
Access best practices:
- Principle of least privilege — only give servers the minimum permissions they need
- Use read-only where possible — database servers should default to SELECT only
- Scope tokens narrowly — GitHub tokens should only access what's needed
- Review server source — know what code is running on your machine
- Use project-level config — don't expose all MCP servers globally
Token scoping examples:
# GitHub: repo-only, no admin access
Token scopes: repo, read:org
# Database: read-only connection string
DATABASE_URL=postgresql://readonly_user:pass@host/db
What NOT to do:
- Give a database MCP server admin/write credentials
- Use a GitHub token with delete access
- Install MCP servers from untrusted sources
- Share your MCP config file (it may contain tokens)
The MCP ecosystem is growing fast. Key servers to know about:
| Server | What It Does | Use Case |
|---|---|---|
| Web Search | Search the internet | Finding documentation, checking APIs |
| GitHub | Issues, PRs, repos | Project management, code review |
| Filesystem | Access files outside project | Working across multiple projects |
| PostgreSQL | Query databases | Data analysis, schema exploration |
| SQLite | Local database access | Development databases |
| Linear | Issue tracking | Project management |
| Puppeteer | Browser automation | Testing, scraping |
Finding more servers:
- Official list: github.com/modelcontextprotocol/servers
- Community servers on npm (search
mcp-server-) - Build your own (see step 6)
You can build your own MCP server for project-specific tools:
Simple example — a deployment status checker:
// deploy-status-server.js
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
const server = new Server({
name: "deploy-status",
version: "1.0.0"
}, {
capabilities: { tools: {} }
});
server.setRequestHandler("tools/list", async () => ({
tools: [{
name: "check_deploy_status",
description: "Check the deployment status of our app",
inputSchema: {
type: "object",
properties: {
environment: {
type: "string",
enum: ["staging", "production"]
}
}
}
}]
}));
server.setRequestHandler("tools/call", async (request) => {
if (request.params.name === "check_deploy_status") {
// Your logic here — check CI/CD, hit an API, etc.
return {
content: [{ type: "text", text: "Production: v2.3.1, deployed 2h ago, healthy" }]
};
}
});
const transport = new StdioServerTransport();
await server.connect(transport);
Register it:
{
"mcpServers": {
"deploy": {
"command": "node",
"args": ["./tools/deploy-status-server.js"]
}
}
}
Now Claude can check deployment status naturally:
> What's the current deploy status of production?
This is advanced — most users won't need custom servers. But it's powerful for team-specific workflows.
Questions & Answers
Key Takeaways
- MCP extends Claude — from local files to external services and APIs
- Configuration in settings.json — add servers, restart Claude, they're available
- Claude uses tools automatically — no explicit invocation needed
- Access matters — least privilege, scoped tokens, trusted sources only
- Start with web search — the highest-value MCP server for most developers
- Custom servers possible — for team-specific tools and workflows
Next Steps: In Lesson 8 — Advanced Prompting Techniques, you'll learn structured prompting patterns that get better results for complex tasks.