Back to Blog

Claude MCP Integration: The Complete Guide

Ultrion TeamJuly 18, 202612 min read

Claude MCP Integration: The Complete Guide

How to use MCP tools with Anthropic's Claude for maximum productivity.


Claude has the most mature MCP integration of any AI assistant. Anthropic co-created the protocol, and Claude's implementation is the reference standard. This guide covers everything from setup to advanced patterns.


Why Claude + MCP?

Claude's MCP integration provides:

  • Native support β€” No adapters or workarounds needed
  • Desktop and API β€” Works in Claude Desktop, Claude API, and Claude Code
  • Tool selection β€” Claude intelligently chooses the right tool for each task
  • Multi-tool chaining β€” Claude can use multiple tools in sequence
  • Streaming progress β€” Real-time updates during long operations

Setting Up MCP in Claude Desktop

Configuration File

// ~/Library/Application Support/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-filesystem", "/Users/me/projects"],
    },
    "github": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-github"],
      "env": {
        "GITHUB_TOKEN": "ghp_xxxxx"
      }
    },
    "database": {
      "command": "node",
      "args": ["/path/to/my-db-server.js"],
      "env": {
        "DATABASE_URL": "postgresql://..."
      }
    }
  }
}

After Configuration

  1. Restart Claude Desktop
  2. Claude discovers all MCP tools automatically
  3. Tools appear in the conversation interface
  4. Claude uses them when relevant

Setting Up MCP with Claude API

import anthropic

client = anthropic.Anthropic()

# Define MCP tools in the API call
response = client.messages.create(
    model="claude-sonnet-4-2026",
    max_tokens=4096,
    tools=[
        {
            "type": "mcp",
            "server_label": "database",
            "server_url": "https://my-mcp-server.example.com/sse",
            "headers": {"Authorization": "Bearer token123"},
        },
        {
            "type": "mcp",
            "server_label": "github",
            "server_url": "https://github-mcp.example.com/sse",
        },
    ],
    messages=[
        {"role": "user", "content": "What are the most recent issues in my repo?"}
    ],
)

Claude automatically:

  1. Discovers tools from each MCP server
  2. Selects the appropriate tool
  3. Calls it with correct parameters
  4. Uses the results to answer

Setting Up MCP with Claude Code (CLI)

# Install Claude Code
npm install -g @anthropic-ai/claude-code

# Configure MCP servers
claude mcp add filesystem -- npx -y @modelcontextprotocol/server-filesystem ./
claude mcp add github -- npx -y @modelcontextprotocol/server-github
claude mcp add database -- node ./tools/db-mcp-server.js

# List configured servers
claude mcp list

# Use Claude Code β€” it automatically uses MCP tools
claude "Review the latest PR and check if any database migrations are needed"

Popular MCP Servers for Claude

Filesystem Server

npx -y @modelcontextprotocol/server-filesystem /path/to/project

Claude can read, write, and search files in the specified directory.

GitHub Server

export GITHUB_TOKEN=ghp_xxxxx
npx -y @modelcontextprotocol/server-github

Claude can read issues, PRs, code, and more from GitHub.

Database Server

// Custom database MCP server for Claude
import { McpServer } from "@modelcontextprotocol/sdk";

const server = new McpServer({ name: "postgres-tools" });

server.tool("query", {
  sql: z.string().refine(sql => sql.trim().toUpperCase().startsWith("SELECT"),
    "Only SELECT queries allowed"),
}, async (args) => {
  const results = await pool.query(args.sql);
  return { content: [{ type: "text", text: JSON.stringify(results.rows, null, 2) }] };
});

server.tool("schema", {}, async () => {
  const tables = await pool.query(`
    SELECT table_name, column_name, data_type
    FROM information_schema.columns
    WHERE table_schema = 'public'
  `);
  return { content: [{ type: "text", text: JSON.stringify(tables.rows) }] };
});

Web Search Server

server.tool("search", {
  query: z.string(),
  max_results: z.number().default(10),
}, async (args) => {
  const results = await searchEngine.search(args.query, args.max_results);
  return {
    content: results.map(r => ({
      type: "text",
      text: `${r.title}\n${r.url}\n${r.snippet}`,
    })),
  };
});

