Claim-level provenance preflight for sanitized nonfiction passages; automated triage only.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent — or use 1-click editor setup below.
One-click editor setup isn’t available for this listing yet — we don’t have a confirmed install command, and we’d rather show nothing than point your editor at the wrong package or host. Follow the project’s own setup instructions, linked above.
The Maha Strategies platform: one Next.js application serving the public site and publishing surfaces, the credentialed commercial APIs, and the private operations control planes behind them. It is deployed on Vercel at www.mahastrategies.com.
Most of what follows in this file is operating instructions for a specific subsystem — read the section you need rather than the whole document.
| Concern | Service |
|---|---|
| Application and hosting | Next.js (App Router), React, TypeScript, on Vercel |
| Database | Supabase Postgres, RLS with no public access policies |
| Cache, rate limits, balances | Upstash Redis, namespaced per deployment environment |
| GPU compute | Modal — workers/maha_workers.py |
| Payments | Stripe — a separate endpoint and signing secret per product line |
| Resend | |
| Telemetry | Sentry, payload-scrubbed |
Requires Node 22 or newer.
The app serves on http://localhost:3000. Copy
.env.example to .env.local and fill in what the surface you are working on
needs; most features degrade to a disabled state rather than crashing when their
variables are absent.
To exercise the database locally, start Supabase (supabase start) and apply
supabase/migrations plus supabase/seed.sql, which provides deterministic
fixtures.
npm test runs the full suite in test/. The same commands run in CI on every
pull request, together with a production build, a production-dependency audit,
and the migration integrity check below.
Three rules are enforced rather than assumed, because violating them corrupts state that cannot be reconstructed:
Migrations are append-only. Never edit, rename, or delete a migration
that has been committed — it may already have run in Production. Add a new
forward migration. Filenames are <14-digit UTC timestamp>_<snake_case>.sql
and must sort after everything already on main. Verify with:
Ledgers are append-only. Corrections are new rows and refunds are reversal entries; nothing edits or deletes a recorded commercial outcome. Operator interventions go through the audited, idempotent actions in the MPS operational control plane, not through direct table writes.
Secrets stay server-side. Only NEXT_PUBLIC_* variables reach the
browser. Credential secrets are disclosed exactly once at issuance and stored
only as hashes.
Framework note: this repository tracks a Next.js version whose APIs may differ
from older documentation. See AGENTS.md.
| Runbook | Covers |
|---|---|
docs/agent-discovery-metering.md | Measuring whether agents are finding the platform, and reading the numbers honestly |
docs/backup-restore.md | Rehearsing a database restore, and measuring RTO and RPO |
docs/database-migrations.md | Applying schema changes to Production, drift detection, evidence |
docs/observability.md | Sentry configuration, signed alert verification, readiness checks |
docs/release-recovery.md | Release health, recovery drill, rollback, rehearsal, required GitHub environments |
docs/preview-e2e.md | Integration gates on every Preview deployment, and making them block merges |
docs/slo-capacity.md | Service objectives, error budgets, the bounded capacity harness |
docs/x402-conformance-corpus.md | Vendor-neutral x402 v2 fixtures and the offline reference runner |
docs/x402-declaration-digest-proposal.md | Draft catalog-attested discovery declaration digest and test vectors |
docs/x402-doctor.md | Live resource, crawler, Bazaar drift, and bounded-settlement diagnostics |
docs/x402-observatory.md | Public protocol-correctness observations, inclusion policy, and scheduled operation |
docs/x402-buyer-policy.md | Vendor-neutral pre-signing budgets, approvals, replay controls, and settlement verification |
SECURITY.md | Vulnerability reporting and the platform's standing security assumptions |
The private Market Scout is a read-only discovery process. It pulls attributable web-search evidence into /admin/market-mapping, where every proposal remains subject to a deterministic score and human review. It cannot publish, spend, deploy, or contact a person.
With MARKET_SCOUT_SOURCES=exa and EXA_API_KEY set, the default matrix rotates five queries per UTC day across MPS claim verification, research briefs, document-data extraction, and receipt operations. Each query retrieves at most eight Exa results.
To replace the defaults, set this server-only JSON environment variable:
The matrix permits up to eight named lanes and twelve queries per lane; the Scout still selects only five cross-lane queries per daily run. The older MARKET_SCOUT_QUERIES JSON-string-array setting remains supported as a single custom lane for backward compatibility.
POST /api/agent-inquiries is an authenticated, non-binding intake endpoint for the offers published in /agent-offers.json. It validates against /agent-inquiry-schema.json, persists the inquiry and its first event to a private Supabase ledger, then attempts to notify the reviewer through Resend. It does not accept payment, create a commission, or send work automatically.
The inquiry gateway accepts named, database-backed client credentials. Credential issuance and revocation are private reviewer operations; there is no shared public inquiry token.
Set these deployment environment variables before enabling it:
Optional delivery overrides are AGENT_INQUIRY_FROM and AGENT_INQUIRY_TO. Keep the reviewer token server-side. Client credentials are created by the private registry and are shown only once at issuance.
Approved clients send JSON using the schema at /agent-inquiry-schema.json:
A successful 202 response means only that the request was recorded for human review. The returned notificationStatus shows whether the optional email notification was delivered. Neither result is an acceptance, purchase confirmation, or service-level commitment.
Apply supabase/migrations/20260716_agent_inquiry_ledger.sql, supabase/migrations/20260716_agent_client_credentials.sql, supabase/migrations/20260716_mps_audit_jobs.sql, and supabase/migrations/20260717_serverless_credential_rate_limits.sql in the Supabase SQL Editor before enabling the full agent infrastructure. Together, they create the private inquiry ledger, credential registry, MPS audit ledger, database-maintained event histories, and an atomic shared credential rate limiter with RLS and no public access policies. The existing NEXT_PUBLIC_SUPABASE_URL and SUPABASE_SERVICE_ROLE_KEY deployment variables are required.
Selected credential-based commercial APIs also write to commercial_api_usage_daily through 20260727000100_privacy_preserving_commercial_api_metering.sql. This is a daily aggregate meter for MPS audits, MPS credit reads, book-entitlement checks, and structured book-content delivery. It deliberately excludes IP addresses, user agents, token values or fingerprints, request and response bodies, referrers, emails, and visitor identifiers. The read-only aggregate board is /admin/commercial-api-metering and requires REVENUE_CONTROL_TOKEN.
Reviewer operations use a separate private endpoint:
Both require Authorization: Bearer <AGENT_REVIEW_TOKEN>. GET returns the full private request and its event history. PATCH accepts one action: start_review, needs_clarification, decline, or approve_for_scoping; the last is an internal disposition, not an acceptance of work.
Private reviewer operations are available at:
Factual signals from GitHub, npm, and our automated checks — not a rating.
No reviews yet — be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/mps-preflight)<a href="https://allmcps.com/mcp/mps-preflight"><img src="https://allmcps.com/api/badge/mps-preflight?style=directory" alt="Mps Preflight on AllMCPs" /></a>