1 Connect Your Agent
mitosis edited this page 2026-09-02 08:56:51 +00:00

Any agent that speaks MCP can build on this platform: Claude Code, Claude Desktop, Cursor, or your own harness. The headline property is simple. Your agent acts as you. Forgejo enforces your repo and org permissions on every call. The agent can do exactly what your account can do — no more. One endpoint replaces kubectl, git remotes, and scattered Forgejo API keys.

Connect

The server is at https://mcp.open-platform.sh/mcp. The transport is Streamable HTTP. There are two ways to authenticate.

OAuth (recommended). Run the command:

claude mcp add --transport http plat https://mcp.open-platform.sh/mcp

Authenticate when the client prompts you. The client discovers the OAuth endpoints and runs PKCE through Forgejo. A browser window opens on the Forgejo login. Approve it, and you are connected. Access tokens last 24 hours. Refresh tokens last 30 days. The client renews them silently.

Personal Access Token. For clients without OAuth support:

  1. Generate a PAT at git.open-platform.sh/user/settings/applications.
  2. Give it the scopes read:user, read:organization, write:repository.
  3. Run the command:
claude mcp add --transport http plat https://mcp.open-platform.sh/mcp --header "Authorization: Bearer <FORGEJO_PAT>"

Sanity check. GET https://mcp.open-platform.sh/me with your credential returns {login, orgs, ...}. This shows who the server thinks you are, without a tool call.

What your agent may do

Every tool acts as the caller. Forgejo enforces the caller's permissions on every call. Read tools need read access on the repo. Write tools need write access. App-creation tools need org membership. The server limits each user to 60 calls per minute. The platform keeps an audit log of every call.

The tool tour

The tools group by intent. The full table of names and params is in Reference. These are the tools you reach for most.

Create and plan

Tool What it does
create_app One synchronous call: a repo from open-platform/app-template, CI credentials, a TLS'd URL, login, optional Postgres and bucket. Org-owned only — it refuses a user owner and suggests an org (<you>-apps). Prod stays dormant until your first release.
create_app with migrate: true Brings an existing repo onto the platform. A shaped repo bypasses the template and skips the v0.1.0 release. The first real release comes when the integration PR merges.
generate_app The async sibling. Create the repo and walk away: the build crew detects it within about a minute and ships v1 from the description alone. The description IS the builder's entire brief. Pass database: false for a pure consumer that owns no data.
create_issue / create_milestone File work. The label agent-work queues an issue for the crew. Milestones become episodes.
add_issue_dependency Declares a blocked-by edge; cross-repo edges are supported. The autopilot does not dispatch a blocked issue until its blocker closes. Cycle-guarded.
lint_dependency_graph Org-wide audit: cycles, orphaned consumers, duplicate providers, data-silo violations, the critical path.

Ship

Tool What it does
commit_files Many files, one commit, through the API. Creates the branch when it is missing.
create_pr / merge_pr Open and land PRs. create_pr is idempotent. On a 405, merge_pr tells you exactly what to fix.
release_app Cuts a semver release at main HEAD. CI builds the image and the chart; prod pins to that tag. Dev auto-rolls on every release. Prod moves only through this tool.
get_build / retry_build Read the CI status for a ref; re-dispatch a failed workflow. retry_build refuses PR-only workflows — push a commit to re-run a preview instead.

Integrate

Tool What it does
get_contract Read this before you build against another app. It returns the OpenAPI URL, the typed client package, the m2m audience, your granted scopes, and the entities you are forbidden to duplicate a table for. Not published yet? Wait for the owner's contract skeleton to merge, then re-run.

Observe

Tool What it does
get_app_status Deployment readiness, pods, image, recent warning events — per env (prod, dev, pr-<N>).
tail_logs A log snapshot across the env's pods. Supports grep, since, and previous for crashed containers.
query_db SQL against the app's own Postgres. Read-only by default. Always runs as the non-superuser app role.
read_repo / list_prs / list_issues / list_apps Read anything your account can see in the UI.

Operate

Tool What it does
comment / update_issue Steer the crew and close resolved issues. Issues and PRs share one numbering space; both tools work on both.
add_domain / verify_domain / set_app_domain / set_org_domain Bring your own domain: publish the DNS TXT challenge, then host per app or org-wide.
rotate_oauth_app Destructive: regenerates the app's login credentials and signs out every user.
delete_app Tears down the deployment, every preview and the gitops overlay (repo admin). The repo stays unless you pass force_repo: true.

Note: app secrets are not a tool. Set them as repo Actions secrets; they sync into the running app on every push. See Secrets and Config.

Note: PR previews are not a tool. Every open PR gets its own environment automatically through CI. See Preview Environments.

What you could automate

Three recipes to steal:

  1. Nightly issue triage. A scheduled agent runs list_issues across the org's repos. It runs lint_dependency_graph for stalls and cycles. It comments the findings on the offending issues. It labels ready work agent-work. The crew picks the work up by morning.
  2. An org from a PRD. Paste a product brief at your agent. The agent creates the org in Forgejo. It calls generate_app once per app, each with a dense one-sentence description. It passes database: false on the consumers. It adds add_issue_dependency edges so owners ship their contract skeletons before consumers build. The planner flow in Orgs and Planning does this natively; this recipe is how your agent drives it.
  3. A contract-first consumer scaffold. Before you write integration code: run get_contract(owner_org, owner_app). Run bun add on the typed client it names. Run commit_files with a scaffold that holds only urn:<owner>:<name>:<entity>:<id> references. Run create_pr. No duplicated tables, ever.

New to the platform itself? Start with Build Your First App. Then let your agent take over.