Express MCP Server
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Express MCP Server
A clean, modular implementation of the Model Context Protocol (MCP) using Express.js and TypeScript.
Quick Start
# Install dependencies
npm install
# Development (with file watching)
npm run dev
# Production
npm run build
npm start
# Type checking
npm run type-checkServer runs on http://localhost:3001
Related MCP server: MCP Server Basic Example
Endpoints
Health:
GET /mcp/health- Server health statusInfo:
GET /mcp/info- Server information and capabilitiesMCP Protocol:
POST/GET/DELETE /mcp- Main MCP endpoints with streaming support
Project Structure
src/
├── index.ts Entry point - starts the server
├── app.ts Express app factory
├── server/
│ └── mcp.ts Core MCP server logic
├── routes/
│ └── mcp.ts HTTP route handlers
└── tools/
└── index.ts Tool definitionsTotal: 201 lines of focused, readable code
Architecture
Single Responsibility Principle
Each module has one clear purpose:
index.ts(10 lines) - Server startupapp.ts(20 lines) - Express setupserver/mcp.ts(60 lines) - MCP protocol handlingroutes/mcp.ts(69 lines) - HTTP routingtools/index.ts(42 lines) - Tool catalog
Features
✓ Official MCP SDK integration (StreamableHTTPServerTransport)
✓ HTTP streaming (chunked encoding + Server-Sent Events)
✓ Session management with automatic UUID generation
✓ Zod schema validation for tool inputs
✓ Comprehensive error handling
✓ Health check and info endpoints
✓ TypeScript strict mode
Tools
Three example tools are included:
add(a, b) - Add two numbers
multiply(x, y) - Multiply two numbers
echo(message) - Echo a message
Adding a New Tool
Edit src/tools/index.ts and add to the array:
{
name: "my-tool",
description: "What this tool does",
inputSchema: {
param1: z.string().describe("Parameter description"),
param2: z.number().describe("Another parameter"),
},
handler: async (args) => {
const p1 = args.param1 as string;
const p2 = args.param2 as number;
// Tool logic here
return `Result: ${p1} ${p2}`;
},
}Then rebuild:
npm run build
npm startTesting
# Health check
curl http://localhost:3001/mcp/health
# Server info
curl http://localhost:3001/mcp/info
# MCP protocol request (with proper headers)
curl -X POST http://localhost:3001/mcp \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}'Development
# Watch mode (recompiles on file changes)
npm run dev
# Type checking only
npm run type-check
# Build production bundle
npm run buildEnvironment Variables
PORT(default: 3001) - Server port
PORT=4000 npm startStack
Express.js - Web framework
TypeScript - Type safety
Zod - Schema validation
MCP SDK - Protocol implementation
Node.js 18+ - Runtime
Standards
MCP Protocol Version: 2024-11-05
HTTP Streaming: Chunked encoding + SSE
Schema Validation: Zod
Code Format: TypeScript with strict mode
Code Style: Tabs, consistent formatting
Documentation
ARCHITECTURE.md - Detailed architecture overview
QUICK_START.md - 5-minute setup guide
COMMANDS.md - Command reference
REFACTORING_SUMMARY.md - Development history
License
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
A Model Context Protocol server for Wix AI tools
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
MCP server for progressive tool usage at any scale (see https://klavis.ai)
Model Context Protocol server for Studex tools, notifications, and profile integrations
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceA Model Context Protocol server built with Express.js that provides cryptographic tools including key pair generation, shared secret derivation, and message encryption/decryption.216-
- FlicenseNot gradedqualityDmaintenanceA sample implementation of Model Context Protocol server demonstrating core functionality with simple arithmetic tools and greeting resources.-
- -licenseNot gradedqualityNot gradedmaintenanceAn Express server implementation of Model Context Protocol that allows websites to connect to LLMs through streamable HTTP and stdio transports, with a built-in chat UI for testing responses.-
- AlicenseBqualityDmaintenanceA demonstration server implementing the Model Context Protocol (MCP) that provides three basic tools: echo, calculator, and current time functionality.38 npmISC