Skip to main content

Remote MCP server

fremforge runs a Model Context Protocol server at:

https://frem.sh/_app/mcp

It gives an AI assistant read access to your organisation’s fremforge data: security findings, the component inventory, deployments, package access, policies, runner usage and CI logs. There is nothing to install. The server is remote and speaks the Streamable HTTP transport.

What the tools are

Every tool is one operation of the fremforge REST API, and a tool call is that REST call made with your token. The tool can do exactly what your token can do through https://frem.sh/_app/api/v1, with the same scopes, rate limits and audit trail. A 403 from the REST API comes back as a tool error with the same explanation.

  • Read-only, apart from a few write tools. The tools are GET operations marked readOnlyHint for your client. A few named write tools can act as you, but only after you consent to each one when you sign in, and only where your organisation’s owners allow it.
  • 43 tools, for example whoami, explain_pull_request, list_events (the event feed), list_merge_holds, list_sast_findings, list_dependency_findings, list_secret_findings, search_components, list_vulnerable_components, get_dependency_paths, list_repo_deployments, get_actions_run_logs, get_org_policy, get_package_access, get_org_settings (an organisation’s Active work, merge-hold, release-train, risk-tier, AI connector and AI feature settings, with what you may see) and get_my_settings (your own Active work switches). Your client lists them all, with descriptions, when it connects.
  • Not included: Git repositories, issues, pull request contents and workflow run lists. Those are served by the Forgejo API at https://frem.sh/api/v1, not by the fremforge API. Why a pull request is not merging is included: see Why a pull request is not merging.
  • Large results are cut at 100,000 characters, with a note saying so. Use the tool’s limit, cursor or filter arguments to narrow them.

Why a pull request is not merging

The explain_pull_request tool answers why a pull request has not merged. It is the REST call:

curl -sS https://frem.sh/_app/api/v1/orgs/<org>/repos/<repo>/pulls/<number>/why \
  -H "Authorization: Bearer $FREMFORGE_TOKEN"

It needs the findings:read scope. With a sign-in connector, read access to the repository is enough.

The answer reads the same facts that decide the merge. These are the merge queue’s own status, the required checks on the head commit, approvals, whether auto-merge is armed, conflicts, and an open issue labelled release-freeze in the repository. An assistant gets one answer instead of having to piece it together from the check list.

{
  "repo": "acme/api",
  "number": 42,
  "state": "failed",
  "next_action": "update the branch from main and re-run \"code-build / build (pull_request)\"",
  "reasons": [
    {
      "code": "stale_base_check",
      "kind": "failure",
      "source": "pr",
      "check": "code-build / build (pull_request)",
      "detail": "Required check \"code-build / build (pull_request)\" failed on an old base: main has moved since it ran.",
      "next_action": "update the branch from main and re-run \"code-build / build (pull_request)\""
    },
    {
      "code": "not_armed",
      "kind": "info",
      "source": "pr",
      "detail": "Auto-merge is not armed.",
      "next_action": "arm auto-merge once the reasons above are cleared"
    }
  ],
  "queue": null,
  "checks": { "required": ["code-build / build (pull_request)", "fremforge/dep-scan"], "passed": 1, "pending": 0, "failed": 1 },
  "approvals": { "required": 1, "approved": 1, "waived": false },
  "armed": false,
  "incomplete": []
}
  • state is one of mergeable, waiting, blocked, failed, merged or closed.
  • reasons are listed with failures first, then blockers, then waits, then notes. Each reason has a code, a kind, a source, a short detail and a next_action:
    • kind is failure (something went red), blocker (a person must act), wait (it moves on by itself) or info (worth knowing; it does not stop the merge).
    • source is pr (the pull request), queue (the merge queue’s verdict) or repo (the repository, for example a freeze or a merge hold).
    • Some reasons add fields: check or checks (the checks concerned), target_url (the check’s run), reviewers (who can approve), issue (the freeze issue), until (when a wait ends) and cause (why a check did not start).
  • queue gives the position, the length and an expected time while the pull request is in the merge queue. Its status is waiting (queued, and its merge group has not started), testing (its merge group is running), passed (its merge group passed, and it lands with the pull requests ahead), in_queue (queued, position not known), paused (the queue waits for the base branch to go green), merging (merged, and Forgejo has not caught up yet) or removed.
  • checks counts the required checks: passed, pending, failed, not_started (no run and no status on the head commit) and queue_only (they run only in the merge queue).
  • incomplete names any fact that could not be read, for example freeze or approvals. The answer may then be missing a reason. Nothing is guessed.

