Skip to content

Getting Started

forkctl ships as a single npm package that is both a CLI and an MCP stdio server. Pick whichever surface fits the way you work — they call the same handlers.

  • Node.js 20 or newer
  • A GitHub personal access token (classic or fine-grained) with repo, workflow, and read:org scopes
  • For org-restricted operations, the token must be SSO-authorized for that org
Terminal window
npx @mcptoolshop/forkctl assess octocat/hello-world
Terminal window
npm install -g @mcptoolshop/forkctl
forkctl --help
Terminal window
npm install @mcptoolshop/forkctl
import { TOOLS, dispatch, buildOctokit, openState, Operations } from "@mcptoolshop/forkctl";
Terminal window
# bash / zsh
export GITHUB_TOKEN=ghp_xxxxx
# PowerShell
$env:GITHUB_TOKEN = "ghp_xxxxx"
VariableRequiredPurpose
GITHUB_TOKENyesAuthenticates every API call. Never logged.
GITHUB_API_URLnoDefaults to https://api.github.com. Set for GitHub Enterprise Server.
FORKCTL_STATE_DIRnoOverride the SQLite state directory. Defaults to the OS user-state path.
Terminal window
# 1. Score a repo's adoption-readiness
forkctl assess octocat/hello-world
# 2. Decide the right copy strategy
forkctl choose-path octocat/hello-world --goal contribute_upstream
# 3. Run a fork-policy preflight
forkctl preflight-policy octocat/hello-world
# 4. Kick off the fork (async — returns operation_id)
forkctl create-fork octocat/hello-world --destination-org my-org
# 5. Probe the operation
forkctl check-operation <operationId>

Every command prints a structured response. Add --json for raw machine-readable output.

Edit your MCP client config:

{
"mcpServers": {
"forkctl": {
"command": "npx",
"args": ["-y", "@mcptoolshop/forkctl", "mcp"],
"env": { "GITHUB_TOKEN": "ghp_xxxxx" }
}
}
}

Restart your client. The 22 tools appear under the forkctl server.

Terminal window
forkctl list-forks --limit 5

If you see your forks listed, your token works and forkctl is happy.

  • Learn the day-to-day patterns in Usage.
  • Look up any specific tool in the Reference.