MCP Server Integration Guide — Connect Claude to Any Data Source

In This Guide

  1. What Is MCP and Why It Matters
  2. Three Integration Categories
  3. Interactive MCP Config Builder Wizard
  4. Database Integrations in Depth
  5. REST API Integrations
  6. Filesystem and File Server Integrations
  7. Security and Production Hardening
  8. Troubleshooting Common Errors

What Is MCP and Why It Matters

The Model Context Protocol (MCP) is an open standard that gives Claude a live connection to external systems — databases, APIs, file servers, and custom tools — without embedding data directly into the context window. Instead of copy-pasting a CSV or writing a long prompt describing your database schema, you configure an MCP server once and Claude can query it on demand.

MCP follows a client-server architecture. The MCP client (built into Claude Desktop and compatible hosts) sends requests over a local transport (stdio or SSE). The MCP server is a small process you run that exposes three primitives:

Key insight: MCP lets Claude act as a dynamic agent over live data rather than a static summarizer of pasted content. A single configured MCP server can replace dozens of copy-paste operations per day.

Three Integration Categories

Category Examples Best MCP Package Complexity
Database DB PostgreSQL, MySQL, SQLite, MongoDB @modelcontextprotocol/server-postgres, mcp-server-sqlite Low — connection string only
REST API API GitHub, Notion, Slack, custom services @modelcontextprotocol/server-github, custom TypeScript/Python Medium — needs auth config
Filesystem FS Local files, project directories, S3 @modelcontextprotocol/server-filesystem, mcp-server-s3 Low — path config only

Interactive MCP Config Builder Wizard

Use the wizard below to generate a ready-to-paste claude_desktop_config.json snippet and server setup instructions. The test simulator replays a real connection handshake so you can catch config errors before running Claude Desktop.

MCP Config Builder Wizard

Select your data source type, fill in connection details, and get a generated JSON config with setup steps.

1. Source Type
2. Connection
3. Config & Test

What type of data source do you want to connect Claude to?

🐘
PostgreSQL
SQL database
🗄️
SQLite
Local database
🐬
MySQL / MariaDB
SQL database
🔌
REST API
HTTP endpoints
🐙
GitHub
Repos & issues
📁
Filesystem
Local files

Add this snippet to your claude_desktop_config.json inside the mcpServers object, then restart Claude Desktop.

— config will appear here —
Setup Steps
Test Connection Simulator

Simulates the MCP handshake and tool-list request to surface config issues before running Claude Desktop.

// Test output will appear here. Click "Run Connection Test" to begin.

Database Integrations in Depth

PostgreSQL

The official @modelcontextprotocol/server-postgres package exposes query and list_tables tools plus schema resources. Claude can write and execute SQL, inspect table schemas, and analyze query results in a single conversation turn.

# Install (one-time)
npm install -g @modelcontextprotocol/server-postgres

# Test locally
npx @modelcontextprotocol/server-postgres \
  "postgresql://readonly_user:pass@localhost:5432/mydb"

Always use a read-only database user for the MCP connection. Create one with GRANT SELECT ON ALL TABLES IN SCHEMA public TO mcp_user; and revoke all write permissions.

SQLite

SQLite needs no network config — just a path to the .db file. It is ideal for local development, embedded analytics, and offline workflows. The server auto-detects foreign keys and indexes, making schema exploration especially clean.

MySQL / MariaDB

Use the community mcp-server-mysql package. Connection strings follow the standard mysql://user:pass@host:3306/dbname format. Enable ssl: true in the config for any non-localhost connection.

REST API Integrations

Connecting Claude to a REST API requires either an off-the-shelf MCP server (GitHub, Slack, Notion all have official ones) or a custom server you write using the MCP TypeScript or Python SDK. A custom server for a simple CRUD API is under 80 lines of code.

Pattern: For OpenAPI-documented APIs, use the mcp-openapi community package. Point it at your swagger.json and it auto-generates tools for every endpoint — no handwriting required.

GitHub Integration

The @modelcontextprotocol/server-github package requires a personal access token. It exposes tools for listing repos, reading files, searching code, creating issues, and commenting on PRs. Set the token as an environment variable — never inline it in the config JSON.

Writing a Custom API Server (TypeScript)

import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
import { z } from "zod";

const server = new McpServer({ name: "my-api", version: "1.0.0" });

server.tool("get_user", { id: z.string() }, async ({ id }) => {
  const res = await fetch(`https://api.example.com/users/${id}`, {
    headers: { Authorization: `Bearer ${process.env.API_TOKEN}` }
  });
  const data = await res.json();
  return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
});

await server.connect(new StdioServerTransport());

Filesystem and File Server Integrations

The @modelcontextprotocol/server-filesystem package gives Claude read/write access to specified directories. Configure it with an explicit allowed paths list — never pass / or your home directory root. The server enforces path containment so Claude cannot traverse outside the allowed list.

// Good: scoped to one project directory
"allowedPaths": ["/Users/you/projects/my-app"]

// Bad: overly broad
"allowedPaths": ["/"]

Filesystem MCP is powerful for code review sessions (Claude reads all your source files), documentation generation, and log analysis where data lives in flat files.

Security and Production Hardening

Troubleshooting Common Errors

ErrorCauseFix
Server not found Server process failed to start Run the server command manually in your terminal to see the real error
Connection refused Database not running or wrong port Verify the host/port with psql or mysql CLI first
Tool list empty Server started but no tools registered Check the server version — older packages may need an upgrade
Permission denied Database user lacks SELECT grants Run GRANT SELECT ON ALL TABLES ... TO mcp_user
Path not allowed Filesystem path outside allowed list Add the path to allowedPaths in server config

Related Guides

Multi-Agent Orchestration — Coordination Pattern Designer Claude Code Workflow Automation — 7 Patterns Prompt Chaining Patterns — Interactive Chain Builder Agent Pattern Library — 12 Agentic AI Design Patterns