Model Context Protocol (MCP) servers extend AI coding agents like Claude Code, Cursor, and Windsurf with external tools and data sources. This guide covers the essentials of getting started.
MCP servers expose tools, resources, and prompts to AI agents over a standardized protocol. Think of them as plugins -- they give your AI assistant new capabilities like reading databases, calling APIs, or searching specialized knowledge bases.
Add servers to your ~/.claude/settings.json:
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/allowed/dir"]
}
}
}Both editors use a similar .mcp.json file in your project root:
{
"mcpServers": {
"my-server": {
"command": "npx",
"args": ["-y", "my-mcp-server-package"]
}
}
}Here are some genuinely useful servers to start with:
| Server | Purpose | Install |
|---|---|---|
| filesystem | Read/write files safely | @modelcontextprotocol/server-filesystem |
| postgres | Query PostgreSQL databases | @modelcontextprotocol/server-postgres |
| brave-search | Web search from your agent | @modelcontextprotocol/server-brave-search |
| tokrepo-mcp-server | Search 200+ AI assets (skills, prompts, workflows) | tokrepo-mcp-server |
| github | Interact with GitHub repos, issues, PRs | @modelcontextprotocol/server-github |
If you frequently need skills, prompts, or workflow templates, the TokRepo MCP server lets your agent search a curated registry of 200+ AI assets:
{
"mcpServers": {
"tokrepo": {
"command": "npx",
"args": ["-y", "tokrepo-mcp-server"]
}
}
}Your agent can then search for assets mid-conversation:
Agent: Let me search TokRepo for a code review skill...
→ Found: "adversarial-code-review" — a thorough review checklist used by senior engineers
- Check server logs: Run the MCP server command directly in terminal to see startup errors
- Verify Node.js version: Most MCP servers need Node 18+
- Environment variables: Some servers need API keys -- set them in the
envfield of your config - Restart your editor: After changing MCP config, restart to pick up changes
The MCP SDK makes it straightforward:
npm init -y
npm install @modelcontextprotocol/sdkA minimal server exposes one or more tools:
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
const server = new McpServer({ name: "my-server", version: "1.0.0" });
server.tool("greet", { name: "string" }, async ({ name }) => ({
content: [{ type: "text", text: `Hello, ${name}!` }]
}));- MCP Specification -- Official docs and protocol spec
- MCP Server Registry -- Official server list
- TokRepo -- Browse MCP configs, skills, and prompts contributed by the community
William Wang -- Founder of TokRepo, an open registry for AI assets.