Get the FREE Ultimate OpenClaw Setup Guide →

node

A sample Node.js MCP Server template that you can use to create your own MCP servers.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio iamtraction-node-mcp-server node dist/server.js

How to use

This MCP server template provides a ready-to-use TypeScript-based MCP server that can operate over both stdio and Server-Sent Events (SSE) transports. It leverages the FastMCP framework for fast development and offers a structured project layout with prompts, resources, and tools that you can extend to fit your model context needs. By default, the server is configured to run a standard MCP setup and can be started in development mode with hot-reload, or built for production. You can customize the prompts, resources, and tools by adding files under src/prompts, src/resources, and src/tools, and then registering them in src/server.ts. The template demonstrates how to configure transport types (stdio or httpStream/SSE) and how to start the server with the desired options.

To use the available capabilities, you can start the development server and then issue requests via the selected transport. When running with stdio, the server communicates through standard input/output, which is useful for local tooling and automation. When running with SSE, the server exposes an HTTP/HTTPS endpoint that streams MCP messages to clients, suitable for browser or external integrations. The README and code comments provide examples for adding prompts, resources, and tools, as well as instructions for configuring transports and ports.

Practical usage scenarios include starting the server in dev mode during development, building for production, and then running the production server with the built artifacts. The template also shows how to create and wire in MCP prompts, resources, and tools to customize the behavior of the MCP server to your domain.

How to install

Prerequisites:

  • Node.js (LTS) installed on your machine
  • npm or yarn package manager
  1. Clone the repository or use the template to create your MCP server:
  1. Install dependencies:
npm install
# or
yarn install
  1. Build the TypeScript code (produces dist/):
npm run build
# or
yarn build
  1. Run the server (production):
npm run start
# or
yarn start
  1. Run in development mode (with hot-reload):
npm run dev
# or
yarn dev

Notes:

  • If you modify TypeScript sources, re-run the build step before starting the production server.
  • Ensure (if using SSE) the appropriate port and URL are accessible to clients.
  • You can customize prompts, resources, and tools by editing files under src/ and updating server.ts accordingly.

Additional notes

Tips and common considerations:

  • The template supports both stdio and SSE transports; choose stdio for local tooling or SSE for remote clients via an HTTP stream.
  • After building, dist/server.js will be used by the production command. Ensure the build step runs in CI or your deployment workflow.
  • If you need to change the default port or transport, modify the server.start() configuration in src/server.ts. For SSE, you may need to configure an accessible URL if deployed behind a proxy or gateway.
  • Add new prompts, resources, or tools by placing modules in src/prompts, src/resources, and src/tools respectively, and import/register them in src/server.ts as shown in the examples.
  • Check ESLint-related issues with npm run lint to maintain code quality.
  • The template relies on FastMCP; ensure compatibility with the MCP version you intend to use and review the Transport docs for any environment-specific limitations.

Related MCP Servers

Sponsor this space

Reach thousands of developers