{"slug": "building-mcp-servers-for-claude-cursor-here-s-a-starting-point", "title": "Building MCP servers for Claude & Cursor? Here's a starting point.", "summary": "A developer open-sourced mcp-server-template, a production-ready TypeScript/Node.js foundation for building Model Context Protocol servers that connect AI agents like Claude Desktop and Cursor to tools and data. The template includes Zod validation, structured logging, testing with Vitest, and automated deployment to npm and the MCP Registry via GitHub Actions.", "body_md": "Most MCP servers I see in the wild start as a quick script and stay that way — no validation, no structured logging, no tests, and a deploy story that means shipping node_modules around.\n\nI got tired of rebuilding the same scaffolding every time a client project needed a Model Context Protocol server, so I open-sourced the template I now start every one from: 🚀 mcp-server-template\n\nIt's a production-ready TypeScript/Node.js foundation for building MCP servers that connect AI agents like Claude Desktop and Cursor to your tools, data, and workflows.\n\n𝗚𝗲𝘁𝘁𝗶𝗻𝗴 𝘀𝘁𝗮𝗿𝘁𝗲𝗱 𝘁𝗮𝗸𝗲𝘀 𝗳𝗼𝘂𝗿 𝗰𝗼𝗺𝗺𝗮𝗻𝗱𝘀:\n\n```\ngit clone https://github.com/qmmughal/mcp-server-template.git\ncd mcp-server-template && npm install\ncp .env.example .env\nnpm run dev\n```\n\nThat spins up a working server in watch mode. npm test runs the Vitest suite, npm run build bundles everything into a single dist/index.js with esbuild — no node_modules to deploy.\n\n𝗪𝗵𝗮𝘁 𝗮 𝘁𝗼𝗼𝗹 𝗮𝗰𝘁𝘂𝗮𝗹𝗹𝘆 𝗹𝗼𝗼𝗸𝘀 𝗹𝗶𝗸𝗲:\n\nEvery tool gets a Zod schema, a definition, and a handler — so a malformed AI payload gets rejected with a clean error instead of crashing your process:\n\n``` js\nconst schema = z.object({\n  text: z.string().describe(\"The text to process\"),\n  repeat: z.number().int().min(1).max(10).optional()\n});\n\nexport async function handleExampleTool(args: unknown, service: ExampleService) {\n  return withErrorHandling(\"process_text\", async () => {\n    const { text, repeat } = validateArgs(schema, args);\n    const result = await service.processText(text, repeat);\n    return { content: [{ type: \"text\", text: result }] };\n  });\n}\n```\n\n𝗘𝘅𝘁𝗲𝗻𝗱𝗶𝗻𝗴 𝗶𝘁 𝗳𝗼𝗿 𝘆𝗼𝘂𝗿 𝗼𝘄𝗻 𝘁𝗼𝗼𝗹𝘀:\n\nStructured pino logging routes safely to stderr throughout, so it never corrupts the MCP stdio transport regardless of what you add.\n\nWhen you're ready to ship, tag a release and a GitHub Actions workflow publishes to both npm and the MCP Registry automatically:\n\n```\ngit tag v1.0.0 && git push origin v1.0.0\n```\n\nThe goal is simple — spend your time on the logic that makes your MCP server useful, not on re-solving logging, validation, and bundling for the fifth time.\n\nIt's MIT licensed and live on GitHub now. If you're building agentic AI integrations, I'd love feedback or a star:\n\n🔗 github.com/qmmughal/mcp-server-template", "url": "https://wpnews.pro/news/building-mcp-servers-for-claude-cursor-here-s-a-starting-point", "canonical_source": "https://dev.to/qmmughal/building-mcp-servers-for-claude-cursor-heres-a-starting-point-2flm", "published_at": "2026-07-26 06:21:09+00:00", "updated_at": "2026-07-26 06:29:03.961896+00:00", "lang": "en", "topics": ["developer-tools", "ai-agents", "ai-infrastructure", "artificial-intelligence"], "entities": ["mcp-server-template", "Claude Desktop", "Cursor", "Zod", "Vitest", "esbuild", "GitHub Actions", "npm"], "alternates": {"html": "https://wpnews.pro/news/building-mcp-servers-for-claude-cursor-here-s-a-starting-point", "markdown": "https://wpnews.pro/news/building-mcp-servers-for-claude-cursor-here-s-a-starting-point.md", "text": "https://wpnews.pro/news/building-mcp-servers-for-claude-cursor-here-s-a-starting-point.txt", "jsonld": "https://wpnews.pro/news/building-mcp-servers-for-claude-cursor-here-s-a-starting-point.jsonld"}}