Reason codes

These are the codes you can get today. Treat a code you do not know as its kind says, and follow its next_action.

From the pull request (source: "pr"):

CodeWhat it meansWhat to do
required_check_failedA required check failed on the head commit.Read the check’s log and fix the cause.
stale_base_checkA required check failed, and the base branch has moved since the check started. The failure may already be fixed there.Update the branch from the base branch and re-run the check before you debug it.
required_check_pendingRequired checks have not finished yet. With source: "queue", the merge queue has superseded them, and its merge group’s run decides them.Wait. Do not re-run checks the merge queue has superseded.
required_check_workflow_missingA required check can never appear, because the workflow that posts it is not on the branch. It was usually added to the base branch after the branch was made.Update the branch from the base branch, or rebase it when it conflicts. Waiting does not help. If the base branch has no such workflow either, an org admin needs to fix the branch’s required checks.
required_check_not_startedA required check has neither a run nor a status on the head commit, and nothing is running that could post it. When the workflow’s paths or paths-ignore filter is the cause, cause names it.Push again (an empty commit is enough), or close and reopen the pull request. If a path filter is the cause, change a file it matches, or ask an org admin to fix the required checks. Waiting does not help.
queue_only_checksSome required checks run only in the merge queue: their workflow runs on merge_group, not on pull_request, so the pull request never posts them itself. queue_only lists them, with their result in the current merge group and on recent ones. Information only.Nothing before it is queued. Arm auto-merge, and its merge group runs them.
release_age_waitThe fremforge/release-age check is waiting: the pull request adds a dependency version younger than your organisation’s minimum release age. until says when the check passes. When the version cannot be dated, until is null and the check does not pass by itself.Wait until until. When until is null, push again, or ask an org owner for a scan-policy override.
approvals_missingIt has fewer approvals than the branch requires.Ask one of the people in reviewers to approve.
conflictIt conflicts with the base branch, or is behind it when Forgejo cannot tell which.Update the branch from the base branch and resolve the conflicts.
draftIt is a draft.Mark it ready for review.
stackIt is one layer of a stack of pull requests, each based on the one below. The stack field lists the layers, the top layer, and the layer that stops the stack landing as a unit. Information only: it can still merge on its own into its base.Follow next_action. Usually that is to merge the top layer, which lands the whole stack in one step.
armedAuto-merge is armed. With source: "queue", it is also in the merge queue, and detail gives its position.Wait. If reasons above it block the merge, clear them; it merges by itself after that.
not_armedAuto-merge is not armed. Information only.Arm auto-merge (merge when checks succeed) once the other reasons are cleared.

From the repository (source: "repo"):

CodeWhat it meansWhat to do
freezeAn open issue labelled release-freeze freezes the repository. issue links to it.Wait for the issue to close.
heldA merge hold stops it merging: fremforge/hold is pending. detail names the hold’s owner, expiry and reason. A hold that has expired and still holds is a blocker.Wait for the hold to be released, by its owner or by its release condition. If it has expired, ask its owner to release or extend it.
merge_hold_not_enforcedA merge hold covers it, but your organisation does not enforce merge holds, so the merge button does not wait for the hold. Information only.Do not merge until the hold is released. An org owner can turn on enforcement.

From the merge queue (source: "queue"):

