Skip to main content

Lesson 7: MCP Integrations

Learning Objectives

After completing this lesson, you will be able to:

  • Understand what MCP is and its purpose
  • Distinguish between HTTP, SSE, and STDIO server types
  • Add MCP servers to your configuration
  • Use common MCP integrations (GitHub, databases, etc.)
  • Understand MCP installation scopes
  • Leverage MCP tools in conversations

Prerequisites

  • Completed Lessons 1-6 - Core operations and configuration
  • Comfortable editing JSON - MCP configuration uses JSON
  • API access - Some MCP servers require API keys

Estimated Time: 25 minutes


What is MCP?

MCP (Model Context Protocol) is a protocol that allows Claude Code to connect to external tools and data sources.

Why MCP Exists

Extend Capabilities:

  • Connect to external APIs
  • Access databases
  • Integrate with third-party services
  • Use specialized tools

Standardization:

  • Universal protocol for integrations
  • Consistent interface across providers
  • Easy to add new connections

Flexibility:

  • Mix and match integrations
  • Custom and community servers
  • Project-specific configurations

What MCP Enables

Without MCP:

Claude can only work with local files and commands

With MCP:

Claude can:
- Read GitHub issues and PRs
- Query databases
- Search documentation
- Access cloud storage
- Interact with APIs
- And much more...

MCP Server Types

MCP servers communicate with Claude Code in three different ways.

Type 1: HTTP Servers

Communication: HTTP/HTTPS requests Best for: Cloud services, web APIs Configuration: URL + headers

Example:

{
"mcpServers": {
"my-api": {
"url": "https://api.example.com/mcp",
"headers": {
"Authorization": "Bearer YOUR_TOKEN"
}
}
}
}

Use cases:

  • SaaS integrations
  • Cloud services
  • REST APIs
  • GraphQL endpoints

Type 2: SSE (Server-Sent Events)

Communication: Persistent HTTP connection with streaming Best for: Real-time updates, streaming data Configuration: URL + optional headers

Example:

{
"mcpServers": {
"streaming-service": {
"transport": "sse",
"url": "https://stream.example.com/mcp"
}
}
}

Use cases:

  • Real-time monitoring
  • Live data feeds
  • Event-driven services
  • Streaming analytics

Type 3: STDIO (Standard Input/Output)

Communication: Local process communication Best for: Local tools, scripts, utilities Configuration: Command + arguments

Example:

{
"mcpServers": {
"local-tool": {
"command": "python",
"args": ["/path/to/server.py"]
}
}
}

Use cases:

  • Local development tools
  • File system utilities
  • Database connectors
  • Custom scripts

Adding MCP Servers

You configure MCP servers in your settings file.

Step 1: Choose Configuration Scope

Project-specific (recommended):

.claude/settings.json

User-wide:

~/.config/claude-code/settings.json

Step 2: Add MCP Configuration

Edit your settings file to include the mcpServers section:

{
"model": "claude-sonnet-4-5",
"mcpServers": {
"server-name": {
// Server configuration here
}
}
}

Step 3: Restart Claude Code

After modifying configuration, restart your session:

You> /exit

Then start again:

claude

Common MCP Integrations

Let's explore popular MCP servers you can use.

GitHub MCP Server

Purpose: Access GitHub repositories, issues, PRs

Installation (STDIO):

{
"mcpServers": {
"github": {
"command": "npx",
"args": ["-y", "@anthropic/mcp-server-github"],
"env": {
"GITHUB_TOKEN": "your-github-token-here"
}
}
}
}

Get GitHub Token:

  1. Go to github.com → Settings → Developer settings
  2. Personal access tokens → Tokens (classic)
  3. Generate new token (repo permissions)

Usage:

You> List open issues in anthropic/claude-code repository
You> Show me PR #123 from microsoft/vscode
You> Search for functions related to authentication in our repo

Database MCP Server

Purpose: Query SQL databases directly

Example (PostgreSQL):

{
"mcpServers": {
"postgres": {
"command": "mcp-server-postgres",
"args": ["postgresql://user:pass@localhost/db"],
"env": {
"DATABASE_URL": "postgresql://user:pass@localhost/db"
}
}
}
}

Usage:

You> List all users in the database
You> Find orders created in the last 7 days
You> Show the schema for the products table

Filesystem MCP Server

Purpose: Extended file system operations

Configuration:

{
"mcpServers": {
"filesystem": {
"command": "mcp-server-filesystem",
"args": ["/path/to/allowed/directory"]
}
}
}

Usage:

You> List all files larger than 1MB in the project
You> Find all Python files modified today
You> Show directory tree structure

Jira MCP Server

Purpose: Integrate with Atlassian Jira

Configuration:

{
"mcpServers": {
"jira": {
"command": "mcp-server-jira",
"env": {
"JIRA_URL": "https://your-domain.atlassian.net",
"JIRA_EMAIL": "your-email@example.com",
"JIRA_API_TOKEN": "your-api-token"
}
}
}
}

Usage:

