MCP Servers Guide: Connect Claude Code to GitHub, Databases & More
MCP (Model Context Protocol) is what transforms Claude Code from a coding assistant into a powerful automation platform. This guide shows you how to connect Claude to GitHub, databases, messaging apps, and build your own custom integrations.
What is MCP?
Model Context Protocol (MCP) is an open standard created by Anthropic that allows AI models to interact with external tools and data sources. Think of MCP servers as plugins that give Claude new capabilities—reading from databases, creating GitHub issues, sending Slack messages, and more.
How MCP Works
The beauty of MCP is that Claude doesn't need to know the implementation details. It just sees available tools like "create_github_issue" or "query_database" and uses them naturally in conversation.
Setting Up MCP Servers
MCP servers are configured in your Claude Code settings file at ~/.claude/settings.json. Here's how to add them:
Basic Configuration Structure
{
"mcpServers": {
"server-name": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-name"],
"env": {
"API_KEY": "your-api-key"
}
}
}
}Each server has a command to run, arguments, and optional environment variables.
You can also configure MCP servers interactively by running /mcpin Claude Code, which provides a guided setup experience.
GitHub MCP Server
The GitHub MCP server is essential for developers. It lets Claude create issues, open pull requests, review code, manage repos, and more—all through natural conversation.
Configuration
{
"mcpServers": {
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {
"GITHUB_TOKEN": "ghp_your_personal_access_token"
}
}
}
}Create a GitHub Personal Access Token at github.com/settings/tokens with repo and issue permissions.
Available Tools
- create_issue — Open new issues with labels and assignees
- create_pull_request — Open PRs with title, body, and target branch
- list_issues — Query open issues by labels, state, or assignee
- get_file_contents — Read files directly from GitHub repos
- search_code — Search across repositories for code patterns
Example prompt: "Create an issue titled 'Add dark mode support' in the frontend repo with the labels 'enhancement' and 'ui'"
Database MCP Servers
Database MCP servers let Claude query and analyze your data directly. This is incredibly powerful for data exploration, generating reports, and building features that interact with your database.
PostgreSQL
{
"postgres": {
"command": "npx",
"args": ["-y",
"@modelcontextprotocol/server-postgres",
"postgresql://user:pass@host/db"
]
}
}SQLite
{
"sqlite": {
"command": "npx",
"args": ["-y",
"@modelcontextprotocol/server-sqlite",
"./database.db"
]
}
}Example prompt: "Show me the top 10 users by total purchases this month, and create a summary report"
Security Warning
Never use production database credentials in MCP servers. Create read-only users with limited permissions. MCP servers can execute any query Claude decides to run.
Communication MCP Servers
Connect Claude to your team's communication tools to automate notifications, summaries, and updates.
Slack MCP Server
Send messages, read channels, and interact with Slack workspaces through Claude.
{
"slack": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-slack"],
"env": {
"SLACK_BOT_TOKEN": "xoxb-your-bot-token"
}
}
}Use Cases
- • Post deployment notifications to #releases channel
- • Summarize discussion threads for documentation
- • Create standup reports from channel activity
- • Send alerts when builds fail or tests break
Filesystem & Web MCP Servers
Extend Claude's ability to work with files and fetch web content with these utility servers.
Filesystem
Enhanced file operations with watch capabilities, glob patterns, and batch processing.
- • Watch files for changes
- • Batch rename operations
- • Complex glob searches
Fetch
Make HTTP requests and fetch web content for analysis and integration.
- • Scrape documentation
- • Call external APIs
- • Download and analyze files
Building Custom MCP Servers
Need an integration that doesn't exist? Building custom MCP servers is straightforward with the official SDKs available in Python, TypeScript, and other languages.
Simple TypeScript MCP Server
import { Server } from "@modelcontextprotocol/sdk/server";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio";
const server = new Server({
name: "my-custom-server",
version: "1.0.0"
});
server.setRequestHandler("tools/list", async () => ({
tools: [{
name: "my_custom_tool",
description: "Does something useful",
inputSchema: {
type: "object",
properties: {
input: { type: "string" }
}
}
}]
}));
server.setRequestHandler("tools/call", async (request) => {
// Implement your tool logic here
return { content: [{ type: "text", text: "Result" }] };
});
const transport = new StdioServerTransport();
await server.connect(transport);Custom Server Ideas
- Jira/Linear Integration — Create tickets, update status, link to PRs
- CI/CD Server — Trigger builds, check pipeline status, deploy
- Monitoring Server — Query Datadog, PagerDuty, or custom metrics
- Cloud Provider — Manage AWS, GCP, or Azure resources
Track Your MCP-Enhanced Workflow
As you integrate more MCP servers, your Claude Code usage becomes increasingly powerful. Track how these integrations boost your productivity with Viberank's analytics.
See your Claude Code stats and join the leaderboard
Upload your cc.json and compare your usage with other developers