Skip to content

Instantly share code, notes, and snippets.

@henu-wang
Created April 6, 2026 06:13
Show Gist options
  • Select an option

  • Save henu-wang/ebb7df524c079cd38693bddb4020c382 to your computer and use it in GitHub Desktop.

Select an option

Save henu-wang/ebb7df524c079cd38693bddb4020c382 to your computer and use it in GitHub Desktop.
Quick Guide: Setting Up MCP Servers for AI Coding Agents — configuration, debugging, and recommended servers

Quick Guide: Setting Up MCP Servers for AI Coding Agents

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.

What Are MCP Servers?

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.

Setting Up Your First MCP Server

1. Configure in Claude Code

Add servers to your ~/.claude/settings.json:

{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/allowed/dir"]
    }
  }
}

2. Configure in Cursor / Windsurf

Both editors use a similar .mcp.json file in your project root:

{
  "mcpServers": {
    "my-server": {
      "command": "npx",
      "args": ["-y", "my-mcp-server-package"]
    }
  }
}

Recommended MCP Servers

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

Example: Adding TokRepo for AI Asset Discovery

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

Debugging Tips

  1. Check server logs: Run the MCP server command directly in terminal to see startup errors
  2. Verify Node.js version: Most MCP servers need Node 18+
  3. Environment variables: Some servers need API keys -- set them in the env field of your config
  4. Restart your editor: After changing MCP config, restart to pick up changes

Building Your Own MCP Server

The MCP SDK makes it straightforward:

npm init -y
npm install @modelcontextprotocol/sdk

A 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}!` }]
}));

Resources


William Wang -- Founder of TokRepo, an open registry for AI assets.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment