Lesson completed!
-

MCP Integrations

MCP Integrations

The Model Context Protocol (MCP) lets Claude Code interact with external services and tools.

What is MCP?

MCP is a standard protocol that allows Claude to:

  • Connect to databases
  • Interact with GitHub
  • Query APIs
  • Access specialized tools

Built-in MCPs

Claude Code comes with several built-in integrations:

File System MCP

Already enabled by default:

> Read the config file at /etc/myapp/config.json
> Create a new file at src/components/Button.tsx

GitHub MCP

Interact with repositories:

> List open PRs on this repository
> Create a new issue for the auth bug
> Review PR #42

Browser MCP

Web browsing capability:

> Check the documentation at nextjs.org
> Find examples of rate limiting implementations

Configuring MCPs

MCPs are configured in your settings:

{
  "mcpServers": {
    "postgres": {
      "command": "mcp-postgres",
      "args": ["--connection-string", "$DATABASE_URL"]
    },
    "github": {
      "command": "mcp-github",
      "args": ["--token", "$GITHUB_TOKEN"]
    }
  }
}

Database MCP Example

Connect to your database:

> Query the users table to find inactive accounts

Claude can:

  • Run SELECT queries
  • Analyze data patterns
  • Suggest schema changes

Custom MCPs

You can create custom MCPs for your tools:

  1. Implement the MCP protocol
  2. Register the server
  3. Use from Claude Code

Example use cases:

  • Internal APIs
  • Custom linting tools
  • Deployment systems
  • Monitoring services

Best Practices

Security First

{
  "mcpServers": {
    "database": {
      "command": "mcp-postgres",
      "args": ["--read-only"]  // Limit permissions
    }
  }
}

Use Environment Variables

Never hardcode credentials:

{
  "args": ["--token", "$GITHUB_TOKEN"]  // Use env var
}

Start Limited

Begin with read-only access, expand as needed.

Next Steps

In the next lesson, you'll learn about hooks for automating workflows.