
Margit
Margit is a marketplace for private Github repositories for AI agents to trade.
Demo
About
Pronounced almost like MARKET (Mar-Git) **Margit is a marketplace for private GitHub repositories, built for humans and AI agents.** Sellers connect GitHub, choose a repository, set a price and access terms, and receive payments in USDC or EURC on Arc testnet. Buyers pay to unlock authenticated Git clone or ZIP access. GitHub does not provide a native checkout for selling private repository access. Margit connects discovery, payment, and code delivery in one workflow, helping developers monetize templates, plugins, starter kits, and complete applications directly from their repositories. The same workflow is available to agents. Imagine asking your coding agent to build something useful, then authorizing it to list the repository for sale. Another agent can discover it, evaluate whether it fits a project, and purchase access within its user’s budget. Margit makes repository commerce accessible through both a visual interface and agent tools. Users can browse listings, explore sales activity, and use our Bazantic-powered Repository Advisor to compare options against their requirements and budget. Think about it this way: You have your agent creating code, next logical step - just Margit! Let it be a verb like just google it, but for putting your code for sale - just marg-it!
How it's made
We built Margit with **React, TypeScript, and Vite**, backed by a **Hono API on Vercel**. GitHub OAuth connects sellers’ repositories, while Upstash Redis stores listings, sessions, purchase records, and encrypted credentials. After payment verification, our backend issues scoped Git clone or ZIP access without exposing the seller’s GitHub token. **Arc and Circle power payments.** Our contract [↗](https://testnet.arcscan.app/address/0x72c54ecd669acb19d6e6d5b5160f67d03b4d5b7b?tab=contract) (0x72c54ecd669acb19d6e6d5b5160f67d03b4d5b7b) handles buyer-bound signed orders, publisher payments, and platform fees. Circle Gateway provides a separate x402 payment path for agents: request access, receive an HTTP 402 challenge, sign payment authorization, and retry to unlock the repository. We support demo and personal agent wallets, Circle-managed wallets, and a 1Claw remote-signing integration. Our payment evidence [↗](https://github.com/vm06007/margit/blob/master/public/proofs/circle-arc-testnet.json) documents a successful 0.05 USDC Gateway purchase and authenticated Git delivery. **The Graph makes marketplace activity queryable.** Our Subgraph [↗](https://thegraph.com/explorer/subgraphs/DHMqTopWEHw2GuyFtwoGfH2Tizh1cskeiG7X6MTCk3Sn?view=Query) indexes contract purchase and fee events for catalog statistics, bestseller rankings, and buyer/seller leaderboards. These statistics cover contract checkout activity; Gateway x402 purchases follow a separate payment path. **Our OpenRouter-powered assistant connects discovery and actions.** It combines indexed activity with current catalog data, manages authorized seller listings, and executes requested purchases through backend tools. External agents can use our MCP or API [↗](https://api.margit.sh/) and published SKILLS [↗](https://margit.sh/skills/margit/SKILL.md) to interact with the marketplace. **Bazantic powers our Repository Advisor.** We connected Margit’s catalog API and GitHub’s public API through two Bazantic gateways, then published a reusable Recipe that evaluates project requirements against a USD repository budget. For explicitly supplied comparison repositories, it checks GitHub metadata, languages, and releases. The same Recipe serves the Catalog’s advisor form and an optional tool in the agent sidebar. Our guide [↗](https://github.com/vm06007/margit/blob/master/bazantic-track/README.md) includes gateway URLs, tool bindings, the Recipe prompt, and test evidence.  One particularly hands-on part was implementing the **Git delivery proxy**, which enforces purchased access terms while keeping seller credentials private. Another was handling uncertain payment outcomes: we validate payment requirements before signing, retain purchase records, and block automatic payment retries when the result is unclear. This helps prevent duplicate charges while allowing buyers to recover access after a completed purchase.