A standalone, GitHub-compatible git forge in a single Node.js process.
Built as an entry for the make.fun bounty github-core-clone-01: it
speaks the same protocols real GitHub clients speak — git smart HTTP,
REST v3, GraphQL v4, and MCP — backed by one in-memory store, with no
git binary, no network access at runtime, and no dependencies beyond
the Node.js standard library.
- Git smart HTTP (
git.ts):upload-packprotocol v2 andreceive-packv0 with report-status, side-band-64k, and delete-refs; fast-forward pushes only. Realgit clone,fetch, andpushagainst the forge work. - REST v3 (
rest.ts):/api/v3for repositories, issues, pull requests, contents, and labels, with the wire contract's exact status codes. Every REST reply carriesX-GitHub-Request-Id.MAKEFUN_SHOP_TOKEN(Bearer) guards the API surfaces; a missing token is a 401, another owner's repo is a 404. - GraphQL v4 (
graphql.ts):/api/graphql, including introspection forIssue,PullRequest,Repository, andSearchType, and the documents theghCLI and github-mcp-server send. - MCP (
mcp.ts):/mcp, JSON-RPC 2.0 over streamable HTTP, with tools includingcreate_repo,get_repo,create_issue,list_issues,create_pull_request, andmerge_pull_request, sharing the same store as REST.
One process, one store, stdlib only:
| File | Owns |
|---|---|
main.ts |
The harness lifecycle only: bind, register, wait for done, exit. |
app.ts |
createApp(): builds the HTTP server and routes — /healthz boot probe, git smart HTTP, MCP, GraphQL v4, REST v3. |
store.ts |
The in-memory store: repos, refs, objects, issues, pull requests. The single source of truth every surface reads and writes. |
git.ts |
Smart-HTTP handlers and packfile encoding/decoding. |
rest.ts |
REST v3 handlers and the wire contract (status codes, request ids, auth). |
graphql.ts |
GraphQL v4 schema, resolvers, and introspection. |
mcp.ts |
MCP tools over JSON-RPC 2.0 streamable HTTP. |
Object pack bytes are cached per object id: objects are immutable and content-addressed, so a pack built once is reused. Fetch excludes the haves' full object closure (shared trees/blobs) from the pack.
The make.fun harness drives the process through a small lifecycle
(see main.ts):
- Bind an ephemeral port on 127.0.0.1. Port 0 lets the kernel choose one; the forge never binds 8080, where the suite listens.
POST {"port": <port>}to$MAKEFUN_ENV_URL/register.- Serve the forge while the suite runs its checks.
- Long-poll
GET $MAKEFUN_ENV_URL/doneuntil the body is{"done": true}, then close the server and exit 0.
If the program exits, crashes, or never registers before the boot budget ends, the trial leaves no working forge and scores 0.
main.ts treats the harness as flaky by design: every call to
$MAKEFUN_ENV_URL has a 30-second budget, and a failed register or
done probe is retried with a pause that doubles from 250 ms up to
2 s. The forge only exits once the done poll answers with
{"done": true} (or a plain 2xx), so a slow or restarted harness
cannot strand a healthy forge. Without MAKEFUN_ENV_URL the
process exits 1 at once.
Requires Node.js >= 22.18. No install step — there are no dependencies.
npm start
# or: node --experimental-strip-types main.tsMAKEFUN_ENV_URL must be set by the harness; without it the process
exits 1 at once. The forge writes only under /tmp at runtime and
serves only its own store.
The kit's local grader (grade-local --driver process --instances 1,
run from the kit) exercises the full suite against the forge. The
Phase 1 local run scored 981/1000 (600 feature + 200 agent-native
MCP + ~181 performance) with 120/120 feature checks passing,
including interop with real git.
- Feature checks: 600
- Agent-native (MCP): 200
- Performance: 200 — 200 pushes of 1 KiB, 50 concurrent shallow clones of a 200-commit repo, 2,000 issue reads, 200 issue writes.
- The final runs every entry on scored instance 1; the top 60 run all three instances. A prize requires beating the house reference forge strictly — a tie does not beat it.
MIT. See LICENSE.