You> List all open JIRA tickets assigned to me
You> Show details for ticket PROJ-123
You> Create a new bug report for the login issue

Web Search MCP Server

Purpose: Search the web for current information

Configuration:

{
"mcpServers": {
"web-search": {
"command": "mcp-server-brave-search",
"env": {
"BRAVE_API_KEY": "your-brave-api-key"
}
}
}
}

Usage:

You> Search for the latest React best practices
You> Find documentation for Python 3.12 features
You> What are the current trends in microservices?

MCP Installation Scopes

Like settings, MCP servers can be configured at different scopes.

Project-Level MCP

File: .claude/settings.json

Use when:

  • MCP server is specific to this project
  • Team members need the same integration
  • Git-tracked configuration is desired

Example:

{
"mcpServers": {
"project-db": {
"command": "mcp-server-postgres",
"args": ["postgresql://localhost/project_db"]
}
}
}

User-Level MCP

File: ~/.config/claude-code/settings.json

Use when:

  • Personal tools you use across projects
  • API keys specific to you
  • Development utilities

Example:

{
"mcpServers": {
"github": {
"command": "npx",
"args": ["-y", "@anthropic/mcp-server-github"],
"env": {
"GITHUB_TOKEN": "my-personal-token"
}
}
}
}

Managed MCP

Location: Installation directory

Includes:

  • Built-in MCP servers
  • Default integrations
  • Core functionality

Not editable directly - Use project or user scopes for customization.


Using MCP Tools in Conversations

Once configured, MCP tools become available in your conversations.

Discovering Available Tools

List MCP tools:

You> What MCP tools are available?

Check specific server:

You> What tools can the GitHub server provide?

Using MCP Tools

MCP tools are used automatically when relevant:

Example 1: GitHub Integration

You> Show me the latest issues in the React repository

Claude: [Uses GitHub MCP tool]
I found 5 open issues in facebook/react:
1. #12345 - useState hook not updating...
2. #12346 - TypeError in component...
...

Example 2: Database Query

You> How many users signed up this week?

Claude: [Uses database MCP tool]
[Executes SQL query]
According to the database, 127 new users signed up this week.

Example 3: Web Search

You> What's the current version of Node.js?

Claude: [Uses web search MCP tool]
The current LTS version of Node.js is v20.11.0...

Explicit MCP Tool Usage

You can also explicitly request MCP tools:

You> Use GitHub to search for issues related to authentication
You> Query the database for all orders over $100
You> Search the web for TypeScript 5.3 features

Practical Example: Setting Up GitHub MCP

Let's configure a real MCP integration.

Step 1: Get GitHub Token

  1. Visit github.com
  2. Click your avatar → Settings
  3. Developer settings → Personal access tokens
  4. Tokens (classic) → Generate new token
  5. Check repo permissions
  6. Generate and copy the token

Step 2: Configure MCP

Edit your user settings:

nano ~/.config/claude-code/settings.json

Add:

{
"mcpServers": {
"github": {
"command": "npx",
"args": ["-y", "@anthropic/mcp-server-github"],
"env": {
"GITHUB_TOKEN": "your-actual-token-here"
}
}
}
}

Step 3: Restart Claude Code

claude

Step 4: Test the Integration

You> List open issues in the anthropic/claude-code repository

Claude: [Connects to GitHub via MCP]

I found several open issues:
1. #456 - Feature request: Add syntax highlighting
2. #457 - Bug: Permission prompts not showing
3. #458 - Documentation: Update MCP examples

Step 5: Explore More

You> Show me pull request #450 from that repository
You> Search for issues about MCP in the claude-code repo
You> Who are the top contributors to this repository?

✅ Check Your Understanding

  1. What does MCP stand for?

    • Model Context Protocol
    • Multi-Cloud Platform
    • Machine Control Protocol
    • Message Communication Protocol
  2. Which MCP server type is best for cloud APIs?

    • STDIO
    • HTTP
    • SSE
    • TCP
  3. Where would you configure a project-specific MCP server?

    • ~/.config/claude-code/settings.json
    • .claude/settings.json
    • /etc/claude/mcp.json
    • mcp-config.json
  4. True or False: MCP tools must be explicitly invoked.**

    • True
    • False - Claude can use them automatically when relevant
  5. Which MCP server type communicates via standard input/output?

    • HTTP
    • SSE
    • STDIO
    • WebSocket

Answers: 1-a, 2-b, 3-b, 4-False, 5-c


Summary

In this lesson, you learned:

  • What MCP is - Protocol for external integrations
  • Three server types - HTTP, SSE, STDIO
  • Adding servers - Configure in settings file
  • Common integrations - GitHub, databases, Jira, web search
  • Installation scopes - Project vs. user-level configuration
  • Using tools - Automatic or explicit invocation

Next Steps

In Lesson 8: Advanced Features, you'll learn:

  • How subagents work (Explore, Plan, Bash)
  • Running background tasks
  • Setting up hooks for automation
  • Session management and persistence

Further Reading


Continue to Lesson 8: Advanced Features