DEV Community

brian austin
brian austin

Posted on

Claude Code MCP servers: how to connect any tool in under 5 minutes

Claude Code MCP Servers: How to Connect Any Tool in Under 5 Minutes

MCP (Model Context Protocol) is the most underused feature in Claude Code. Most developers run Claude Code in isolation — but with MCP servers, you can give Claude direct access to your database, browser, file system, APIs, and more.

Here's how to set it up in under 5 minutes.

What MCP Actually Does

Without MCP, Claude Code can only interact with your project via file reads, bash commands, and the tools it ships with.

With MCP, Claude Code gets new tools that you define — and it can call them natively during a conversation.

Real examples:

  • Query your PostgreSQL database directly
  • Browse URLs and scrape pages
  • Search your codebase semantically
  • Read from Google Sheets
  • Call internal APIs

Step 1: Add an MCP Server to Your Config

MCP servers are configured in ~/.claude/settings.json (global) or .claude/settings.json (project-level).

{
  "mcpServers": {
    "postgres": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-postgres", "postgresql://localhost/mydb"]
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

That's it. Restart Claude Code and it will now have a query_database tool available.

Step 2: Test That It's Connected

In Claude Code, just ask:

> What tables are in my database?
Enter fullscreen mode Exit fullscreen mode

Claude will call the MCP tool and return real results from your DB.

Built-in MCP Servers Worth Adding

These are official servers from the MCP ecosystem — all npx-installable:

Filesystem (extended access)

"filesystem": {
  "command": "npx",
  "args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/allowed"]
}
Enter fullscreen mode Exit fullscreen mode

Brave Search (web search from Claude)

"brave-search": {
  "command": "npx",
  "args": ["-y", "@modelcontextprotocol/server-brave-search"],
  "env": {
    "BRAVE_API_KEY": "your-key-here"
  }
}
Enter fullscreen mode Exit fullscreen mode

GitHub (PR/issue management)

"github": {
  "command": "npx",
  "args": ["-y", "@modelcontextprotocol/server-github"],
  "env": {
    "GITHUB_PERSONAL_ACCESS_TOKEN": "your-token"
  }
}
Enter fullscreen mode Exit fullscreen mode

SQLite (local database)

"sqlite": {
  "command": "npx",
  "args": ["-y", "@modelcontextprotocol/server-sqlite", "/path/to/db.sqlite"]
}
Enter fullscreen mode Exit fullscreen mode

Playwright (browser control)

"playwright": {
  "command": "npx",
  "args": ["-y", "@executeautomation/playwright-mcp-server"]
}
Enter fullscreen mode Exit fullscreen mode

Full settings.json with Multiple MCP Servers

Here's a production-ready config:

{
  "model": "claude-opus-4-5",
  "mcpServers": {
    "postgres": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-postgres",
        "postgresql://localhost/myapp_development"]
    },
    "github": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-github"],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_xxxxxxxxxxxx"
      }
    },
    "brave-search": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-brave-search"],
      "env": {
        "BRAVE_API_KEY": "BSA_xxxxxxxxxxxx"
      }
    },
    "playwright": {
      "command": "npx",
      "args": ["-y", "@executeautomation/playwright-mcp-server"]
    }
  },
  "permissions": {
    "allow": ["Bash", "Read", "Write", "Edit"]
  }
}
Enter fullscreen mode Exit fullscreen mode

Writing Your Own MCP Server

If the built-in servers don't cover your use case, you can write a custom one. Here's a minimal Node.js MCP server:

// my-mcp-server.js
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';

const server = new Server(
  { name: 'my-api', version: '1.0.0' },
  { capabilities: { tools: {} } }
);

// Define a tool
server.setRequestHandler('tools/list', async () => ({
  tools: [{
    name: 'get_user',
    description: 'Get user from internal API',
    inputSchema: {
      type: 'object',
      properties: {
        userId: { type: 'string', description: 'User ID' }
      },
      required: ['userId']
    }
  }]
}));

// Handle tool calls
server.setRequestHandler('tools/call', async (request) => {
  if (request.params.name === 'get_user') {
    const { userId } = request.params.arguments;
    const user = await fetchFromInternalAPI(`/users/${userId}`);
    return {
      content: [{ type: 'text', text: JSON.stringify(user) }]
    };
  }
});

// Start server
const transport = new StdioServerTransport();
await server.connect(transport);
Enter fullscreen mode Exit fullscreen mode

Then add it to your config:

"my-api": {
  "command": "node",
  "args": ["/path/to/my-mcp-server.js"]
}
Enter fullscreen mode Exit fullscreen mode

The Rate Limit Problem with MCP

Here's the catch: MCP tools make Claude Code significantly more powerful, which means it uses more tokens per conversation. Combined with Claude's usage limits, you'll hit rate limit interruptions faster.

The fix most teams use is setting ANTHROPIC_BASE_URL to a rate-limit-free proxy:

export ANTHROPIC_BASE_URL="https://simplylouie.com/api/proxy"
Enter fullscreen mode Exit fullscreen mode

SimplyLouie is ✌️2/month for unlimited Claude access — built specifically for developers who run heavy Claude Code sessions with MCP tools.

Quick Reference: MCP Server List

Server Package What It Does
PostgreSQL @modelcontextprotocol/server-postgres SQL queries
SQLite @modelcontextprotocol/server-sqlite Local DB
Filesystem @modelcontextprotocol/server-filesystem File access
GitHub @modelcontextprotocol/server-github PRs, issues, code
Brave Search @modelcontextprotocol/server-brave-search Web search
Playwright @executeautomation/playwright-mcp-server Browser control
Puppeteer @modelcontextprotocol/server-puppeteer Browser automation
Slack @modelcontextprotocol/server-slack Messages, channels
Memory @modelcontextprotocol/server-memory Persistent context

Debugging MCP Connections

If your MCP server isn't connecting, check:

# Test the server manually
npx -y @modelcontextprotocol/server-postgres postgresql://localhost/mydb

# Check Claude Code logs
cat ~/.claude/logs/mcp.log

# Verify the server is listed
claude /mcp
Enter fullscreen mode Exit fullscreen mode

MCP is what turns Claude Code from a smart autocomplete into an actual agent that can interact with your real infrastructure. The 5-minute setup is worth it.

What MCP servers are you running? Drop them in the comments.

Top comments (0)