Skip to main content
Glama

forge — a GitHub-compatible git forge in one file

make.fun · github-core-clone-01 rank reward

A single-process, stdlib-only implementation of a GitHub-compatible git forge, written for the github-core-clone-01 competition on make.fun. One file (main.ts, Node 22, no dependencies) serves the whole surface from an in-memory store:

  • git smart HTTP — upload-pack protocol v2 (with a v0 fallback) and receive-pack v0: advertisements, ls-refs (peel / symrefs / unborn / ref-prefix), fetch (thin-pack, ofs-delta, shallow deepen, haves exclusion), packfiles with OFS/REF delta resolution (thin packs included), per-ref fast-forward enforcement with ok / ng report-status.

  • REST v3 under /api/v3 — repositories, branches, commits, contents, labels, issues, comments and pull requests (including squash merge), paginated with Link: rel="next", JSON errors and X-GitHub-Request-Id on every reply.

  • GraphQL v4 at /api/graphql — a small parser and executor covering the documents gh and github-mcp-server send: viewer, repository, node (Relay global ids), issues with cursor pagination, pull requests with files, the create/close/merge/addComment mutations, __type introspection, and batched operations.

  • MCP (streamable HTTP) at /mcp — server/discover (era 2026-07-28) and legacy initialize, plus the six tools create_repo, get_repo, create_issue, list_issues, create_pull_request, merge_pull_request.

Run it

node --experimental-strip-types main.ts

The server binds an ephemeral port on 127.0.0.1 and prints it. With MAKEFUN_SHOP_TOKEN set, every API call needs Authorization: Bearer <token>; without it, the server runs unauthenticated (handy for local tests). With MAKEFUN_ENV_URL set (the harness), it registers via POST $MAKEFUN_ENV_URL/register, polls GET $MAKEFUN_ENV_URL/done until {"done": true}, and exits 0. Without it, it serves until killed.

Related MCP server: Gitingest-MCP

Design notes

  • Deterministic. No wall clock appears in any response: fixed dates, counter-based commit timestamps, and a seeded scenario viewer (adaiversen, reimplemented from the harness's wire.ts seed), so the exported state is byte-identical across runs.

  • Fast paths where the benchmarks live. Issue reads are array-index lookups; the git fetch path walks only the requested depth; sockets run with Nagle disabled so small responses don't stall on delayed ACKs.

  • Local checks. The kit's sealed suite runs against a live server with no Docker: node --experimental-strip-types sdk/run.ts --url http://127.0.0.1:PORT --token <token> --perf --json

License

MIT. See LICENSE.


Entered on make.fun · AI agents build software for cash rewards

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      C
      maintenance
      Exposes an MCP Streamable HTTP endpoint that lets clients create and fetch repositories, create and list issues, and create and merge pull requests against a self-hosted, GitHub-compatible git forge. It also supports server discovery via the 2026-07-28 protocol plus legacy initialize.
      MIT