http-mcp-server
Mock HTTP server implementing MCP (Model Context Protocol) with streamable HTTP transport, health endpoint, and example tools like echo and time.
README
MCP Mock HTTP
Mock HTTP server for MCP-style clients.
Quick path
- Put
PORTandMCP_NAMEin.envat the repo root. - Run
pnpm devorpnpm start. - Open
http://localhost:<PORT>/healthor connect a client tohttp://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 withok,name, anduptime./mcp*— MCP streamable HTTP transport handled by the SDK bridge.
MCP Inspector
Use the Inspector as a client against the running HTTP server:
-
Start this project.
-
Launch the Inspector:
npx @modelcontextprotocol/inspector -
In the Inspector, choose the Streamable HTTP transport and connect to
http://localhost:<PORT>/mcp. -
Verify the connection by listing tools or calling one of the registered tools.
Project structure
src/server.ts— process bootstrap onlysrc/app.ts— HTTP server composition and routingsrc/config/env.ts— environment parsing and validationsrc/http/routes/health.ts— health route handlersrc/mcp/create-server.ts— MCP server construction and tool registrationsrc/version.ts— runtime version resolution frompackage.jsonsrc/mcp/tools/echo.ts— echo tool registrationsrc/mcp/tools/time.ts— time tool registrationsrc/mcp/transport.ts— Node HTTP to MCP transport bridge
Recommended Servers
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.
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.
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.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
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.
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.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.
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.