Provides a unified TypeScript SDK for managing authentication, databases, storage, payments, and multimodal AI within a single declarative API.
Also known as corgelabs/corge, @corgelabs/corge
- Stars
- 0
- Tools
- —
- Downloads, 30 days
- 1,749
- Latest version
- —
- Last commit
- Nov 14, 2026
- License
- —
What is Corge MCP?
Corge provides a unified TypeScript SDK for managing authentication, databases, storage, payments, and multimodal AI within a single declarative API.
Summary generated from the project's README
About Corge MCP server
Developers building AI-driven SaaS applications can manage their entire backend stack through a single TypeScript SDK. Corge replaces the need for multiple separate libraries by providing a unified declarative API for authentication, databases, file storage, payments, and multimodal AI. It is designed specifically for agentic coding environments, allowing AI agents to master the entire backend infrastructure by reading a single specification file.
Users interact with the system using the corge singleton and its define methods to set up collections, routes, and workflows. The toolkit includes a built-in CLI for local development, testing, and deployment to GCP Cloud Functions. It handles complex backend requirements like multi-tenant RBAC, Stripe webhooks, and durable workflows with Saga rollback capabilities. By consolidating these services, it reduces context window bloat for AI assistants and simplifies the development of features like hybrid RAG and vision-based data extraction.
What you can do with it
- 1Automate invoice data extractionAn AI agent can create a workflow that uses vision capabilities to extract structured data from a PDF and save it to a database.
- 2Manage multi-tenant user permissionsA developer can define specific access controls for different user roles within a database collection.
- 3Deploy backend services to the cloudYou can bundle your code and merge all necessary rules and indexes before deploying to Google Cloud.
- 4Implement reliable multi-step processesDevelopers can wrap complex mutations in steps that include automatic rollback logic if a failure occurs.
Written from the project's README. Every use case is checked against a quote from it.
How to install Corge MCP
Formats verified 10 Nov 2026Add to CursorAdd to GooseInstall Corge MCP in Claude Code
$ claude mcp add corge -- npx -y @corgelabs/corgeInstall Corge MCP in Cursor
~/.cursor/mcp.json
{
"mcpServers": {
"corge": {
"command": "npx",
"args": [
"-y",
"@corgelabs/corge"
]
}
}
}Install Corge MCP in VS Code
.vscode/mcp.json
{
"servers": {
"corge": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@corgelabs/corge"
]
}
}
}Install Corge MCP in VS Code CLI
$ code --add-mcp '{"name":"corge","type":"stdio","command":"npx","args":["-y","@corgelabs/corge"]}'Install Corge MCP in Claude Desktop
claude_desktop_config.json
{
"mcpServers": {
"corge": {
"command": "npx",
"args": [
"-y",
"@corgelabs/corge"
]
}
}
}Install Corge MCP in Codex
$ codex mcp add corge -- npx -y @corgelabs/corgeInstall Corge MCP in Codex config.toml
~/.codex/config.toml
[mcp_servers.corge] command = "npx" args = ["-y", "@corgelabs/corge"]
Install Corge MCP in Gemini CLI
$ gemini mcp add -s user corge npx -- -y @corgelabs/corgeInstall Corge MCP in Gemini settings.json
~/.gemini/settings.json
{
"mcpServers": {
"corge": {
"command": "npx",
"args": [
"-y",
"@corgelabs/corge"
]
}
}
}Automated checks
Ran Nov 14, 2026Full report →Passed our automated checks. That is not a security audit: read the code and give the server the narrowest access it needs. How checks work · What to fix for more points
- Source repository linked and reachablecorgelabs/corge is public and reachablegithub.com/corgelabs/corge ↗Pass
- Package names this repository as its source@corgelabs/corge names corgelabs/corge as sourcenpmjs.com/package/@corgelabs/corge ↗Pass
- Build provenance (Sigstore attestation)Sigstore attestation for @corgelabs/corgenpmjs.com/package/@corgelabs/corge/v/2.0.0#provenance ↗Pass
- Open source license (OSI)No licenseFinding
- Commit or release in the last yearLast commit or release 2026-11-12github.com/corgelabs/corge ↗Pass
- OpenSSF ScorecardNot checked
- Package name not close to a popular packageNo popular package one edit away from @corgelabs/corgePass
- No critical advisory in the package or its dependenciesNot checked
- No hidden instructions to the model0 tool descriptions and the README read; no override phrases, credential paths or hidden charactersPass
- Destructive tools are labelledNot checked
- Remote endpoint answers the MCP handshakeNot checked
README
View on GitHubThe All-in-One AI & SaaS Backend Built for Agentic Coding.
Stop stitching 10 SDKs together. Auth, DB, Storage, Payments, Emails, Multimodal AI, Hybrid RAG, and Durable Workflows—all in one corge singleton your AI agent masters in one read.
Why Corge? · Agentic Setup · 30s Quickstart · CLI · Specification
🔥 1 Package Replaces 10
AI coding agents hallucinate when juggling 10 different SDKs and 10,000 lines of glue code. Corge collapses the entire SaaS & AI stack into one declarative API (corge.define.*):
- Zero Context-Window Bloat: Only
1runtime dependency inpackage.jsonand1self-contained spec (node_modules/@corgelabs/corge/docs/SPEC.md). - Production-Hardened Out of the Box: Multi-tenant RBAC, content-addressed storage, Stripe/Dodo webhooks, SendGrid/Resend bounce suppression, and adaptive
200/202durable workflows with Saga rollback. <1sTypecheck +F12Into Raw Source: Ships pre-compiled.d.tssourcemaps wired straight tosrc/**/*.tsplus a zero-configcorge deployCLI.
| What You Need | The Old Way (10+ SDKs & Glue) | With @corgelabs/corge |
|---|---|---|
| API & Guards | Hono/Express + custom auth, CORS, rate limits | corge.createApp() + corge.define.routes() |
| Durable Workflows | Temporal / Inngest / BullMQ + Redis workers | mode: 'workflow' + step() with Saga rollback |
| AI, RAG & MCP | Vercel AI + OCR + vector DB + custom MCP | corge.ai, corge.chat, corge.attachments + mcp: true |
| Database & RBAC | Raw Firestore + manual converters & ACLs | corge.db + corge.define.collections() |
| File Storage | Raw GCS + manual MIME & ownership checks | corge.files ({userId}_{sha256} $O(1)$ ACLs + magic bytes) |
| Auth & OIDC | Custom JWTs, Google/Apple OAuth, revocation | corge.auth (Cookies, OIDC, 3s revocation watermark) |
| Payments & Quotas | Stripe / Dodo SDKs + webhooks + token meters | corge.payments (Plans, Webhooks, AI Token Quotas) |
| Emails | SendGrid / Resend + bounce suppression tables | corge.emails (Zod templates, attachments, auto-suppression) |
| Dev & Cloud Deploy | Custom bundlers, Secret Manager & CI scripts | npx corge dev · corge deploy · corge test |
🤖 Agentic Setup (5 Seconds)
Drop this into your repo's AGENTS.md, CLAUDE.md, or .gemini/GEMINI.md so Codex, Claude Code, Antigravity, or other harness one-shots production features on the first prompt:
## Backend Rules (@corgelabs/corge)
- Read `node_modules/@corgelabs/corge/docs/SPEC.md` before writing backend code.
- Use `corge` and `useCorge` from `@corgelabs/corge` for all routes, DB, AI, auth, files, payments, and emails.
- Keep `src/` 100% declarative (`corge.define.*`) and wrap multi-step mutations in `step()` with `rollback`.
🚀 30-Second Quickstart
npm i @corgelabs/corge && npx corge init
// src/index.ts
import { corge } from '@corgelabs/corge'
import { z } from 'zod'
const collections = corge.define.collections({
invoice: corge.define.collection({
schema: z.strictObject({
id: corge.schemas.entryId,
userId: corge.schemas.entryId,
vendor: z.string(),
totalCents: z.number().int().nonnegative()
}),
rbac: { user: ['create', 'read', 'list'], admin: ['create', 'read', 'update', 'delete', 'list'] }
})
})
const routes = corge.define.routes({
'extract-invoice': corge.define.route({
mode: 'workflow',
method: 'POST',
path: '/invoices/extract',
description: 'Extracts structured invoice fields from a PDF and saves a ledger entry',
mcp: true,
input: z.strictObject({ fileRef: corge.schemas.fileRef }),
handler: async ({ input, step }) => {
const extracted = await step('vision-extract', () =>
corge.ai.vision({
fileRef: input.fileRef,
prompt: 'Extract vendor name and total amount in cents.',
schema: z.object({ vendor: z.string(), totalCents: z.number().int() })
})
)
return step('save-invoice', {
fn: () => corge.db.create('invoice', { userId: corge.userId, ...extracted.output }),
rollback: (inv) => corge.db.delete('invoice', inv.id)
})
}
})
})
export const { app, devApp, functions } = corge.createApp({ collections, routes })
npx corge dev # Hot-reload local server + automatic GCP Secret Manager injection
npx corge check # <1s strict TypeScript check
npx corge deploy prod # Bundle + merge rules/indexes + deploy to GCP Cloud Functions v2
🛠️ Built-In corge CLI
| Command | Description |
|---|---|
npx corge init |
Scaffolds a clean project (tsconfig.json, src/index.ts, src/config/, src/routes/, src/services/). |
npx corge dev |
Loads .env + GCP Secret Manager secrets and starts a hot-reloading Hono server on PORT (8080). |
npx corge build |
Bundles src/index.ts + @corgelabs/corge into dist/index.cjs (node24, CJS, sourcemaps). |
npx corge deploy <prod|dev> |
Verifies branch guard (main/dev), builds, merges Firestore/Storage rules & indexes, and deploys. |
npx corge test |
Runs the E2E contract & integration test suite (node --test) with GCP Secret Manager injection. |
npx corge check |
Runs tsc --noEmit in <1s. |
npx corge link [path] |
Symlinks a local checkout of corgelabs/corge for live multi-repo editing (corge unlink restores npm). |
npx corge env -- <cmd> |
Runs any command with .env + GCP Secret Manager secrets injected into process.env. |
📄 License
MIT © Corge Labs
Corge MCP questions
How do I add Corge MCP to Claude Code?
Run claude mcp add corge -- npx -y @corgelabs/corge in your terminal. Add --scope user to make it available in every project.
How do I add Corge MCP to Cursor?
Open ~/.cursor/mcp.json and add the server under mcpServers, using the Cursor config shown in the install section above.
What does Corge replace?
It replaces the need for multiple separate SDKs by collapsing the entire SaaS and AI stack—including auth, DB, storage, and payments—into one API.
How do I set up Corge for an AI agent?
You can add specific backend rules to your repository's AGENTS.md or CLAUDE.md files, instructing the agent to read the specification file before writing code.
Can I deploy Corge to the cloud?
Yes, the Corge CLI includes a deploy command that bundles your code and deploys it to GCP Cloud Functions v2.
Does it support durable workflows?
Yes, it supports durable workflows with Saga rollback capabilities using a step-based approach.