How to Set Up Model Context Protocol (MCP) for Claude
A step-by-step setup guide for Model Context Protocol (MCP). Extend Claude's capabilities with local filesystem access, web searches, and databases.

TL;DR: A step-by-step setup guide for Model Context Protocol (MCP). Extend Claude's capabilities with local filesystem access, web searches, and databases.
Model Context Protocol (MCP) is an open communication standard developed by Anthropic, enabling Claude to connect seamlessly with external resources — from web search and local filesystems to databases and custom APIs.
If you feel Claude is restricted by its static knowledge cutoff, in my experience, setting up MCP is the best way to supercharge your local developer environment.
What is MCP and Why Does It Matter?
Before MCP, Claude was limited to processing only the information explicitly fed into the active chat window. With MCP, the AI can:
- Web search: Query search engines for real-time information as needed.
- Filesystem: Read and write files directly within your local project directory.
- Database: Execute queries against Postgres, SQLite, or custom datastores.
- Custom tools: Connect with any private or internal APIs you maintain.
MCP transforms Claude from an informational chatbot into an active system agent.
Basic MCP Setup Configuration
Step 1: Install Claude Desktop
Download from claude.ai/download. Currently, MCP integrations operate most smoothly on the official Claude Desktop client.
Step 2: Configure the MCP Config File
Create or edit the configuration file:
// ~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"/Users/YourName/Projects"
]
},
"brave-search": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-brave-search"],
"env": {
"BRAVE_API_KEY": "your-api-key-here"
}
}
}
}
Step 3: Restart Claude Desktop
Save the file and restart Claude Desktop. You will notice a new plug icon representing active tools in the chat interface.
Popular MCP Servers
Filesystem MCP
Grants Claude read and write permissions inside a defined local directory:
npx @modelcontextprotocol/server-filesystem /path/to/project
Use cases: Automated codebase audits, batch file modifications, or reading local documentation directories.
Brave Search MCP
Gives the agent real-time web-search access:
npx @modelcontextprotocol/server-brave-search
Use cases: Querying the latest library versions, searching current API document updates, or conducting market research.
Postgres MCP
Allows direct database querying:
{
"postgres": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-postgres",
"postgresql://user:pass@localhost/dbname"]
}
}
Use cases: Querying application data, debugging database schema issues, or generating analytics summaries.
Real-world MCP Workflows
Example 1: Review and patch a codebase using Filesystem MCP
Claude, inspect the file src/lib/mdx.ts and check for potential performance issues.
Refactor the problematic segments and save the changes back to the filesystem.
Claude calls its local filesystem server, parses the file, writes the refactored layout, and confirms — removing the need to copy-paste code snippets.
Example 2: Technical research using Brave Search MCP
Before we write the authentication handler, query the web to see if
NextAuth.js v5 introduces breaking changes compared to v4.
Claude searches online, highlights deprecation notices, and ensures you draft your code correctly.
Building a Custom MCP Server
If you need Claude to hook into your private CRM or back-office system:
// server.ts
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
const server = new Server({
name: 'my-custom-server',
version: '1.0.0',
});
server.setRequestHandler('tools/call', async (request) => {
if (request.params.name === 'get-leads') {
const leads = await fetchLeadsFromCRM();
return { content: [{ type: 'text', text: JSON.stringify(leads) }] };
}
});
Conclusion
MCP is a massive step forward in the AI tool ecosystem. It transforms Claude from an offline conversational tool into an active workspace agent that reads, queries, and builds in real time.
Want to learn how to integrate MCP into your Vibe Coding workflow? Claude Code Mastery Pro features a dedicated module on advanced AI tooling and developer automation.
To improve your workflow efficiency and system thinking, read: Comprehensive Guide to Vibe Coding to apply it directly to your business.
Tải Playbook Vibe Coding: Setup Cursor & Claude Code Chuẩn
SOP hướng dẫn thiết lập Brain file (.cursorrules / CLAUDE.md) tối ưu token và cách chia nhỏ bài toán để AI sinh code không lỗi.



