Menu

1 / 2

Build an MCP Server in Node.js & TypeScript: A Practical HazelJS Tutorial

DEV Community·Muhammad Arslan·6 months ago
#dO8fW0AD
#software#coding#development#engineering#tool
Reading 0:00
15s threshold

Expose your existing TypeScript classes to Cursor , Claude Desktop , and any other Model Context Protocol (MCP) client — without writing protocol code, without a heavy SDK, and without standing up a separate HTTP service.

This post walks through the hazeljs-mcp-starter example in this folder: a small but realistic task board MCP server, written in TypeScript, that you can run locally with node dist/main.js and immediately drop into your AI tooling. It is not another "hello world" — every pattern below is the same one you would use to ship an internal support agent , a runbook automation server , or an admin operations panel for your team.

By the end you will know:

What MCP actually is (and is not), at the wire level

Why a tiny abstraction like @hazeljs/mcp beats writing JSON-RPC by hand

How to define tools with @Tool() decorators in idiomatic TypeScript

How to wire the resulting server into Cursor and Claude Desktop

How to test it without an LLM in the loop

How to evolve from in-memory toy code to a…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.