cd /news/developer-tools/building-mcp-servers-for-claude-cursโ€ฆ ยท home โ€บ topics โ€บ developer-tools โ€บ article
[ARTICLE ยท art-74021] src=dev.to โ†— pub= topic=developer-tools verified=true sentiment=โ†‘ positive

Building MCP servers for Claude & Cursor? Here's a starting point.

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.

read2 min views1 publishedJul 26, 2026

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.

I 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

It'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.

๐—š๐—ฒ๐˜๐˜๐—ถ๐—ป๐—ด ๐˜€๐˜๐—ฎ๐—ฟ๐˜๐—ฒ๐—ฑ ๐˜๐—ฎ๐—ธ๐—ฒ๐˜€ ๐—ณ๐—ผ๐˜‚๐—ฟ ๐—ฐ๐—ผ๐—บ๐—บ๐—ฎ๐—ป๐—ฑ๐˜€:

git clone https://github.com/qmmughal/mcp-server-template.git
cd mcp-server-template && npm install
cp .env.example .env
npm run dev

That 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.

๐—ช๐—ต๐—ฎ๐˜ ๐—ฎ ๐˜๐—ผ๐—ผ๐—น ๐—ฎ๐—ฐ๐˜๐˜‚๐—ฎ๐—น๐—น๐˜† ๐—น๐—ผ๐—ผ๐—ธ๐˜€ ๐—น๐—ถ๐—ธ๐—ฒ:

Every 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:

const schema = z.object({
  text: z.string().describe("The text to process"),
  repeat: z.number().int().min(1).max(10).optional()
});

export async function handleExampleTool(args: unknown, service: ExampleService) {
  return withErrorHandling("process_text", async () => {
    const { text, repeat } = validateArgs(schema, args);
    const result = await service.processText(text, repeat);
    return { content: [{ type: "text", text: result }] };
  });
}

๐—˜๐˜…๐˜๐—ฒ๐—ป๐—ฑ๐—ถ๐—ป๐—ด ๐—ถ๐˜ ๐—ณ๐—ผ๐—ฟ ๐˜†๐—ผ๐˜‚๐—ฟ ๐—ผ๐˜„๐—ป ๐˜๐—ผ๐—ผ๐—น๐˜€:

Structured pino logging routes safely to stderr throughout, so it never corrupts the MCP stdio transport regardless of what you add.

When you're ready to ship, tag a release and a GitHub Actions workflow publishes to both npm and the MCP Registry automatically:

git tag v1.0.0 && git push origin v1.0.0

The 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.

It's MIT licensed and live on GitHub now. If you're building agentic AI integrations, I'd love feedback or a star:

๐Ÿ”— github.com/qmmughal/mcp-server-template

โ”€โ”€ more in #developer-tools 4 stories ยท sorted by recency
โ”€โ”€ more on @mcp-server-template 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain โ€” perfect for shipping the agent you just read about.

$git push zahid main
โ†’ Live at https://your-agent.zahid.host โœ“
Get free account โ†’ Pricing
from โ‚ฌ0/mo ยท no card required
LIVE [news/building-mcp-serversโ€ฆ] indexed:0 read:2min 2026-07-26 ยท โ€”