Stop reading about MCP and just build something. I've walked probably 20-30 developers through this setup - most have working servers in under an hour once they quit overthinking it. This isn't rocket science, it's JSON over stdio so Claude can call your functions.
Prerequisites: The Bare Minimum
You need Claude Desktop (free) and Node.js 18+ or Python 3.8+. That's it. Don't install Kubernetes, don't set up authentication servers, don't architect for enterprise scale. Just get something working first.
Version gotcha: Certain Node.js 20.x versions have stdio transport issues that cause random disconnects. Use 18.19.x or latest 20.x patches. Python 3.12+ breaks some MCP SDK dependencies - stick with 3.11.x for now.
The official MCP quickstart covers installation basics, but I'll show you the shortcuts that actually work. Skip the theory and jump straight to code that does useful things.
Path 1: Database Server (Most Common Use Case)
What you get: Claude can query your database using natural language. Ask it "show me customers from last month" and it translates that to SQL.
Time needed: 20-30 minutes including debugging
Start with the PostgreSQL MCP server template - don't build from scratch unless you hate yourself. Clone the repo and modify the connection string:
git clone https://github.com/modelcontextprotocol/servers.git
cd servers/src/postgres
npm install
Edit the config to point to your database. Most connection issues come from wrong credentials or network access - test your connection with psql
first before blaming the MCP server.
Common error messages you'll see:
FATAL: password authentication failed for user "claude_readonly"
= wrong passwordFATAL: database "your_db" does not exist
= typo in database nameECONNREFUSED 127.0.0.1:5432
= PostgreSQL isn't running, or it's on a different portFATAL: sorry, too many clients already
= you hit connection limit, use connection pooling
The part that always breaks: Database permissions. Your MCP server needs table access but not admin rights. Create a read-only user:
CREATE USER claude_readonly WITH PASSWORD 'secure_password';
GRANT SELECT ON ALL TABLES IN SCHEMA public TO claude_readonly;
Configure Claude Desktop: Add this to ~/Library/Application Support/Claude/claude_desktop_config.json
(macOS) or %APPDATA%/Claude/claude_desktop_config.json
(Windows):
{
"mcpServers": {
"postgres": {
"command": "node",
"args": ["/path/to/servers/src/postgres/dist/index.js"],
"env": {
"POSTGRES_CONNECTION_STRING": "postgresql://claude_readonly:secure_password@localhost:5432/your_db"
}
}
}
}
Restart Claude Desktop. You should see "Connected to MCP server: postgres" in a new conversation. Test it: "Show me the first 5 rows from the users table."
Path 2: File System Access (Developer Favorite)
What you get: Claude can read, write, and search your project files. Perfect for code review, documentation generation, and project analysis.
Time needed: 15 minutes
Use the filesystem server but lock it down to specific directories - don't give Claude access to your whole filesystem unless you're feeling reckless.
cd servers/src/filesystem
npm install
npm run build
Configure with restricted paths in claude_desktop_config.json
:
{
"mcpServers": {
"filesystem": {
"command": "node",
"args": ["/path/to/servers/src/filesystem/dist/index.js", "/Users/yourname/projects"]
}
}
}
Pro tip: Set up separate configs for different projects. I have different MCP configs for work projects vs personal stuff because mixing them creates chaos.
Path 3: Custom API Integration (Most Flexible)
What you get: Connect Claude to any REST API - your CRM, monitoring tools, internal services, whatever.
Time needed: 45 minutes for basic wrapper
Start with the TypeScript SDK template:
npx create-mcp-server@latest my-api-server --template typescript
cd my-api-server
npm install
Implement a simple tool that calls your API:
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
const server = new Server({ name: "my-api-server" });
server.tool("get_users", {
description: "Fetch users from our API",
inputSchema: {
type: "object",
properties: {
limit: { type: "number", description: "Number of users to fetch" }
}
}
}, async ({ limit = 10 }) => {
const response = await fetch(`https://your-api.com/users?limit=${limit}`, {
headers: { 'Authorization': `Bearer ${process.env.API_TOKEN}` }
});
return await response.json();
});
server.run();
The gotcha: API authentication. Don't hardcode tokens - use environment variables and rotate them. I've seen too many breaches from people committing API keys to GitHub like idiots.
Common Setup Problems (And Quick Fixes)
"MCP server not found": Check your paths in the config file. Use absolute paths, not relative ones. Claude Desktop runs from its own directory context.
"Connection refused": Your MCP server crashed during startup. Run it manually in a terminal to see the actual error message:
node /path/to/your/server.js
"Permission denied": File permissions or database access issues. Make sure the user Claude Desktop runs as can access your server files and database.
"Invalid JSON-RPC": Your server is returning malformed responses. Test with the MCP Inspector to debug protocol issues without Claude. Nine times out of ten, it's because you're returning undefined
instead of null
somewhere, or forgot to await an async function.
Silent failures: Claude shows connected but tools don't work. Check that your server implements the tools/list
method correctly - this is how Claude discovers available functions.
Making It Actually Useful
Once you have basic connectivity, focus on tools that save real time. Generic "query anything" tools are neat demos but not that helpful. Build specific tools for specific tasks:
- Code analysis: "Find all TODO comments in TypeScript files"
- Data insights: "Show me user signups by day for the last month"
- System health: "Check if our API endpoints are responding"
- Content management: "Generate documentation for functions in this directory"
The RedHat MCP tutorial shows good patterns for building focused tools instead of generic database wrappers.
Testing Your Setup
Don't just ask Claude "does this work?" - test with specific queries that exercise your tools:
- Discovery test: "What tools are available?" (should list your MCP server's capabilities)
- Basic function test: Try the simplest possible query first
- Error handling test: Intentionally break something to see if errors are useful
- Performance test: Try larger queries to find timeout issues
Use the MCP Inspector for debugging - it shows you exact JSON-RPC messages between Claude and your server. Essential when things mysteriously stop working.
Next Steps: Making It Production-Ready
Your 30-minute demo server isn't ready for real work yet. Here's what production deployments need:
- Authentication: OAuth integration with your identity provider
- Error handling: Graceful failures that don't crash the server
- Monitoring: Logs and metrics for debugging production issues
- Security: Input validation and access controls
- Scaling: Connection pooling and resource limits
The enterprise implementation guide covers these operational concerns, but start simple and add complexity as you need it.
Most developers spend months planning "enterprise-ready" MCP implementations and never ship anything. Get something working first, then make it robust. Your users will thank you for fast iteration over perfect architecture.