Building MCP Agents with Node.js
A deep-dive into the Model Context Protocol — what it is, why it matters, and how I built an npx CLI that scaffolds MCP servers in seconds.
The Model Context Protocol (MCP) is an open standard from Anthropic that lets AI models connect to external tools, data sources, and APIs through a unified interface. Think of it as a USB-C port for AI — one standard that works everywhere.
Why MCP?
Before MCP, every tool integration was bespoke. You'd write custom connectors for each LLM, each data source, each IDE. MCP collapses that into a single protocol: a client (your IDE or agent runtime) talks to servers (your tools) over a well-defined JSON-RPC interface.
- Standardised tool & resource definitions
- Works across Claude, VS Code Copilot, Cursor, and more
- Built-in support for prompts, sampling, and progress reporting
- TypeScript & Python SDKs maintained by Anthropic
Building setup-mcp
I got tired of copy-pasting MCP server configs every time I started a project. So I built setup-mcp — an npx CLI that asks which MCP servers you need, which IDE you're targeting, and wires everything up automatically.
npx setup-mcp # ? Select your IDE › VS Code / Cursor / Windsurf # ? Choose MCP servers (multi-select) › # ◉ Filesystem # ◉ GitHub # ◯ PostgreSQL # ✓ .mcp.json written # ✓ .vscode/settings.json updated
The CLI is built with Node.js + TypeScript, published to npm, and lives in a Turborepo monorepo so adding new server templates is a one-liner. Check it out on GitHub and let me know what servers you'd like me to add next.