Advanced Patterns

Multi-Server Orchestration

Claude can use tools from multiple MCP servers in a single conversation:

User: "Check the latest GitHub issues, cross-reference with our database schema,
      and suggest which issues need database changes."

Claude:
1. [GitHub MCP] Fetches recent issues
2. [Database MCP] Gets current schema
3. [Analysis] Cross-references issues with schema
4. [GitHub MCP] Posts comments with recommendations

Context Persistence

// MCP server that maintains context across tool calls
server.tool("start_analysis", { project: z.string() }, async (args) => {
  // Load project context into memory
  const context = await loadProjectContext(args.project);
  server.state.set("current_project", context);
  return { content: [{ type: "text", text: "Project context loaded" }] };
});

server.tool("analyze_security", {}, async () => {
  const project = server.state.get("current_project");
  const issues = await securityScan(project);
  return { content: [{ type: "text", text: JSON.stringify(issues) }] };
});

Custom Permission Flows

server.tool("deploy_to_production", {
  version: z.string(),
}, async (args, context) => {
  // Require human approval for production deploys
  const approval = await context.requestHumanApproval({
    message: `Deploy version ${args.version} to production?`,
    timeout: 300000, // 5 minutes
  });

  if (!approval.approved) {
    return { content: [{ type: "text", text: "Deployment cancelled" }] };
  }

  const result = await deploy(args.version);
  return { content: [{ type: "text", text: `Deployed: ${result.url}` }] };
});

Claude Desktop vs API vs Code

Feature Claude Desktop Claude API Claude Code
MCP Support Full Full Full
Setup Config file API parameter CLI command
UI for tool calls Visual indicators Programmatic Terminal
Human approval Built-in prompts Custom code Terminal prompts
Multi-server βœ… βœ… βœ…
Best for Daily use Applications Development

Debugging MCP in Claude

Check Server Status

# In Claude Code
claude mcp status

# Output:
# βœ“ filesystem: Running (3 tools)
# βœ“ github: Running (12 tools)
# βœ— database: Failed to start

Debug Logging

# Enable MCP debug logging
claude --mcp-debug

# Or in config
export MCP_DEBUG=true

Common Issues

Issue Solution
Server not starting Check command path and dependencies
Tools not appearing Restart Claude after config changes
Tool calls failing Check server logs and permissions
Timeout errors Increase timeout in config
Auth failures Verify API keys and tokens

Publishing MCP Servers for Claude Users

If you build an MCP server, publish it so Claude users can use it:

  1. Build your MCP server
  2. Test with Claude Desktop or Claude Code
  3. Publish on SkillExchange
  4. Document installation instructions
  5. Share with the Claude community
# Users install your server from SkillExchange
claude mcp add-from-skillexchange my-awesome-tool

Best Practices

For Tool Design

  1. Clear descriptions β€” Claude relies on these to select tools
  2. Simple schemas β€” Fewer parameters = better tool selection
  3. Descriptive error messages β€” Help Claude recover from failures
  4. Idempotent operations β€” Safe to call multiple times
  5. Fast responses β€” Keep tool calls under 5 seconds

For Security

  1. Read-only by default β€” Require explicit permissions for writes
  2. Input validation β€” Never trust AI-generated inputs blindly
  3. Rate limiting β€” Prevent Claude from calling tools too frequently
  4. Audit logging β€” Track all tool invocations
  5. Sandbox β€” Run MCP servers with minimal permissions

Conclusion

Claude's MCP integration is the gold standard for AI-tool interaction. Whether you're using Claude Desktop for daily tasks, the API for applications, or Claude Code for development, MCP tools dramatically expand what Claude can do.

The ecosystem is growing rapidly β€” check SkillExchange regularly for new MCP servers you can add to your Claude setup.


Learn More

Browse Claude MCP tools on SkillExchange.

Newsletter

Enjoying this article?

Get weekly insights on building and selling AI skills, MCP tools, and creator economics. Join 2,000+ AI builders and creators.

No spam. Unsubscribe anytime.

Related Articles

Ready to try AI skills?

Browse the marketplace and discover skills for your AI agents.

Browse Skills