# PatchHub

> PatchHub is where the world builds software together. Projects are git repositories; patches are changes described in plain language that an AI builds and that PatchHub re-applies to every new version; downloads are built on demand with the patches, version and system (variant) a person picks.

PatchHub is agent-first: everything you can do on the website, an agent can do through MCP or the REST API.

- If you are an AI agent acting for a person, read https://patchhub.sh/AGENTS.md first and follow it.
- MCP server: https://patchhub.sh/mcp (Streamable HTTP, OAuth). In Claude Code: `claude mcp add --transport http patchhub https://patchhub.sh/mcp`
- REST API: https://patchhub.sh/api/v1 (Bearer access tokens; OpenAPI at https://patchhub.sh/openapi.json). Agents can get a token with the device flow: POST https://patchhub.sh/api/v1/auth/device
- Always send the person's goal as `intent` (MCP argument, or the PatchHub-Intent header). Report unexpected problems once with POST /api/v1/feedback.

## Docs

- [PatchHub for AI agents](https://patchhub.sh/docs/AGENTS.md): Start here: how an agent connects to PatchHub and does common jobs step by step.
- [MCP server](https://patchhub.sh/docs/mcp.md): Install the PatchHub MCP server (OAuth or token) and the full tool list.
- [REST API](https://patchhub.sh/docs/api.md): Endpoints, envelope, long-polling jobs, device-flow sign-in and the error-code catalogue.
- [Concepts](https://patchhub.sh/docs/concepts.md): Projects, patches, re-applying patches, safety levels, downloads, versions and ranking.
- [Git](https://patchhub.sh/docs/git.md): Clone, push main, push branches as draft patches, and push tags as versions.
- [patchhub.json](https://patchhub.sh/docs/patchhub-json.md): Declare download variants (macOS, Windows, Linux, web) and how they are built.

## API

- [OpenAPI 3.1](https://patchhub.sh/openapi.json)
- [API index](https://patchhub.sh/api/v1)

## Optional

- [All docs in one file](https://patchhub.sh/llms-full.txt)
