Skip to main content
Glama
github-core-clone

github-core-clone

github-core-clone

A deterministic, stdlib-only GitHub core clone: git smart HTTP, REST v3, GraphQL, and MCP in a single Node.js process. Built for the make.fun bounty github-core-clone-01.

github-core-clone-01 rank reward

What it does

  • Git smart HTTP (/{owner}/{repo}.git): upload-pack protocol v2 (ls-refs, fetch, shallow/deepen) and v0, receive-pack v0 with fast-forward-only pushes. Packfile parsing/packing, pkt-line framing, and the object store (loose objects + packfiles, zlib, SHA-1) are all implemented by hand — no git binary, no npm dependencies.

  • REST v3 (/api/v3): repositories, branches, commits, refs, contents, labels, issues, comments, pull requests, and squash merges, with GitHub-shaped pagination (Link: rel="next").

  • GraphQL (POST /api/graphql): viewer, repository, issue/PR connections with cursor pagination, __type introspection, and the createIssue / closeIssue / createPullRequest / mergePullRequest / addComment mutations.

  • MCP (POST /mcp): JSON-RPC 2.0 Streamable HTTP, revision 2026-07-28 (server/discover) and the legacy initialize handshake, with seven tools (create_repo, get_repo, create_issue, list_issues, get_issue, create_pull_request, merge_pull_request) acting on the same in-memory store as REST.

Related MCP server: tinyforge

Determinism

One process, one in-memory store. Dates come from MAKEFUN_TRIAL_NOW (never the wall clock) and ids from counters seeded at startup — no Math.random(), no random UUIDs — so a trial replays byte-identically.

Run it

node --experimental-strip-types main.ts

Requires Node >= 22.18. MAKEFUN_SHOP_TOKEN sets the Bearer token the REST, GraphQL, and MCP surfaces accept; MAKEFUN_TRIAL_NOW sets the logical clock. With MAKEFUN_ENV_URL set, the process registers its port with the harness and exits when the harness reports done.

Layout

  • main.ts — entry point: lifecycle (bind, register, poll done, exit).

  • app.ts — HTTP server, routing, auth, body parsing.

  • src/git.ts — git object model, pkt-lines, packfiles, graph walks.

  • src/git-http.ts — git smart-HTTP handlers.

  • src/store.ts — in-memory store: repos, issues, PRs, contents, merges.

  • src/rest.ts — REST v3 handlers.

  • src/graphql.ts — GraphQL parser + executor.

  • src/mcp.ts — MCP JSON-RPC handlers and tools.

  • src/util.ts — HTTP helpers, base64url ids, line diff.

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
      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
    • A
      license
      Not graded
      quality
      B
      maintenance
      Exposes GitHub-compatible operations over MCP, letting agents create and inspect repositories, issues, pull requests, and file contents against a shared in-memory forge store that stays consistent with the same server's REST, GraphQL, and git smart HTTP surfaces.
      MIT