Get the FREE Ultimate OpenClaw Setup Guide →

mcp -template

Minimal typescript template to build an mcp server

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio hypermodel-labs-mcp-server-template node ABSOLUTE_PATH_TO_MCP_SERVER/build/index.js

How to use

This MCP server template provides a starting point for building your own Model Context Protocol (MCP) server. It uses TypeScript and a sample tool implementation to demonstrate how to expose tools that Cursor or Claude Desktop can invoke. The server is designed to be compiled to JavaScript under build/index.js, which is then run as a Node process. To integrate with client environments, you configure an MCP entry that runs node ABSOLUTE_PATH_TO_MCP_SERVER/build/index.js, which loads your server and exposes the defined tools for querying or actioning via the MCP framework.

How to install

Prerequisites:

  • Node.js and npm/yarn/pnpm installed
  • Basic TypeScript knowledge

Install and set up:

  1. Clone or download the template repository
  2. Install dependencies (example uses pnpm; switch to npm/yarn if desired): pnpm install
  3. Build the project to generate the runtime script: pnpm run build
  4. Start or reference the built server in your MCP configuration: node ABSOLUTE_PATH_TO_MCP_SERVER/build/index.js

Tip: If you plan to publish or reuse this server as a package, update package.json with a proper name and version, and adjust build scripts as needed.

Additional notes

Notes and tips:

  • The template includes a sample tool implemented in index.ts. Customize or replace it with your own tools using server.tool(name, description, paramsSchema, handler).
  • When configuring clients (Cursor or Claude Desktop), point to the built server script at build/index.js via Node.
  • If you modify TypeScript sources, remember to run the build script to regenerate build/index.js before running the server.
  • If environment variables are needed (e.g., API keys or endpoints), add an env object to your MCP server configuration and reference them in your code via process.env or the provided environment bindings.

Related MCP Servers

Sponsor this space

Reach thousands of developers