Get the FREE Ultimate OpenClaw Setup Guide β†’

easy

Absurdly easy Model Context Protocol Servers in Typescript

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

How to use

EasyMCP is a TypeScript-based framework for building MCP servers with minimal boilerplate. It provides a high-level API to declare Tools, Prompts, Resources, Resource Templates, and Roots in a way that feels similar to defining routes in Express. The library also offers an experimental decorators API that can autoguess input arguments and wiring, as well as a Context object that tools can use to log progress, read resources, and report status. Use it to rapidly create server endpoints that expose your prompts, tools, and resources for client usage, while benefiting from improved type safety and developer experience.

To use EasyMCP, install the package in your project, write your MCP class by extending EasyMCP or by using the Express-like API, and then start the server. The Quick Start demonstrates both the decorator-based approach (experimental) and the traditional Express-like API for defining resources, templates, tools, and prompts. The decorators API can infer parameter types and inputs automatically, while the Express-like API provides a more explicit, stable surface for defining your MCP surface. When running, clients can call your defined tools and prompts, fetch resources, and interact with resource templates as part of the MCP service.

How to install

Prerequisites:

  • Node.js or bun-enabled environment (as recommended by the project)
  • A modern shell (bash/zsh/powershell)
  1. Create a new project (if you don’t have one):
  • mkdir my-mcp-server
  • cd my-mcp-server
  • npm init -y
  1. Install EasyMCP (and any runtime you prefer, e.g., bun or node):
  • npm install easy-mcp
  1. Create your MCP server file (e.g., server.ts or server.js) and implement your MCP class using the library. Example structure:
import EasyMCP from "easy-mcp";

class MyMCP extends EasyMCP {
  // Define resources, templates, tools, prompts here using the API or decorators
}

const mcp = new MyMCP({ version: "1.0.0" });
mcp.serve?.(); // or mcp.serve() depending on your setup
  1. Start the server (adjust to your runtime):
  • If using bun: bun start
  • If using node with built output: node dist/server.js
  1. Verify the MCP server is running by hitting its endpoints/tools/prompts as defined in your code.

Optional: Add a package.json script for convenience, e.g.:

"scripts": {
  "start": "bun start:express" // or "node dist/server.js" depending on setup
}

Additional notes

Tips and common notes:

  • The project is in beta; expect API changes and potential issues. Report any bugs you encounter.
  • Beta limitations include no MCP sampling, no SSE support, no resource update notifications, and some prompts may have incomplete input serialization.
  • Decorators API is experimental and aims to reduce boilerplate by inferring tool, prompt, and resource arguments. If you rely on stable inputs, prefer the Express-like API defined in the Quick Start section.
  • Environment variables: define any required API keys, database URLs, or logging configurations in your deployment environment or via a .env file. The mcp_config env map can be used to supply per-server environment variables as needed.
  • When upgrading, review changes to input inference and optional parameter handling to ensure compatibility with existing tools and prompts.

Related MCP Servers

Sponsor this space

Reach thousands of developers β†—