Express-REST-API-and -Framework
Express REST API and MCP Server Framework is a comprehensive development framework for building RESTful APIs and MCP servers with Express.js. It provides a complete template for creating production-ready APIs using Node.js, Express, Mongoose (MongoDB), and Sequelize (SQL databases).
claude mcp add --transport stdio iolufemi-express-rest-api-and-mcp-server-framework node src/server.js \ --env PORT="Port the MCP server should listen on (defaults to 3000 if not set)" \ --env MCP_HOST="Host for MCP server (optional)"
How to use
This framework provides both a REST API and an MCP (Model Context Protocol) server for each generated service. After generating a service (e.g., users) you’ll have standard REST endpoints like GET/POST/PUT/DELETE /users, along with MCP tools (e.g., create_users, update_users, delete_users) and MCP resources (e.g., users://list, users://{id}) that allow large language models and other MCP clients to discover and operate on your data without hitting raw REST endpoints directly. Use the MCP interface to integrate AI workflows, tool execution, and context sharing with your existing API. The MCP server is designed to work with Cursor and other MCP clients, enabling AI-driven interactions with your service while preserving the traditional REST surface for clients.
To start interacting with MCP tools, start the server and point your MCP client at the exposed MCP endpoints. Tools typically follow a naming convention like <resource>_<action> (e.g., create_users) and resources use the <resource>://<path> syntax (e.g., users://list or users://{id}). Use the REST API to manage data in parallel and rely on the MCP layer for AI-assisted operations and discovery.
How to install
Prerequisites
- Node.js 22.x or higher (LTS recommended)
- npm (comes with Node.js)
- Optional: MongoDB (for default database) and Redis (for queue and caching) if you plan to use the full framework features
Install and set up
- Clone the repository:
git clone https://github.com/iolufemi/Express-REST-API-and-MCP-Server-Framework.git ./yourProjectName
cd yourProjectName
- Install dependencies:
npm install
- Generate a sample service to verify MCP and REST coexistence (example):
npm run generate -- --name yourFirstEndpoint
- Start the development server (hot reload):
npm run dev
- Run in production after building:
npm run build
npm start
Notes
- Ensure your environment provides MongoDB and Redis if you plan to use the framework’s data stores and queue features.
- Check environment variables if you customize MCP ports or hosts in production.
Additional notes
Tips and common issues:
- The generate script uses a gulp-based workflow; use npm run generate to ensure the correct gulpfile is used.
- When testing MCP endpoints, combine REST calls with MCP tool usage to validate both interfaces.
- If you plan to use an external API as a DB (API as DB), follow the API-as-DB guidance in the documentation and adjust your model schemas accordingly.
- Common MCP issues involve misconfigured MCP endpoints or mismatched response shapes; ensure your schemaObject mappings reflect actual API responses when using API-as-DB setups.
- For production deployments, consider enabling encryption, rate limiting, and security headers as described in the framework docs.
Related MCP Servers
trigger.dev
Trigger.dev – build and deploy fully‑managed AI agents and workflows
discord
A MCP server for the Discord integration. Enable your AI assistants to seamlessly interact with Discord. Enhance your Discord experience with powerful automation capabilities.
mssql
MSSQL Server MCP implementation written in C#
guidance-for-scalable-model-inference-and-agentic-ai-on-amazon-eks
Comprehensive, scalable ML inference architecture using Amazon EKS, leveraging Graviton processors for cost-effective CPU-based inference and GPU instances for accelerated inference. Guidance provides a complete end-to-end platform for deploying LLMs with agentic AI capabilities, including RAG and MCP
mcp-file-operations
A Model Context Protocol (MCP) server that provides enhanced file operation capabilities with streaming, patching, and change tracking support.
dataagents
Data Agents are intelligent assistants built by data engineers to help non-data professionals navigate the organization’s data infrastructu