Express

An example of using express-mcp-handler to serve an mcp serve via http
  • typescript

1

GitHub Stars

typescript

Language

6 months ago

First Indexed

2 months ago

Catalog Refreshed

Documentation & install

Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.

Installation

Add the following to your MCP client configuration file.

Configuration

View docs

You run a stateless MCP server built on Express and TypeScript. It exposes an MCP endpoint that lets you initialize a session, call an echo tool, and create a user prompt, all while keeping the server itself stateless and easy to scale. This enables clean integration with language models that need external data access and simple actions through a concise set of MCP components.

How to use

When you want to interact with the MCP server, you send requests to its MCP endpoint. First, you initialize the session to establish capabilities and client information. After initialization, you can call the echo tool to mirror a message back to you and create a prompt that asks the user for input. This setup lets your language model fetch data, perform an action, and then receive results in a consistent, stateless workflow.

How to install

Prerequisites you need before installation: Node.js 18 or newer. You also need npm or yarn as your package manager.

Step 1: Clone the project repository to your local machine.

Step 2: Install dependencies.

Step 3: Build and run the server in development mode to enable auto-reloading during development.

Install commands

# Clone the repository
git clone https://github.com/your-username/sample-express-mcp-server.git
cd sample-express-mcp-server

# Install dependencies
npm install

Development commands

# Build the TypeScript code
npm run build

# Run in development mode with auto-reloading
npm run dev

# Run tests (when added)
npm test

Usage notes

To exercise the MCP server, start it and then send requests to the MCP endpoint at http://localhost:3001/mcp. Begin with an initialize call to set up capabilities and client info, then request the echo tool with a message to see the server return it back, and finally create a prompt that asks for user input. The structure remains stateless between requests, so each call is independent from previous ones.

Additional notes

The server provides an echo-based demonstration of the MCP flow, including a Resource, a Tool named echo, and a Prompt named echo. This simple setup helps you verify the MCP transport and endpoint behavior in your environment.

Available tools

echo

Echoes the provided message back as a tool response.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational