MindBridge X is a full-stack playground for rapidly designing mock REST endpoints, testing payloads, and exposing them to Model Context Protocol (MCP) clients. The toolkit bundles a mock API web server, an MCP bridge, and a CLI code generator so you can prototype integrations quickly.
MindBridge X provides a visual dashboard for crafting endpoints, a JSON-RPC bridge that turns those endpoints into MCP tools, and a generator CLI that scaffolds code from natural-language prompts. It stores all configuration in SQLite by default and secures the admin interface with an ADMIN_KEY.
- Visual endpoint builder: Create REST routes with method, path, headers, delays, and status toggles. Built-in request logs help you trace payloads without leaving the dashboard.
- Templated responses: Use Handlebars-style helpers with environment variables, path params, and reusable snippets to craft dynamic JSON bodies.
- MCP bridge: Map your mock endpoints to MCP servers and tools with per-tool JSON schemas, then expose them under
/mcp/:slugwith automatic request validation and logging. - Code generator CLI: Stream OpenAI-powered scaffolds from natural-language prompts (
npm run generate -- "prompt"). - Secure persistence: SQLite by default (or Postgres via
DATABASE_URL), Prisma migrations, and NextAuth credential login gated byADMIN_KEY. - Operational middleware: Helmet, compression, morgan logging, and a simple
/api/healthendpoint for liveness probes.
- Node.js 18 or later
- npm 9 or later
- Install dependencies:
npm install
- Copy the sample environment and adjust values (especially
ADMIN_KEY,NEXTAUTH_SECRET, andOPENAI_API_KEYif you plan to use the generator):The defaults target SQLite viacp .env.example .env
DATABASE_URL="file:./prisma/dev.db". Point this to Postgres for production parity. - Create or update the database schema with Prisma (uses
DATABASE_URL):npm run db:migrate
Start the Next.js app (includes the admin UI and mock API routes):
npm run devThen open http://localhost:3000/login and sign in with the default admin credentials (admin@example.com / password). From here you can create projects, endpoints, and MCP mappings.
For a production-style start that serves the compiled app, run:
npm run build
npm run start- In the dashboard, create an MCP server and add tools that point at your mock endpoints.
- Send JSON-RPC 2.0 requests to
POST http://localhost:3000/mcp/<slug>; the base/mcpproxies to the default slug. - Health check:
GET http://localhost:3000/mcp/<slug>returns a basic status payload.
Use the CLI to scaffold snippets from natural-language prompts (requires OPENAI_API_KEY):
npm run generate -- "Write a function that parses a CSV string into objects"The command streams responses to stdout so you can copy/paste the generated code.
API-MCPGenTool/
├─ server.js # HTTP server wrapper for the Express app
├─ index.js # Entry point for the mock API web server
├─ mcp-express.js # Express router implementing the MCP JSON-RPC bridge
├─ src/index.js # CLI code generator using OpenAI's Responses API
├─ gui-mock-api/ # Admin dashboard routes, views, and SQLite helpers
├─ public/ # Static assets served by the GUI (if applicable)
├─ package.json # Root package scripts & dependencies
└─ README.md
- Local development: Uses SQLite by default. Copy
.env.exampleto.env, keepDATABASE_URL="file:./prisma/dev.db", and runnpm run db:migrateto create the schema plus generate the Prisma Client locally. You can also pointDATABASE_URLat a local Postgres instance if you prefer. - Production: Provision a managed Postgres database (Neon, Supabase, Render, Railway, etc.), set
DATABASE_URLto the provided connection string, and runnpm run db:migrate:deployso the schema stays up to date.
- Use the default SQLite URL (
DATABASE_URL="file:./prisma/dev.db") for a zero-dependency dev setup, or pointDATABASE_URLat a local Postgres instance. - After changing the connection string, rerun
npm run db:migrate(ornpm run db:generate) so Prisma refreshes the client for that database.
- Render (and similar hosts) require a PostgreSQL
DATABASE_URL(SQLite files aren't persisted in those environments). - Build Command:
npm install && \ ./node_modules/.bin/prisma generate && \ ./node_modules/.bin/prisma migrate deploy && \ npm run build
- Start Command:
npm start
- Import the GitHub repository into Vercel and select the default project settings.
- Configure environment variables in the Vercel dashboard:
DATABASE_URL(SQLite for local dev or Postgres in production)NEXTAUTH_URL(your Vercel site URL)NEXTAUTH_SECRET(strong random value)GITHUB_ID,GITHUB_SECRET(optional GitHub OAuth)- Any other app secrets you use (
OPENAI_API_KEY,ADMIN_KEY,MCP_PUBLIC_URL, etc.).
- Build command:
npm run build(runsprisma generate && next build). - Start command:
npm run start. - Run database migrations for the first deploy using
npm run db:migrate:deployas a post-deploy or manual job against the productionDATABASE_URL. - Order of operations for the first launch: set environment variables → trigger a build → run migrations → open the app and sign in.
- Runtime: Use Node.js ≥ 18 (per
package.jsonengines). - Environment: Set the same variables as above (
DATABASE_URL,NEXTAUTH_URL,NEXTAUTH_SECRET, provider keys,OPENAI_API_KEY, etc.). - Build:
npm run build. - Start:
npm run start. - Migrations: On first deploy (or after schema changes), run
npm run db:migrate:deploywith the productionDATABASE_URLbefore starting the app.
- Database: Render's managed Postgres (or any external Postgres) must be wired in through the
DATABASE_URLenvironment variable. SQLite files are not supported in the Render runtime filesystem, so always supply a Postgres URL when deploying there. - Build command (Render dashboard → Build Command):
The
npm install && npm run render:buildrender:buildscript chainsdb:generate,db:migrate:deploy, andbuildso Prisma runs insidenpm run's environment (which automatically exposes./node_modules/.bin). This avoids relying onnpx, which some managed builders omit from the PATH even whennpmis available. It also guarantees new tables (such as the RouteDataset mock-response data store) are migrated before the service boots. - Start command (Render dashboard → Start Command):
npm start
- Required environment variables (Render dashboard → Environment):
DATABASE_URL– Postgres connection string (required for boot & migrations).NEXTAUTH_SECRET– strong random secret for NextAuth.NEXTAUTH_URL– public HTTPS URL of your Render service.ADMIN_DEFAULT_ENABLED=false– recommended so production admins must be created manually via the CLI/DB and the default seeded admin stays disabled.- Any other provider keys you need (e.g.,
OPENAI_API_KEY, OAuth keys, etc.).
- Migrations at deploy time: Because Render containers are immutable once built, make sure
npm run db:migrate:deployruns beforenpm start. The build command sequence above handles the Prisma client generation and migrations so no runtime path ever falls back toprisma migrate dev.
- Endpoint:
GET /api/health - Response:
{ "status": "ok", "database": "ok" | "unavailable" } - Use this for uptime checks on Render, Railway, or other orchestrators.
- Run
node scripts/dev-checks/mock-route-regression.mjsafter settingDATABASE_URL(and optionallyMOCK_BASE_URLwhen the Next.js server is running) to quickly verify mock routes can store GET responses and POST request samples end-to-end.
- Copy
.env.exampleto.envand fill in values. - Local dev: ensure
DATABASE_URL=file:./prisma/dev.db(or point to a local Postgres instance). - Run
npm run db:migrate. - Run
npm run dev. - Production:
- Provision Postgres and set
DATABASE_URL. - Set
NEXTAUTH_URL,NEXTAUTH_SECRET, and any provider keys (e.g., GitHub OAuth). - Run
npm run db:migrate:deploy. - Run
npm run buildandnpm run start.
- Provision Postgres and set
Screenshots of the admin dashboard and MCP configuration UI can be added here when available.
- Fork the repository and create a feature branch.
- Run
npm installto install dependencies. - Add or update tests where appropriate.
- Use clear commit messages and open a pull request describing your changes.
- Add automated tests for endpoint templating and MCP mappings.
- Publish Docker assets for easier deployment.
- Expand CLI prompts and scaffolds for common API patterns.
- Provide sample MCP clients and SDK snippets.
- Attach example screenshots and walkthroughs to the documentation.