Skip to content

Third-Party Integrations

Building powerful workflows with Claude Code often means connecting to external services and tools. This lesson explores how to integrate Claude Code with third-party systems, from databases to cloud platforms, creating a unified development environment that amplifies your productivity.

Scenario: You’re building a microservices architecture that needs to coordinate between GitHub for version control, PostgreSQL for data, Sentry for error monitoring, and AWS for deployment. Instead of juggling multiple tools, you want Claude to orchestrate everything.

Claude Code’s integration capabilities center around the Model Context Protocol (MCP), which provides a standardized way to connect external tools and services. Think of MCP servers as specialized assistants that Claude can call upon - each one expert in its domain.

Understanding MCP: Your Gateway to External Services

Section titled “Understanding MCP: Your Gateway to External Services”

The Model Context Protocol is Claude’s bridge to the outside world. When you connect an MCP server, you’re essentially giving Claude new capabilities - the ability to query databases, interact with APIs, or control cloud services.

Let’s start with a practical example: connecting to a PostgreSQL database.

  1. Add the PostgreSQL MCP server

    Terminal window
    claude mcp add postgres-local npx -y @modelcontextprotocol/server-postgresql -- \
    --connection-string "postgresql://user:pass@localhost:5432/myapp"
  2. Verify the connection

    Terminal window
    claude mcp list
    # You should see "postgres-local" in the list
  3. Use it in Claude

    > What tables exist in our database?
    > Show me the schema for the users table
    > Find all orders placed in the last week

Notice how Claude now understands your database structure? This is the power of MCP - Claude gains domain-specific knowledge and tools.

MCP Server Scopes: Local, Project, and User

Section titled “MCP Server Scopes: Local, Project, and User”

Where you configure an MCP server determines who can use it:

Terminal window
# Project scope - shared via .mcp.json (default)
claude mcp add github-api npx -y github-mcp-server
# User scope - available across all your projects
claude mcp add -s user my-tools /path/to/custom-server
# Local scope - just for you in this project
claude mcp add -s local dev-db docker run postgres-mcp

Pro tip: Use project scope for team tools, user scope for personal preferences, and local scope for sensitive connections.

Essential Integrations for Development Teams

Section titled “Essential Integrations for Development Teams”

While Claude can run git commands, the GitHub MCP integration unlocks powerful workflows:

Terminal window
# Add GitHub integration
claude mcp add github --transport sse \
--url https://api.github.com/mcp \
--header "Authorization: Bearer $GITHUB_TOKEN"

Now you can leverage GitHub’s full API:

> List all open issues labeled 'bug'
> Create a PR from the feature/auth branch with a detailed description
> Show me the review comments on PR #234
> What are the failing checks on our main branch?

Real-world scenario: Your team uses GitHub issues for task tracking. With the GitHub MCP server, you can say: “Find all issues assigned to me, pick the highest priority bug, create a branch, and start working on a fix.” Claude will:

  1. Query GitHub for your assigned issues
  2. Identify the highest priority bug
  3. Create an appropriately named branch
  4. Check out the branch locally
  5. Begin implementing a solution based on the issue description

Database Integrations: Read-Only by Design

Section titled “Database Integrations: Read-Only by Design”

Database MCP servers are typically read-only for safety. This is a feature, not a limitation:

Terminal window
# Complex analytical queries become conversational
> Show me user growth by month for the past year
> Which products have the highest return rate?
> Find customers who haven't ordered in 90 days

Modern development often involves multiple cloud services. Claude can orchestrate them all:

Terminal window
# Requires AWS CLI configured
claude mcp add aws npx -y aws-mcp-server
> List all EC2 instances in us-east-1
> Show me the Lambda functions with errors in the last hour
> Generate a Terraform config for our RDS setup
Terminal window
claude mcp add gcp --url https://mcp.cloudrun.googleapis.com/
> Deploy the current app to Cloud Run
> Check the status of our GKE clusters
> Update the Firebase security rules
Terminal window
claude mcp add cloudflare npx -y cloudflare-mcp
> Deploy the API to Workers
> Update the DNS records for the new subdomain
> Check R2 storage usage

Sometimes you need to integrate with internal tools or specialized services. Here’s how to approach custom integrations:

Even without an MCP server, Claude can interact with APIs:

> Call our internal API at https://api.internal/v1/users with GET
> POST to https://webhook.site/... with this JSON payload: {...}
> Parse this webhook response and extract the order IDs

For frequently used internal APIs, create a simple MCP wrapper:

