Auto-Generated Secure CI/CD Pipelines with AI + MCP.
AutoDeploy is a full‑stack project that helps you analyze repositories, generate CI/CD workflows, and safely track and roll back deployments using an AI‑assisted MCP (Model Context Protocol) backend and a React wizard frontend.
- GitHub OAuth integration to securely link a GitHub account and fetch repository information.
- Repository analysis and CI/CD pipeline generation via MCP tools.
- Pipeline commit, history, and rollback for GitHub Actions workflow YAMLs.
- Deployment logging with retry/rollback support and workflow dispatch APIs.
- React + TypeScript wizard UI for configuring providers, templates, secrets, and deployments.
The backend lives under server/ and is an Express application (ESM) that exposes both REST and MCP‑style endpoints.
Key entry point:
server/server.js– bootstraps the Express app, middleware, and routes.
Important route groups include:
GET /health– basic health check (used by the smoke test).GET /db/ping– checks database connectivity viahealthCheck()inserver/db.js./auth/github/*– GitHub OAuth flow plus/auth/github/meinspection./auth/local/*,/auth/google/*– additional auth flows./api/me– session introspection (usesrequireSession)./users,/connections– basic user and connection CRUD backed by Postgres./deployments/*– deployment logs API, including retry, rollback, and workflow dispatch./agent/*– higher‑level "wizard" orchestration endpoints./mcp/v1/*– MCP tool façade (see below)./pipeline-sessions/*– multi‑step pipeline wizard backed by Supabase tables.
The backend expects a Postgres database (e.g., via a Supabase connection string) configured in server/db.js.
Internal MCP tools are registered in server/tools/index.js and exposed over HTTP through server/routes/mcp.js at /mcp/v1/:tool_name.
Notable tools:
repo,repo_reader→ repository discovery and branch listing.pipeline_generator→ synthesizes CI/CD workflow YAML.oidc,oidc_adapter→ handles AWS OIDC roles and related configuration.github,github_adapter→ GitHub automation (e.g., file upserts, workflow dispatch).gcp,gcp_adapter,scaffold,scaffold_generator→ GCP‑specific workflow scaffolding.
Each tool defines an input_schema (Zod) and a handler function. The mcp route:
- Injects
user_idandgithub_usernamefrom the current session. - Validates input using the tool’s schema.
- Normalizes responses to
{ success: true/false, data | error }.
The frontend lives under client/ and is a React + TypeScript app built with Vite and Tailwind.
Key elements:
- Pages and routes in
client/src/pagesandclient/src/routesimplement the connect/login flow, configuration wizard, secrets management, Jenkins page, dashboard, and 404. - Zustand stores in
client/src/store(e.g.,usePipelineStore,useWizardStore,useDeployStore,useAuthStore) hold wizard selections, auth/session info, pipeline generation results, and deployment data. client/src/lib/api.tswraps REST and MCP calls, handles GitHub OAuth redirects, caches AWS roles and repo lists, and orchestrates pipeline commit and rollback.- UI components under
client/src/componentsinclude shared primitives (ui/), layout and nav (common/), wizard steps (wizard/), and dashboard widgets (dashboard/).
In development, the frontend talks to the backend through a Vite dev server proxy:
BASE = import.meta.env.VITE_API_BASE || "/api"- In dev,
BASEis typically/api, which is proxied to the Express backend. SERVER_BASEis derived fromBASEfor direct/mcp/v1/*and/auth/*calls.
- Node.js and npm installed.
- A Postgres database (e.g., Supabase) for the backend.
- A GitHub OAuth app for GitHub integration.
From the repo root, install backend dependencies:
npm installThen install frontend dependencies:
cd client
npm installFrom the repo root:
# Start backend in watch mode (Express + Nodemon)
npm run dev
# Start backend in production mode
npm startBy default the server listens on PORT or 3000.
From the client/ directory:
cd client
npm run devThe Vite dev server defaults to port 5173.
For local development of the MCP integration without a real MCP core, you can use the mock server and standalone agent under server/src.
From the server/ directory:
# 1. Start the mock MCP core (expects Bearer dev-key-123)
cd server
node src/scripts/mockMcp.js
# 2. Run the MCP agent directly (uses MCP_URL and MCP_API_KEY)
node src/agents/mcpAgent.jsExample .env values for this flow (placed in server/.env or the repo root):
MCP_URL=http://localhost:7070
MCP_API_KEY=dev-key-123The backend uses dotenv and environment variables for configuration.
Key variables include (non‑exhaustive):
- MCP integration (
server/src/config/env.js)MCP_URL– URL of the MCP core (defaulthttp://localhost:7000).MCP_API_KEY– API key used inAuthorization: Bearerheaders.
- GitHub OAuth (
server/routes/auth.github.js)GITHUB_CLIENT_IDGITHUB_CLIENT_SECRETGITHUB_OAUTH_REDIRECT_URIGITHUB_OAUTH_SCOPESFRONTEND_URL– post‑login redirect (defaulthttp://localhost:5173/connect).JWT_SECRET– used to sign themcp_sessioncookie.
- Server
PORT– Express listen port (default3000).- Database connection settings (see
server/db.js), typically a Postgres connection string.
Authentication/session details:
- A JWT‑based session is stored in an
mcp_sessioncookie. server/lib/requireSession.jsreads this cookie and setsreq.userandreq.supabase.- Most MCP and deployment‑related routes require a valid session.
From the repo root, run the smoke test (requires the backend to be running locally):
npm testThis runs node test/smoke.test.js, which calls GET /health on the backend and fails if the response is not { ok: true }.
High‑level layout:
AutoDeploy/
├── client/ # React + TypeScript + Vite frontend
│ └── src/ # Pages, routes, components, stores, lib, styles, etc.
├── server/ # Express backend, MCP tools, auth, deployment logging
│ ├── server.js # Main Express entry point
│ ├── db.js # Postgres connection & health check
│ ├── routes/ # Auth, MCP, deployments, pipeline sessions, Jenkins, etc.
│ ├── lib/ # Session, GitHub helpers, pipelineVersions, Supabase helpers
│ ├── tools/ # MCP tools (repo_reader, pipeline_generator, oidc_adapter, ...)
│ └── src/ # MCP agent, config, mock MCP server, backend docs
├── test/
│ └── smoke.test.js # Simple /health smoke test
├── package.json # Root scripts (dev, start, test) and backend deps
└── client/package.json # Frontend scripts (dev, build, lint, preview)
This project is licensed under the ISC License (see package.json).