Skip to main content
Glama
Forge 120
by Avapage

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

Forge 120

A small, self-contained GitHub-core forge in a single Node.js process. It speaks the four surfaces agents already use — git smart HTTP (protocol v2 and v0), the REST v3 API subset, GraphQL v4, and an MCP server — over one in-memory store, with no dependencies, no database and no git binary at runtime: the object model, packfiles, pkt-line framing and the three-way merge are all implemented in the entry itself.

The whole server is one authored TypeScript source, src/forge.ts; main.ts is a thin bootstrap that imports and starts it. Node 22's standard library is the only runtime requirement.

Status

Rebuilt from scratch for round 2 of github-core-clone-01. The design notes and run instructions below were written alongside the implementation.

Related MCP server: github-core-clone

Architecture

Everything lives in src/forge.ts, in layers:

  • Store — repositories are in-memory maps of git objects (commits, trees, blobs, annotated tags) addressed by their SHA-1, plus refs, labels, issues, pull requests and comments. Ids and timestamps come from a logical clock, so replaying the same operations reproduces byte-identical state.

  • Git object model — objects are hashed, parsed and rebuilt in-process; packfiles are written plain (version 2, SHA-1 trailer) and read back with OFS/REF delta resolution, including thin packs whose bases the client holds.

  • Git smart HTTP — protocol v2 (ls-refs with server-side ref-prefix filtering, peeled tags and unborn HEAD; fetch with shallow/deepen, including deepen-relative and the two-round wait-for-done negotiation) and protocol v0 for fetch and receive-pack, with report-status inside side-band-64k when negotiated. Push validation covers stale refs, missing objects and non-fast-forward rejection with git's exact reason strings.

  • REST v3 subset — repos (create/list with Link pagination/get/patch/ delete), branches, commits, contents (create/update/delete with stale-sha 409), git refs, labels, issues with comments, and pull requests with file diffs and squash/merge merges (405 on conflict). Every reply is JSON with an X-GitHub-Request-Id header; errors are JSON with a message.

  • GraphQL — a hand-written lexer/parser and executor covering the viewer, repository/issue/pull-request fields, cursor-paginated issue connections, the create/close/merge mutations, node(id:) round-trips with opaque global ids, batched documents, and introspection for the types the API exposes. Unknown fields answer HTTP 200 with an error naming the field.

  • MCP — a JSON-RPC streamable-HTTP endpoint at /mcp speaking both the modern server/discover era and the legacy initialize handshake, with six tools (create/get repo, create/list issues, create/merge pull request) that share the same store and id space as REST.

Auth is a single bearer token (MAKEFUN_SHOP_TOKEN); the git endpoints are open, /healthz is unauthenticated, and every other surface answers 401 without the token.

How to run

With the make.fun env (the graded path), the entry binds an ephemeral port, registers it with $MAKEFUN_ENV_URL/register, serves until the env reports done, and exits 0:

node main.ts

Standalone, for local testing, it serves on FORGE_PORT (default 8080):

MAKEFUN_SHOP_TOKEN=any-token FORGE_PORT=8080 node main.ts

Verification

  • The kit's local conformance suite (120 checks across git, repos, issues, pulls, protocol, GraphQL and MCP) passes 120/120 against this entry.

  • Real-git interop is verified with the system git client: clone (full and --depth 1), push of branches and annotated tags, fetch, and repeated fetch --deepen 1 until the clone is unshallowed.

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 endpoint over JSON-RPC 2.0 with six tools, enabling agents to create and retrieve repositories, file and list issues, open pull requests, and merge them. It also supports discovery and initialization handshakes for client integration.
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables GitHub-compatible repository, issue, and pull request management over JSON-RPC 2.0 Streamable HTTP, including creating repositories, filing and listing issues, and creating or merging pull requests.
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Exposes a GitHub-compatible git forge over MCP JSON-RPC (Streamable HTTP), giving agents 27 tools to create and inspect repositories, branches, commits, contents, labels, issues, comments, pull requests and merges. All of it reads and writes the same in-memory store served by the REST v3 and GraphQL v4 endpoints, so ids and state stay consistent across surfaces.
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Exposes an MCP endpoint over JSON-RPC 2.0 with seven tools that let agents create and manage repositories, issues, pull requests, labels, and comments, all backed by a shared store so changes are visible across the git, REST v3, and GraphQL surfaces.
      MIT