http-mcp-server

http-mcp-server

Mock HTTP server implementing MCP (Model Context Protocol) with streamable HTTP transport, health endpoint, and example tools like echo and time.

Category
Visit Server

README

MCP Mock HTTP

Mock HTTP server for MCP-style clients.

Quick path

  1. Put PORT and MCP_NAME in .env at the repo root.
  2. Run pnpm dev or pnpm start.
  3. Open http://localhost:<PORT>/health or connect a client to http://localhost:<PORT>/mcp.

Runtime configuration

Source Behavior
.env in the repo root Loaded by src/server.ts before env parsing
Shell environment Takes precedence over .env values
src/config/env.ts Validates PORT and MCP_NAME, then applies defaults
Variable Default Purpose
PORT 3000 HTTP listen port
MCP_NAME mcp-mock MCP server name and health payload name

Versioning

Source Purpose
package.json Single source of truth for the server version
src/version.ts Runtime accessor used by the MCP server and tests
CHANGELOG.md Repository-level release tracking

When reusing this repository as a base for another MCP server, update the package version and add a changelog entry before the first release.

Requirements

  • Node.js 26.0.0
  • pnpm

Install

pnpm install

Run

pnpm dev

The server bootstrap loads .env automatically, so local values apply without exporting them in the shell.

Build

pnpm build

Docker

Build the production image:

docker build -t mcp-server .

Run it with runtime environment variables:

docker run --rm -p 3000:3000 --env-file .env mcp-server

Override values at runtime when needed:

docker run --rm -p 3000:3000 -e PORT=8080 -e MCP_NAME=my-mcp mcp-server

The image does not contain your .env file. That keeps secrets out of the image while still letting the server read .env-style values if you provide them at runtime.

Quality checks

pnpm typecheck
pnpm lint
pnpm test
pnpm coverage
pnpm format

pnpm coverage runs Vitest with the v8 coverage provider and prints a coverage summary in the terminal.

Endpoints

  • GET /health — JSON health response with ok, name, and uptime.
  • /mcp* — MCP streamable HTTP transport handled by the SDK bridge.

MCP Inspector

Use the Inspector as a client against the running HTTP server:

  1. Start this project.

  2. Launch the Inspector:

    npx @modelcontextprotocol/inspector
    
  3. In the Inspector, choose the Streamable HTTP transport and connect to http://localhost:<PORT>/mcp.

  4. Verify the connection by listing tools or calling one of the registered tools.

Project structure

  • src/server.ts — process bootstrap only
  • src/app.ts — HTTP server composition and routing
  • src/config/env.ts — environment parsing and validation
  • src/http/routes/health.ts — health route handler
  • src/mcp/create-server.ts — MCP server construction and tool registration
  • src/version.ts — runtime version resolution from package.json
  • src/mcp/tools/echo.ts — echo tool registration
  • src/mcp/tools/time.ts — time tool registration
  • src/mcp/transport.ts — Node HTTP to MCP transport bridge

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured