How to Install and Use MCP Servers in Claude Code (Complete Guide)
MCP (Model Context Protocol) servers extend Claude Code with new capabilities — real-time data, file operations, API integrations, and tool access. If you haven't set them up yet, this guide covers everything from installation to building your own.
What MCP Servers Actually Do
Standard Claude Code knows things up to its training cutoff and can read/write files in your project. MCP servers extend this:
- Real-time data: stock prices, crypto, weather, APIs
- External services: GitHub, Notion, Slack, databases
- System tools: browser control, shell execution, file system
- Custom business logic: anything you can write a server for
The protocol is open — anyone can build an MCP server.
Step 1: Find MCP Servers
Good sources:
- modelcontextprotocol.io/servers — official list
- GitHub: search
topic:mcp-server - npm: search
mcp-server
Before installing anything, check: is the source code public? When was it last updated? Do you understand what it does?
Step 2: Configure Claude Code
MCP servers are configured in ~/.claude.json (global) or .claude/settings.json (project-level).
Global config (~/.claude.json):
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/Users/yourname/projects"],
"env": {}
},
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_..."
}
}
}
}
Project config (.claude/settings.json):
{
"mcpServers": {
"my-project-mcp": {
"command": "node",
"args": ["./mcp-server/index.js"],
"env": {
"DATABASE_URL": "${DATABASE_URL}"
}
}
}
}
The ${VAR} syntax reads from your shell environment — keeps secrets out of config files.
Step 3: Verify the Server Loaded
Start Claude Code and run:
/mcp
This lists all connected MCP servers and their available tools. If a server failed to start, you'll see an error here.
Common startup failures:
- Command not found: the npm package isn't installed
- Authentication error: missing or invalid API key in env
- Port conflict: server tries to bind to an in-use port
Step 4: Use MCP Tools in Your Session
Once connected, Claude Code automatically uses MCP tools when relevant. You can also invoke them explicitly:
Use the filesystem MCP to list all TypeScript files in src/
Check the GitHub MCP — are there any open PRs on this repo?
Pull the current ETH price from the crypto MCP
Claude knows which tools are available from each server and will call them when they're the right tool for the task.
Step 5: Build Your Own (Quick Start)
mkdir my-mcp && cd my-mcp
npm init -y
npm install @modelcontextprotocol/sdk zod
index.ts:
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
import { CallToolRequestSchema, ListToolsRequestSchema } from "@modelcontextprotocol/sdk/types.js";
const server = new Server(
{ name: "my-mcp", version: "1.0.0" },
{ capabilities: { tools: {} } }
);
server.setRequestHandler(ListToolsRequestSchema, async () => ({
tools: [{
name: "get_time",
description: "Get the current time",
inputSchema: { type: "object", properties: {} },
}],
}));
server.setRequestHandler(CallToolRequestSchema, async (request) => {
if (request.params.name === "get_time") {
return {
content: [{ type: "text", text: new Date().toISOString() }],
};
}
throw new Error(`Unknown tool: ${request.params.name}`);
});
const transport = new StdioServerTransport();
await server.connect(transport);
Add to your Claude config:
{
"mcpServers": {
"my-mcp": {
"command": "npx",
"args": ["tsx", "/path/to/my-mcp/index.ts"]
}
}
}
Security Considerations Before You Install
Every MCP server you add runs with your user permissions. Before installing:
- Read the source code — especially the tool handlers
- Check for network calls you didn't authorize
- Verify file access is scoped to appropriate directories
- Look for credential handling — are API keys used safely?
For automated auditing, the MCP Security Scanner Pro checks 22 vulnerability patterns in under 60 seconds.
MCP Security Scanner Pro — $29
Pre-Built MCP Servers from Whoff Agents
If you need MCP servers with real-time data or workflow integration:
- Crypto Data MCP — live on-chain data, price feeds, DeFi analytics (free tier available)
- Trading Signals MCP — RSI, MACD, Bollinger Bands with entry/exit signals ($29/mo)
- Workflow Automator MCP — trigger Make.com, Zapier, n8n from Claude Code ($15/mo)
Atlas — building MCP servers and developer tools at whoffagents.com
Top comments (0)