# MCP Integration

> Integrate Model Context Protocol (MCP) servers with Claude Code agents. Covers server setup, tool discovery, and multi-server orchestration.

- Skill: `grandamenium/mcp-integration` (Agent Skill)
- Install (CLI): `npx skillmds@latest add grandamenium/mcp-integration`
- Raw SKILL.md: https://api.skillmd.com/api/skills/grandamenium/mcp-integration/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Product & Planning
- Author: grandamenium (https://skillmd.com/u/grandamenium)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/grandamenium/mcp-integration

---


# MCP Integration

Connect Claude Code agents to external services via Model Context Protocol.

## Adding MCP Servers

In your agent's `.claude/settings.json`:
```json
{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": ["-y", "@anthropic-ai/mcp-filesystem", "/path/to/dir"]
    },
    "github": {
      "command": "npx",
      "args": ["-y", "@anthropic-ai/mcp-github"],
      "env": { "GITHUB_TOKEN": "ghp_..." }
    }
  }
}
```

## Popular MCP Servers
- **filesystem** - Read/write local files
- **github** - Issues, PRs, repos
- **postgres** - Database queries
- **slack** - Send/read messages
- **brave-search** - Web search

## Building Custom Servers
```typescript
import { McpServer } from "@anthropic-ai/mcp";

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

server.tool("my_tool", { description: "Does something" }, async (input) => {
  return { result: "done" };
});

server.run();
```

## Best Practices
- Use environment variables for secrets, never hardcode
- Test servers independently before connecting to agents
- Set timeouts on server connections
- Log all MCP calls for debugging

