A community-driven registry for Claude, Cursor, Windsurf, Cline & more. Not affiliated with Anthropic.
Are you the author? Sign in to claim
Express REST API and MCP Server Framework is a comprehensive development framework for building RESTful APIs and MCP ser
Express REST API and MCP Server Framework is a comprehensive development framework for building RESTful APIs with Express.js. It provides a complete template for creating production-ready APIs using Node.js, Express, Mongoose (MongoDB), and Sequelize (SQL databases). Every generated service exposes both REST endpoints and an MCP (Model Context Protocol) server so LLMs can interact with your API directly.
GitHub repository: iolufemi/Express-REST-API-and-MCP-Server-Framework
In computer programming, an application programming interface (API) is a set of clearly defined methods of communication between various software components. A good API makes it easier to develop a computer program by providing all the building blocks, which are then put together by the programmer. An API may be for a web-based system, operating system, database system, computer hardware or software library. Just as a graphical user interface makes it easier for people to use programs, application programming interfaces make it easier for developers to use certain technologies in building applications. - Wikipedia
Representational state transfer (REST) or RESTful web services is a way of providing interoperability between computer systems on the Internet. REST-compliant Web services allow requesting systems to access and manipulate textual representations of Web resources using a uniform and predefined set of stateless operations. - Wikipedia
NOTE: The use of this project requires that you have a basic knowledge of using Express in building a REST API.
MCP (Model Context Protocol) is an open protocol that lets AI assistants (e.g. Claude, ChatGPT, Cursor) interact with your application through a standard interface. Instead of the LLM calling your REST API with raw HTTP, it uses MCP to discover and use tools (actions like create, update, delete) and resources (read-only data like list and get-by-id). - Wikipedia
This framework ships with a built-in MCP server. When you generate a service with npm run generate -- --name users, the same data is exposed as:
GET/POST/PUT/DELETE /users for apps and integrationscreate_users, update_users, list_users for LLMsusers://list, users://{id} for LLM contextYou get one codebase, dual access: traditional REST for clients and MCP for AI. See MCP Guide for setup (including Cursor) and details.
npm run generate -- --name <Name>)users.v1.ts map to /v1/users; latest stays at /usersnpm testClone the repository and install dependencies:
$ git clone https://github.com/iolufemi/Express-REST-API-and-MCP-Server-Framework.git ./yourProjectName
$ cd yourProjectName
$ npm install
| Command | Description |
|---|---|
npm run generate -- --name <Name> | Generate a MongoDB CRUD endpoint (route, controller, model, MCP registration, tests). Use -n for short. |
npm run generate -- --name <Name> --sql | Generate a SQL CRUD endpoint (Sequelize model, SQL controller/routes/tests). |
npm run generate -- --name <Name> --baseurl <URL> --endpoint <path> | Generate an API-as-DB endpoint (proxy to external API). Short: -n, -b, -e. |
npm run dev | Start development server with hot reload |
npm run build | Compile TypeScript to dist/ |
npm start | Run production server |
npm test | Run unit tests (Mocha, spec reporter) |
npm run type-check | Run TypeScript type-check only |
npm run release -- --release-type patch | Bump version, changelog, tag, and GitHub release (use minor or major for --release-type as needed) |
For release to create the GitHub release, set GITHUB_TOKEN, GIT_OAUTH_TOKEN, or CONVENTIONAL_GITHUB_RELEASER_TOKEN to a Personal Access Token: classic token needs repo scope; fine-grained token needs Releases: Read and write for this repository. Example: GITHUB_TOKEN=ghp_xxx npm run release -- --release-type patch. You can also use RELEASE_TYPE=minor npm run release (no extra args).
The generate script runs npx gulp --gulpfile gulpfile.cjs service so the correct gulpfile is always used (avoids "No gulpfile found" when running gulp directly).
Generate a complete CRUD service with both REST API and MCP server support using the generate script (runs the gulp service task with the correct config via npx):
$ npm run generate -- --name yourFirstEndpoint
Or using the short form:
$ npm run generate -- -n yourFirstEndpoint
This single command generates:
Why
npm run generate? The project usesgulpfile.cjs. Runninggulp servicedirectly can fail with "No gulpfile found". Thegeneratescript runsnpx gulp --gulpfile gulpfile.cjs service, so you don't need to install gulp globally or remember the gulpfile path.
With the generate command, you have the option of using either Mongo DB, an SQL compatible DB or using an API generated by this framework as a database model. To use an API as a database you can pass the baseurl and the endpoint option; for an SQL compatible db, pass the sql option. See examples below.
$ npm run generate -- --name yourEndpointWithAPIAsDB --baseurl http://localhost:8080 --endpoint users
See API as DB specification for the contract your API must implement and how to test for compliance.
Important for MCP: After generating an API-based model, you need to:
schemaObject in the generated model file to match the real data structuredescription and mcpDescription fields for each schema fieldThe generated template includes a schema definition section with examples - replace them with your actual API response fields. The schema endpoint (GET /{service}/schema) can optionally discover schema from the external API at GET {baseurl}/{endpoint}/schema; if that fails or is not available, it falls back to the _schema defined in the model file.
$ npm run generate -- --name yourEndpointWITHSQL --sql
Note: You can use
-ninstead of--name,-binstead of--baseurl,-einstead of--endpoint.
Try out your new endpoint.
Start the app
$ npm start
by default, the app will start on POST 8080
You can change the PORT by adding a PORT environment variable.
eg.
$ PORT=6000 npm start
now the app will start on PORT 6000
To start the app for development, run
$ npm run dev
This will automatically restart your app whenever a change is detected using tsx watch.
When you generate a service, you get access to:
[POST] http://localhost:8080/yourFirstEndpoint - Create resources (single or bulk)[GET] http://localhost:8080/yourFirstEndpoint - List/search resources (supports filters, pagination, sorting, projection, date range)[GET] http://localhost:8080/yourFirstEndpoint/:id - Get a specific resource[PUT] http://localhost:8080/yourFirstEndpoint - Update multiple resources (with query)[PATCH] http://localhost:8080/yourFirstEndpoint/:id - Update a single resource[DELETE] http://localhost:8080/yourFirstEndpoint?key=value - Delete multiple resources (with query)[DELETE] http://localhost:8080/yourFirstEndpoint/:id - Delete a single resource[POST] http://localhost:8080/yourFirstEndpoint/:id/restore - Restore a previously deleted resource[GET] http://localhost:8080/yourFirstEndpoint/schema - Get schema metadata (fields, types, descriptions) for MCP and API consumers[GET] http://localhost:8080/health - Full health status (databases, queues, uptime)[GET] http://localhost:8080/health/ready - Readiness probe (for Kubernetes/Docker)[GET] http://localhost:8080/health/live - Liveness probe (for Kubernetes/Docker)[GET] http://localhost:8080/mcp/config - Generate MCP client configuration JSON
format (claude|chatgpt|generic), transport (http|sse), baseUrl, downloadGET /mcp/config?format=claude&transport=http&download=true[GET] http://localhost:8080/mcp/info - Get MCP server information (tools, resources, services)Every generated service is automatically exposed as MCP tools and resources (model name is lowercased; e.g. Items → items):
MCP Tools (actions LLMs can call):
create_<model> — Create one record (e.g. create_items)create_many_<model> — Bulk create (e.g. create_many_items; pass { "items": [ {...}, {...} ] })update_<model> — Update a record by id and datadelete_<model> — Delete a record by idMCP Resources (read-only; LLMs read via resource URIs):
<model>://list — List records (optional ?limit=N&skip=M for pagination; response includes pagination.nextPageUri)<model>://{id} — Get one record by id<model>://search — Search (e.g. ?q=... or ?query=...)Example for a generated Items service: tools create_items, create_many_items, update_items, delete_items; resources items://list, items://search, items://{id}.
Note: For every
POSTAPI call, you need to send anx-tagvalue in the header. This value is used for secure communication between the server and client. It is used for AES encryption when secure mode is enabled. To get a validx-tag, call the[GET] /initializeendpoint.
The framework includes a distributed job queue system for background processing.
Current: Uses Bull queue system (Redis-based) for robust job processing
The clock dispatches scheduled tasks to workers (similar to a crontab). Only run one instance at a time.
$ npm run clock
To define a scheduled job, create a record in the Clock collection in MongoDB (connected via LOG_MONGOLAB_URL):
{
"crontab" : "* * * * *",
"name" : "Task Name",
"job" : "theJobAsDefinedInTheWorkerFile",
"enabled" : true,
"arguments" : {}
}
Note: After changing clock configuration in the database, restart the clock process.
Workers process background jobs from the queue:
$ npm run workers
Workers are useful for:
See src/services/queue/jobs.ts for sample tasks and src/services/queue/workers.ts for worker configuration.
You can create multiple versions of your API endpoints by simply adding the version number to your route file name. eg. users.v1.ts will put a version of the users resources on the /v1/users endpoint. users.v2.ts will put a version of the users resources on the /v2/users endpoint. The latest version of the resources will always be available at the /users endpoint.
NOTE: This project will automatically load route files found in the
src/routes/folder.
Express-REST-API-Generator/
├── src/
│ ├── config/ # Configuration (env, app config)
│ ├── controllers/ # Request handlers (business logic)
│ ├── models/ # Data models (Mongoose/Sequelize)
│ ├── routes/ # Express routes (loaded automatically)
│ ├── services/ # Service layer
│ │ ├── queue/ # Job queue (Bull), clock, workers
│ │ ├── database/ # MongoDB, Redis, SQL, API client
│ │ ├── logger/ # Logging
│ │ └── ...
│ └── mcp/ # MCP server (tools, resources, HTTP transport)
│ ├── servers/ # Models, controllers, unified server
│ └── services/ # Auto-generated MCP service registrations
├── template/ # Code generation templates (gulp)
├── test/ # Test suites
└── docs/ # Documentation
This framework provides a built-in MCP server so LLMs can use your API via tools and resources (see What is MCP? above).
When you generate a service with npm run generate -- --name users, the framework automatically:
Once your service is running, you can connect LLM clients via:
The framework provides endpoints to generate MCP client configuration files:
GET /mcp/config - Generate configuration JSON for LLM clients
claude, chatgpt, genericGET /mcp/config?format=claude&transport=http&download=trueGET /mcp/info - Get MCP server information
See MCP Guide for complete documentation on using and configuring MCP servers.
If you need support or want to report a bug, please log an issue here
All generated services come with comprehensive test suites covering:
$ npm test
The project maintains 90%+ test coverage with:
Coverage reports are generated automatically and can be viewed in the coverage/ directory.
View how to contribute here
View the code of conduct here
This project has been fully modernized with:
/health, /health/ready, /health/live for monitoringThe application follows a strict initialization sequence to ensure reliability:
MCP (Model Context Protocol) allows LLMs to interact with your API directly. Instead of making HTTP requests, LLMs can call tools and access resources through the MCP protocol. This enables AI-powered features like:
No! When you generate a service with npm run generate -- --name users, the framework automatically generates all MCP server code. Your service is immediately available to LLMs without any additional configuration.
Both are generated automatically and work together seamlessly.
The TypeScript migration is complete! All source files have been migrated to TypeScript. Test files are being migrated next.
MCP server integration for DaVinci Resolve Studio
Run Claude Code as an MCP server so any agent can delegate coding tasks to it
Browser automation using accessibility snapshots instead of screenshots
A Jetbrains IDE IntelliJ plugin aimed to provide coding agents the ability to leverage intelliJ's indexing of the codeba
0
via web
0
via CLI