Lab 3.4: Connecting to the Outside World
Module: 3.4 - MCP Integration | ← SlidesDuration: 30 minutes Sample Project: hackathon-starter
Learning Objectives
By the end of this lab, you will be able to:
- Understand what MCP (Model Context Protocol) is
- Configure Claude to use MCP servers
- Use external tools in your prompts
- Integrate external data into coding tasks
Prerequisites
- Completed previous Day 3 labs
- Node.js installed
- Basic understanding of APIs
What is MCP?
Model Context Protocol is a standard for connecting AI assistants to external tools and data sources.
Without MCP, Claude is limited to:
- Reading local files
- Running shell commands
- Web searches
With MCP, Claude can:
- Query databases
- Fetch Jira tickets
- Access Figma designs
- Call any API you configure
Setup
# Navigate to the sample project
cd sample-projects/hackathon-starter
# Start Claude Code
claudeTask 1: Explore Built-in MCP Tools
Time: 10 minutes
Claude Code comes with some built-in capabilities. Let's explore what's available.
Check available tools:
What MCP servers are currently connected?Try the web fetch capability:
Fetch the GitHub API to get info about the hackathon-starter repo:
https://api.github.com/repos/sahat/hackathon-starterSuccess criteria:
- [ ] Understand what tools are available
- [ ] Successfully fetched external data
Task 2: Use External Data in Code
Time: 10 minutes
Now use fetched data to inform a coding task.
Prompt:
1. Fetch the latest release info from: https://api.github.com/repos/sahat/hackathon-starter/releases/latest
2. Based on the release notes, identify what changed
3. Check if our local codebase might be affected by these changesAlternative if no releases:
1. Fetch the package.json from: https://raw.githubusercontent.com/sahat/hackathon-starter/master/package.json
2. Compare it with our local package.json
3. Identify any dependency version differencesSuccess criteria:
- [ ] External data fetched
- [ ] Data used to inform analysis
- [ ] Actionable insights generated
Task 3: Understand MCP Configuration
Time: 10 minutes
Learn how MCP servers are configured.
View the MCP configuration:
# Check global MCP config
cat ~/.claude/settings.json | grep -A 20 "mcpServers"
# Or ask ClaudePrompt:
Show me how to configure an MCP server in Claude Code settings.
What would the configuration look like for a hypothetical Jira server?Example MCP configuration structure:
{
"mcpServers": {
"jira": {
"command": "npx",
"args": ["-y", "@anthropic/mcp-server-jira"],
"env": {
"JIRA_URL": "https://your-company.atlassian.net",
"JIRA_TOKEN": "your-api-token"
}
}
}
}Success criteria:
- [ ] Understand MCP configuration structure
- [ ] Know where settings are stored
- [ ] Can explain how to add a new MCP server
MCP Use Cases
| MCP Server | Use Case |
|---|---|
| Jira | "Fetch ticket PROJ-123 and implement it" |
| Figma | "Get the design for the login page" |
| Database | "Query the users table for schema" |
| Slack | "Post a deployment notification" |
| GitHub | "List open PRs for this repo" |
How MCP Works
Your Prompt → Claude → MCP Server → External Tool → Response → Claude → Your Answer- You ask Claude something that needs external data
- Claude recognizes an MCP tool can help
- Claude calls the MCP server
- MCP server fetches data from external source
- Data returns to Claude
- Claude incorporates it into the response
Tips for Success
- Start with read-only - Fetch data before allowing writes
- Secure credentials - Use environment variables, not hardcoded tokens
- Test incrementally - Verify each MCP server works before combining
Troubleshooting
MCP server not found:
- Check the server is installed (
npxcommands download on first use) - Verify the command path is correct
Authentication errors:
- Ensure environment variables are set
- Check API tokens haven't expired
Timeout errors:
- External service might be slow
- Try simpler queries first
Common MCP Servers
Official Anthropic servers:
@anthropic/mcp-server-github- GitHub integration@anthropic/mcp-server-slack- Slack integration@anthropic/mcp-server-postgres- PostgreSQL queries
Community servers:
- Search npmjs.com for "mcp-server-*"
Stretch Goals
If you finish early:
- Research available MCP servers on npm
- Plan which MCP integrations would help your real projects
- Write a proposal for MCP servers your team should adopt
Deliverables
At the end of this lab, you should have:
- Understanding of MCP architecture
- Experience using external data in prompts
- Knowledge of MCP configuration
- Ideas for MCP servers useful to your team
Next Steps
After completing this lab, move on to Lab 3.5: AI Peer Review.