CodeWhat it meansWhat to do
queue_pausedThe merge queue is paused: a required check, or a security gate, is red or pending on the base branch. The pull request keeps its place. sha is the base commit, and paused_over_hours appears when the pause has lasted longer than its limit.Wait. The queue resumes when the check is green on the base branch, so fixing the base branch is what moves it.
flaky_retryIts merge group is re-running one required job once, because that job was the only one that failed and may be flaky.Wait for the re-run. If it fails again, the merge group fails as usual.
group_failedIts merge group failed.Read the merge group’s failed run. It rejoins when the base branch moves, or re-arm it.
pending_timeoutIts merge group’s checks did not finish in time.Wait for the base branch to move, or re-arm it.
failing_checksA required check on the pull request itself is red.Fix the check. It rejoins the queue by itself once the check is green.
own_checks_timeoutIts own required checks stayed pending too long.Re-run its pending checks, or push. It rejoins when it is pushed to or re-armed.
conflictIt conflicts with the pull requests ahead of it.Update the branch and resolve the conflict.
draftIt became a draft.Mark it ready for review, then re-arm it.
approvalsIt lost its approvals.Get the approvals back, then re-arm it.
no_permissionThe person who armed it can no longer merge into the base branch.Ask someone who can merge into the base branch to arm it.
protected_filesIt changes protected files, which the queue does not take.Ask a repository admin to merge it.
merge_styleIt was armed with a merge style the queue cannot use.Arm it with the squash merge style.
renovateIt is a Renovate pull request, which Renovate keeps up to date itself.Wait.
agitIt is an AGit pull request, which the queue cannot update.Push it as a branch pull request.
held, release_age_waitIt left the queue because of a merge hold or a release-age wait. It keeps its auto-merge.Wait. It rejoins the queue by itself once the hold is released or the check passes.
queue_removedA removal the explainer does not recognise.Read the queue’s comment on the pull request, then re-arm it.

For the raw check list of any branch, tag or commit, signed-in connectors also have get_commit_status, which returns Forgejo’s combined status.

Token

The server accepts a fremforge API token (ffp_…) as a bearer token. Create one at https://frem.sh/<org>/_admin/api-tokens with Mint token, and give it the read scopes for the tools you want to use. Each tool’s description names the scope it needs, for example findings:read, components:read, policy:read or runners:read.

Other credentials are refused, including Git access tokens (Forgejo personal access tokens) and Forgejo OAuth tokens. With an API token, the Forgejo tools (repositories, pull requests, issues) are not available: those need the sign-in connector.

Start with the whoami tool. It shows which tenant and scopes the token carries.

Claude Code

claude mcp add --transport http fremforge https://frem.sh/_app/mcp \
  --header "Authorization: Bearer ffp_<your-token>"

Or in .mcp.json:

{
  "mcpServers": {
    "fremforge": {
      "type": "http",
      "url": "https://frem.sh/_app/mcp",
      "headers": { "Authorization": "Bearer ${FREMFORGE_TOKEN}" }
    }
  }
}

Cursor

In ~/.cursor/mcp.json (or .cursor/mcp.json in a project):

{
  "mcpServers": {
    "fremforge": {
      "url": "https://frem.sh/_app/mcp",
      "headers": { "Authorization": "Bearer ffp_<your-token>" }
    }
  }
}

Sign in instead of a token. Leave out headers, and Cursor signs you in with OAuth. Its MCP documentation says Cursor supports OAuth for servers that require it:

{
  "mcpServers": {
    "fremforge": { "url": "https://frem.sh/_app/mcp" }
  }
}

Cursor registers itself with frem.sh, so you need no client ID. It then opens frem.sh in your browser, and you sign in and allow access as described in Sign-in and consent. Signed in, Cursor also gets the read-only Forgejo tools. The desktop app receives the sign-in on your own machine; Cursor on the web and Cursor Agents receive it at cursor.com. To stop, remove the server or switch it off under Customize, and also withdraw it on frem.sh.

Mistral

Le Chat. An administrator adds a custom MCP connector:

  1. Server URL: https://frem.sh/_app/mcp
  2. Authentication: HTTP Bearer Token, with your ffp_… token.

