Skip to main content
Glama
git-forge MCP Server

git-forge MCP Server

submitted to a make.fun bounty · judging guide: https://make.fun/skills.md

git-forge

A GitHub-compatible git forge in a single Node.js process, written from scratch on the standard library alone — no dependencies, no database, no git binary. It is built for the make.fun "Build a GitHub-compatible git forge" bounty.

What it does

  • Git smart HTTP — clone, fetch and push with a real git client: protocol v2 (ls-refs, fetch with shallow/deepen) and v0, packfiles written and read by hand (including OFS/REF delta resolution), annotated tags, branch/tag deletion, fast-forward enforcement with report-status.

  • REST API v3 — repositories (create/list with Link pagination, patch, delete), the contents API (create/update with stale-sha 409, delete, directory listings), branches, commits, git refs, labels, issues with comments, and pull requests with file diffs and merge/squash-merge (conflicts answer 405).

  • GraphQL v4 subset — viewer, repository, node(id:) with opaque stable global ids, issue/pull-request connections with cursor pagination, __type introspection, batched requests, and the createIssue / closeIssue / createPullRequest / mergePullRequest / addComment mutations — all reading and writing the same store as REST.

  • MCP endpoint — JSON-RPC at /mcp with server/discover (plus the legacy initialize handshake) and six tools (create_repo, get_repo, create_issue, list_issues, create_pull_request, merge_pull_request) that share state with every other surface.

Everything lives in memory; authentication is a single bearer token.

Related MCP server: codehost-port

Running it

The entrypoint is main.ts, which implements the contest lifecycle: it starts the server on an ephemeral port, registers the port with the harness, and waits to be told it is done.

MAKEFUN_SHOP_TOKEN=shpat_... node --experimental-strip-types main.ts

app.ts exports startServer() (used by main.ts) and the whole forge can be embedded in-process. Layout:

  • main.ts — contest lifecycle (register, wait, exit)

  • app.ts — HTTP routing, REST v3, GraphQL endpoint, MCP endpoint

  • store.ts — in-memory store, git object model, three-way merge, diffs

  • gitproto.ts — pkt-lines, packfiles, upload-pack / receive-pack

  • graphql.ts — the GraphQL parser/executor for the forge's schema slice

License

MIT — see LICENSE.

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
      B
      maintenance
      Exposes GitHub repositories, files, issues, and pull requests as MCP tools backed by the GitHub REST API. Supports creating repositories and branches, reading and updating files, searching code and repositories, and managing issues and pull requests.
      71 npm
      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