MCP Servers Explained: How to Connect Claude to Your Infrastructure Tools
MCP is the reason Claude feels like a team member instead of just a chatbot. Without MCP, Claude can only work with what you paste into the conversation. With MCP, Claude connects directly to your GitHub repos, AWS account, Kubernetes clusters, databases, and Slack — reading real data and taking real actions in real time.
If you are using Claude for DevOps without MCP, you are missing the most powerful part.
What is the Model Context Protocol (MCP)?
Model Context Protocol is an open standard created by Anthropic that lets AI models connect to external tools and data sources. Think of it as a USB port for AI — the protocol defines a standard interface, and any tool can plug in by implementing an MCP server.
How it works at a high level:
- You configure an MCP server for a tool (e.g., GitHub)
- Claude Code or Claude Desktop loads the server when it starts
- When you ask Claude something, it can now call that tool in real time
- The tool returns data, and Claude uses it to answer accurately
Without MCP:
- “What are the open PRs in my repo?” → Claude guesses or says it doesn’t have access
- “Is my EC2 instance running?” → Claude can only work from what you paste
With MCP:
- “What are the open PRs in my repo?” → Claude queries GitHub and lists them
- “Is my EC2 instance running?” → Claude queries AWS and tells you the state
The shift from guessing to knowing is what makes Claude genuinely useful for operational work.
How MCP Changes Everything for DevOps
| Before MCP | After MCP |
|---|---|
| Copy-paste CloudWatch logs into Claude | Claude reads logs directly from CloudWatch |
| Describe your infra to Claude in text | Claude queries your AWS account in real time |
| Manually pull GitHub issues for context | Claude reads PRs, issues, and code directly |
| Paste kubectl output and ask for help | Claude queries your cluster state directly |
| Type out Slack conversation context | Claude reads the relevant channel |
The practical result: investigations that used to take 20 minutes of copy-pasting now take two minutes of asking Claude the right question.
Setting Up Your First MCP Server
MCP servers are configured in your Claude Code settings file at ~/.claude/settings.json (or within the Claude Desktop app settings).
Here is a full working configuration with GitHub:
{
"mcpServers": {
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {
"GITHUB_TOKEN": "ghp_your_token_here"
}
}
}
}
After saving, restart Claude Code. In your next session, Claude will have access to GitHub. Test it:
List the open pull requests in my repo and summarize what each one does.
Claude will call the GitHub MCP server, retrieve the PR list, and give you a real summary.
MCP in action — Claude querying GitHub directly without any copy-pasting
Top MCP Servers for DevOps Engineers
1. GitHub MCP
What it does: Read and interact with repositories, PRs, issues, and code.
{
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": { "GITHUB_TOKEN": "your_token" }
}
}
Example prompts:
Review all open PRs and flag any that modify IAM policiesList issues labeled 'bug' opened in the last 7 daysShow me the diff for PR #142
2. Filesystem MCP
What it does: Read and write local files and directories outside your current project.
{
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/allow"]
}
}
Example prompts:
Read all Terraform files in ~/infrastructure and identify cost optimization opportunitiesCompare the nginx configs in /etc/nginx/sites-available/ and find inconsistencies
3. PostgreSQL MCP
What it does: Query your databases directly from Claude.
{
"postgres": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-postgres", "postgresql://user:pass@host/db"]
}
}
Example prompts:
Show me the slowest queries from pg_stat_statementsList all tables over 1GB with their row counts
4. Slack MCP
What it does: Read channels, search messages, post alerts.
{
"slack": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-slack"],
"env": {
"SLACK_BOT_TOKEN": "xoxb-your-token",
"SLACK_TEAM_ID": "T0XXXXXXX"
}
}
}
Example prompts:
Summarize the #incidents channel from the last 24 hoursPost a deployment summary to #deployments
5. Brave Search MCP
What it does: Real-time web search so Claude has access to current documentation and CVEs.
{
"brave-search": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-brave-search"],
"env": { "BRAVE_API_KEY": "your_key" }
}
}
Example prompts:
Search for CVEs affecting Kubernetes 1.29 in the last 90 daysFind the latest Terraform AWS provider changelog
6. AWS MCP (Community)
What it does: Query EC2, S3, RDS, CloudWatch, Cost Explorer.
Several community-built AWS MCP servers exist. Look for @aws/mcp-server-* packages on npm or search the MCP server registry.
Claude querying AWS Cost Explorer through MCP — no manual copy-paste needed
Real Example: Claude + GitHub MCP for PR Reviews
Here is a real workflow for reviewing infrastructure PRs:
- A developer opens a PR modifying Terraform files
- You start a Claude Code session with GitHub MCP active
- Ask:
Review PR #87 for security issues, resource naming violations, and missing tags - Claude fetches the PR diff from GitHub
- Claude cross-references your CLAUDE.md conventions
- Claude returns a structured review with specific line-by-line comments
This replaces 20 minutes of manual review with a 60-second Claude session — and Claude doesn’t miss things when it’s tired at 11pm.
Real Example: Claude + AWS for Cost Analysis
With an AWS MCP server configured:
Analyze our AWS spend for last month. Break it down by service,
identify the top 5 cost drivers, and suggest specific actions
to reduce spend by at least 20%.
Claude queries Cost Explorer, pulls the breakdown, and gives you a prioritized savings plan — the same output you would pay a cloud consultant several hundred dollars to produce.
Running Multiple MCP Servers Together
You can run as many MCP servers as you need simultaneously. A full DevOps setup might look like:
{
"mcpServers": {
"github": { ... },
"filesystem": { ... },
"postgres": { ... },
"slack": { ... },
"brave-search": { ... }
}
}
Claude chooses which servers to query based on your request. Ask about a GitHub PR and it uses GitHub MCP. Ask about database performance and it uses PostgreSQL MCP. You don’t need to manage this — Claude figures it out.
Multiple MCP servers running simultaneously — Claude picks the right one for each task
Security Considerations
MCP servers are powerful, which means security matters.
Use read-only tokens where possible. Your GitHub token for code review doesn’t need write access. Create a token with the minimum permissions required for the tasks you want Claude to perform.
Keep tokens in environment variables, not hardcoded. Never commit your settings.json with real tokens to a repo. Use environment variable references and load them via your shell profile.
Review what each MCP server can access. Before connecting an MCP server to production systems, understand exactly what operations it can perform. Most community servers have a README listing their capabilities.
Separate read and write operations. Consider running Claude with read-only MCP access during investigation, and requiring manual confirmation before any write operations.
Audit MCP server source code. For community-built servers, review the source before running with sensitive credentials.
Claude working with MCP — pulling real data from infrastructure tools without manual copying
FAQ
What is MCP in Claude? MCP (Model Context Protocol) is an open standard that lets Claude connect to external tools and data sources in real time. It is the difference between Claude working from what you paste versus Claude querying your actual systems.
Is MCP safe to use? Yes, if configured correctly. Use read-only tokens where possible, keep tokens in environment variables, and review what each MCP server can access before connecting it to production systems.
Can I build my own MCP server? Yes. Anthropic has published the full MCP specification and SDK. If you have an internal tool — a custom dashboard, an internal API, a monitoring system — you can build an MCP server for it in a few hours using the official SDK.
Which MCP servers are free? All the official Anthropic MCP servers (GitHub, filesystem, PostgreSQL, Slack, etc.) are open source and free to use. You only pay for the API calls Claude makes through them.
Does MCP work with Claude Code and Claude Desktop?
Yes, MCP works with both. The configuration format is slightly different between the two, but the MCP servers themselves are the same. Claude Code uses ~/.claude/settings.json, while Claude Desktop uses its own settings panel.
Conclusion
MCP transforms Claude from a smart text tool into a genuine infrastructure assistant that works with your real systems. Start with one server — GitHub MCP is the easiest entry point — and add more as you find use cases.
The engineers who are getting 10x productivity gains from AI aren’t just using better prompts. They have connected Claude to their actual tools.
Want to see what AI-powered infrastructure management looks like in practice? Explore the AI section →
Related: How to Build Claude AI Agents That Automate Your Infrastructure