Le Chat sorts tools into read and write functions. All fremforge tools are read-only.

Agents API and SDK. Pass the token as a header. In the Python SDK, give MCPClientStreamableHTTP a StreamableHTTPServerParams(url="https://frem.sh/_app/mcp", headers={"Authorization": "Bearer ffp_…"}). When you register a Studio connector (POST /v1/connectors), put the same header in headers.

Le Chat can also sign you in with OAuth instead of a token: see Le Chat.

Connectors with sign-in: claude.ai, ChatGPT, Le Chat

Chat apps that add an MCP server as a connector sign you in with OAuth instead of a token. fremforge is the authorization server for https://frem.sh/_app/mcp. It supports Client ID Metadata Documents, so a connector that identifies itself with a published document needs no registration. It also supports dynamic client registration for connectors that register themselves. You never enter a client ID or secret.

Sign-in and consent

The connector opens frem.sh in your browser. What follows is the same for every connector:

  1. Sign in to frem.sh as usual, with your organisation’s single sign-on and second factor where they apply. If you are already signed in, this step is skipped.
  2. fremforge’s consent page shows the connector’s name, the address it will send you back to and what it can do: read, as you, the fremforge data and repositories you can read. If the connector identified itself with a metadata document, the page shows that document’s full address. fremforge has not verified the name, so allow it only if you are adding the connector yourself.
  3. Choose Allow. You return to the chat app, and the connector shows as connected.

A connected assistant can use the tools above, plus read-only Forgejo tools: list_repos, get_repo, get_repo_tree, get_file_contents, list_branches, list_commits, get_commit, get_commit_diff, get_commit_status, list_pull_requests, get_pull_request, get_pull_request_diff, list_pull_request_files, list_pull_request_reviews, list_issues, get_issue, list_issue_comments, list_workflow_runs, get_workflow_run and list_workflow_jobs. It cannot change anything.

It has exactly the access you have through the API. The organisation tools answer for the organisations you own, and read-only where you are an auditor. The Forgejo tools answer for the repositories Forgejo lets you read. Your organisation’s IP allowlist applies to the connector as it applies to you.

The connector acts on your behalf and has no identity of its own. An audit event its calls write names you as the actor, with the connector as a detail: fields.agent is mcp-client:<client id>. The admin audit log shows such events with a via agent chip.

The connector never receives your frem.sh password or your tokens. Its own access lasts an hour at a time and is renewed in the background.

claude.ai

Custom connectors work in Claude on the web, in Claude Desktop and in Cowork. Free plans allow one custom connector. Claude’s custom connector guide has the current steps:

  1. Pro and Max: go to Customize → Connectors, choose + Add, then Add custom connector. Team and Enterprise: an owner goes to Organization settings → Connectors, chooses Add, then Custom → Web. Members then find the connector under Customize → Connectors and choose Connect.
  2. Name it, for example fremforge, and enter the server URL https://frem.sh/_app/mcp.
  3. For the OAuth client, keep Use Claude’s published identity. Register automatically works too. Leave request headers empty.
  4. Choose Add, then sign in and allow access as described in Sign-in and consent.

To use it, choose + in a chat, then Connectors, and switch fremforge on for that conversation. To remove it, use Remove or the menu next to the connector on the same page, then also withdraw it on frem.sh.

ChatGPT

ChatGPT calls custom MCP servers plugins or apps. Adding one needs developer mode, and on Business, Enterprise and Edu plans a workspace admin may have to allow it. OpenAI’s guide to connecting an MCP server to ChatGPT has the current steps:

  1. Open ChatGPT Plugins, choose +, then Add custom MCP server.
  2. Enter a name and description. Under Connection, choose Public endpoint and enter https://frem.sh/_app/mcp.
  3. For authentication, choose OAuth. ChatGPT finds frem.sh’s sign-in from the server, so no client ID is needed. Confirm the risk warning and choose Create as a plugin.
  4. Sign in and allow access as described in Sign-in and consent.