custom-api-mcp.js
import { MCPServer } from '@modelcontextprotocol/sdk';
const server = new MCPServer();
server.addTool('get_feature_flags', async (params) => {
const response = await fetch('https://internal.api/flags');
return await response.json();
});
server.addTool('toggle_feature', async (params) => {
const response = await fetch(`https://internal.api/flags/${params.flag}`, {
method: 'PATCH',
body: JSON.stringify({ enabled: params.enabled })
});
return await response.json();
});
server.start();

Then add it to Claude:

Terminal window
claude mcp add feature-flags node /path/to/custom-api-mcp.js

Claude excels at coordinating multiple services. Here’s a real-world example:

“A customer reported an error. Check Sentry for details, find related logs in CloudWatch, identify the affected code, create a fix, and open a PR with the solution.”

With the right MCP servers configured, Claude will:

  1. Query Sentry for the error details
  2. Search CloudWatch logs for the timeframe
  3. Identify the stack trace and affected files
  4. Implement a fix based on the error pattern
  5. Create tests to prevent regression
  6. Open a PR with full context

Integrate Claude into your deployment pipeline:

GitHub Actions Integration

.github/workflows/claude-review.yml
name: Claude Code Review
on:
pull_request:
types: [opened, synchronize]
issue_comment:
types: [created]
jobs:
claude-action:
runs-on: ubuntu-latest
if: >
github.event_name == 'issue_comment' &&
github.event.issue.pull_request &&
contains(github.event.comment.body, '@claude')
steps:
- uses: actions/checkout@v4
- uses: anthropics/claude-code-action@v1
with:
api-key: ${{ secrets.ANTHROPIC_API_KEY }}
prompt: ${{ github.event.comment.body }}

Now team members can comment “@claude fix the failing tests” on any PR, and Claude will push fixes directly to the branch.

Create webhooks that trigger Claude for automated workflows:

webhook-handler.js
app.post('/webhook/deploy', async (req, res) => {
const { branch, commit } = req.body;
// Trigger Claude to validate deployment
exec(`claude -p "Validate deployment readiness for ${branch} at ${commit}.
Check: tests passing, no security issues, migrations ready"`);
res.json({ status: 'validation started' });
});

Never hardcode credentials. Use environment variables:

Terminal window
# Good: Reference environment variables
claude mcp add prod-db npx -y pg-mcp \
--connection-string "$DATABASE_URL"
# Bad: Hardcoded credentials
claude mcp add prod-db npx -y pg-mcp \
--connection-string "postgresql://admin:secretpass@..."

Configure minimal required permissions:

{
"mcpServers": {
"production-db": {
"command": "npx",
"args": ["pg-mcp-server"],
"env": {
"CONNECTION_STRING": "$PROD_DB_READONLY"
}
}
}
}

Use OAuth flows for third-party services:

Terminal window
# Claude will open browser for authentication
claude mcp add github --transport sse \
--url https://api.github.com/mcp
> /mcp
# Select "Authenticate" for the GitHub server

Problem: MCP server won’t connect

Terminal window
# Debug with verbose output
claude --mcp-debug
# Check server status
claude mcp list

Solution: Verify network access, check credentials, ensure the service is running

Let’s walk through a complete integration scenario:

Scenario: Your e-commerce platform needs a new recommendation engine that pulls data from multiple sources.

  1. Set up data source integrations

    Terminal window
    # Product database
    claude mcp add products pg-mcp --connection-string "$PRODUCT_DB"
    # User analytics
    claude mcp add analytics clickhouse-mcp --host analytics.local
    # Cache layer
    claude mcp add cache redis-mcp --url redis://cache:6379
  2. Design the system with Claude

    > Based on our product catalog and user analytics data, design a
    > recommendation system. Consider: purchase history, browsing patterns,
    > and product similarities. Show me the schema and data flow.
  3. Implement with real data

    > Implement the recommendation algorithm. Test it with actual user
    > data for customer_id=12345. Cache the results in Redis with 1-hour TTL.
  4. Deploy and monitor

    > Create a deployment script for AWS Lambda. Include CloudWatch
    > alerts for response time > 500ms and error rate > 1%.

Best Practices for Production Integrations

Section titled “Best Practices for Production Integrations”
  1. Version your MCP configurations - Check .mcp.json into git
  2. Use environment-specific configs - Separate dev/staging/prod MCP servers
  3. Monitor MCP server health - Set up alerts for connection failures
  4. Implement circuit breakers - Gracefully handle service outages
  5. Document integration points - Keep CLAUDE.md updated with available integrations

Integrations transform Claude Code from a coding assistant into a development platform. Start with one or two essential integrations, then gradually expand as you identify workflow bottlenecks. Remember: the goal isn’t to integrate everything, but to create a seamless development experience that amplifies your team’s capabilities.

Ready to automate your development pipeline? The next lesson covers Automation, where we’ll build on these integrations to create self-running workflows.