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.
Requirements
Section titled “Requirements”- Node.js 20 or newer
- A GitHub personal access token (classic or fine-grained) with
repo,workflow, andread:orgscopes - For org-restricted operations, the token must be SSO-authorized for that org
Install
Section titled “Install”As a one-shot command
Section titled “As a one-shot command”npx @mcptoolshop/forkctl assess octocat/hello-worldAs a global CLI
Section titled “As a global CLI”npm install -g @mcptoolshop/forkctlforkctl --helpAs a project dependency (embed mode)
Section titled “As a project dependency (embed mode)”npm install @mcptoolshop/forkctlimport { TOOLS, dispatch, buildOctokit, openState, Operations } from "@mcptoolshop/forkctl";Configure your GitHub token
Section titled “Configure your GitHub token”# bash / zshexport GITHUB_TOKEN=ghp_xxxxx
# PowerShell$env:GITHUB_TOKEN = "ghp_xxxxx"| Variable | Required | Purpose |
|---|---|---|
GITHUB_TOKEN | yes | Authenticates every API call. Never logged. |
GITHUB_API_URL | no | Defaults to https://api.github.com. Set for GitHub Enterprise Server. |
FORKCTL_STATE_DIR | no | Override the SQLite state directory. Defaults to the OS user-state path. |
First runs
Section titled “First runs”# 1. Score a repo's adoption-readinessforkctl assess octocat/hello-world
# 2. Decide the right copy strategyforkctl choose-path octocat/hello-world --goal contribute_upstream
# 3. Run a fork-policy preflightforkctl 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 operationforkctl check-operation <operationId>Every command prints a structured response. Add --json for raw machine-readable output.
Wire it into Claude Code
Section titled “Wire it into Claude Code”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.
Smoke test
Section titled “Smoke test”forkctl list-forks --limit 5If you see your forks listed, your token works and forkctl is happy.