ChatGPT shows the tools it found. To use them, type @ in a new conversation and choose the plugin. To remove it, disconnect or delete it in ChatGPT’s app settings, then also withdraw it on frem.sh.

Le Chat

In Le Chat, an administrator adds custom connectors. On Free, Pro and Student plans the account owner is the administrator. Mistral’s MCP connector documentation has the current steps:

  1. Open Connectors, choose + Add Connector and switch to the Custom MCP Connector tab.
  2. Enter a connector name without spaces, for example fremforge, and the server URL https://frem.sh/_app/mcp.
  3. Choose Connect. Le Chat detects OAuth 2.1 and registers itself.
  4. Sign in and allow access as described in Sign-in and consent.

Each user can pre-approve functions under Connectors → My Connectors, on the connector’s Functions tab. Otherwise Le Chat asks before each call. All fremforge functions are read-only. To stop using it, remove it on the Connectors page and also withdraw it on frem.sh. Le Chat also accepts an ffp_ token as an HTTP bearer token instead of sign-in, as in Mistral above.

Desktop apps and redirects

A desktop or command-line client that signs in through the browser needs the code back on the same device. fremforge accepts two kinds of redirect for this:

  • Loopback: http://127.0.0.1/…, http://[::1]/… or http://localhost/…. The port is ignored when matching, so a client can listen on any free port (RFC 8252 section 7.3). Claude Code and the Cursor desktop app work this way.
  • App schemes, such as cursor://…, vscode://… or com.example.app:/callback, for clients without a client secret. They match exactly, port included. The consent page names the scheme and warns that any installed app can claim one, so allow it only for an app you are connecting yourself.

Some schemes are never accepted as redirects, whatever their case:

  • schemes a browser or the operating system treats as content or navigation: javascript, data, file, blob, ftp, about, ws, wss, vbscript, view-source, chrome, chrome-extension, moz-extension and intent;
  • fremforge’s own names: fremforge, frem and sh.frem;
  • http on anything but a loopback address.

PKCE is required in every case.

Block connectors for an organisation

Connectors are allowed by default. An owner can block them under Security › Access › AI connectors (https://frem.sh/<org>/_admin/security/access/ai-connectors), or with PUT /orgs/{org}/policy and {"ai_connectors": {"access": "blocked"}}. While they are blocked, every connector call for that organisation’s data, including its repositories, is refused with 403. API tokens are not affected. Each change is recorded in the audit log as tenant.ai_connectors.blocked or tenant.ai_connectors.allowed.

Withdraw a connector

Withdrawing a connector ends all its sessions at once. List your connectors, then delete the one to withdraw, with a credential that carries your identity, such as the one fremforge auth login stores:

curl -sS https://frem.sh/_app/api/v1/users/me/connector-grants -H "Authorization: Bearer $TOKEN"
curl -sS -X DELETE https://frem.sh/_app/api/v1/users/me/connector-grants/<id> -H "Authorization: Bearer $TOKEN"

To connect it again, add it again; it asks for your consent again. Revoking the fremforge connector application under Authorized OAuth2 applications at frem.sh/user/settings/applications, or a disabled account, also ends every connector of yours the next time one is used.

Check the connection

curl -sS https://frem.sh/_app/mcp \
  -H "Authorization: Bearer $FREMFORGE_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"whoami","arguments":{}}}'

Errors

You seeMeaning
HTTP 401 with WWW-Authenticate: BearerNo token, or an unknown, expired or revoked one. The header’s resource_metadata points connectors to sign-in.
A tool result starting HTTP 403The token is valid but lacks the tool’s scope, or cannot reach that organisation. The tool description names the scope.
A tool result starting HTTP 404The organisation, repository or object does not exist, or the token cannot see it.
HTTP 405 on GETExpected. The server is stateless and answers POST only.

Sovereignty

Your assistant’s vendor receives what the tools return, in the same way it receives the files you open. fremforge does not send your data to any AI vendor. The MCP server is part of the fremforge API and runs in the same EU platform.