بنقرة واحدة
pact-setup
Configure PACT for any MCP client or CLI — repo path, user config, and connectivity verification
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Configure PACT for any MCP client or CLI — repo path, user config, and connectivity verification
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
| name | Pact Setup |
| description | Configure PACT for any MCP client or CLI — repo path, user config, and connectivity verification |
Walk the user through configuring their PACT integration. Works with any MCP client (Claude Code, Cursor, Windsurf, Craft Agent) or the standalone CLI.
PACT is a lightweight, Git-based protocol for async work requests between people and AI agents. Think of it as a structured inbox — you can send requests (code reviews, questions, check-ins) to teammates, and they can respond on their own schedule.
How it works:
pact-store/ — they describe request types with schemas, guidance, and response formatsrequests/pending/ — status changes happen via explicit actionsBefore asking the user anything, check for existing configuration:
echo $PACT_REPO $PACT_USER
cat ~/.pact.json 2>/dev/null
Check the relevant MCP client config for an existing PACT server entry:
~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows).mcp.json in the project root, or ~/.claude.json for global config.cursor/mcp.json in the project root~/.craft-agent/workspaces/<workspace>/sources/pact/config.jsonA: Nothing configured (fresh install) The user needs full setup. Proceed to "Information to Gather".
B: Env vars or ~/.pact.json exist Already partially configured. Check if the repo path is valid and the user ID is set. Ask what they'd like to change.
C: MCP client config exists Already configured for their editor. Verify the server path exists and PACT_REPO/PACT_USER are set correctly.
Ask the user for each piece of information, one at a time. Explain what each is for. Skip items that are already configured.
Pact repo path — Absolute path to their local clone of the shared pact repo.
git clone <url> ~/pact-repos/<repo-name>
.git directory.User ID — Their PACT user ID (lowercase, hyphens-for-spaces, e.g., alice or cory-smith). This identifies them as sender/recipient.
Display name (optional) — Friendly name shown to others (e.g., Alice, Cory Smith). Defaults to user ID if not set.
Subscriptions (optional) — Group inboxes to subscribe to (e.g., +backend-team, +on-call). These control which group requests appear in their inbox. They can add more later with pact_do subscribe.
Ask the user which setup they want. Most users want both MCP client + CLI.
Configure the PACT MCP server in their editor's config.
Step 1: Build the server (if not already built)
cd ~/pact # or wherever the pact source lives
npm install && npm run build
Step 2: Configure the MCP client
The server entry needs:
node["<path-to-pact>/dist/index.js"]PACT_REPO, PACT_USER, optionally PACT_DISPLAY_NAMEClaude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
{
"mcpServers": {
"pact": {
"command": "node",
"args": ["<absolute-path-to-pact>/dist/index.js"],
"env": {
"PACT_REPO": "<absolute-path-to-pact-repo>",
"PACT_USER": "<user-id>",
"PACT_DISPLAY_NAME": "<display-name>"
}
}
}
}
Cursor (.cursor/mcp.json in project root):
{
"mcpServers": {
"pact": {
"command": "node",
"args": ["<absolute-path-to-pact>/dist/index.js"],
"env": {
"PACT_REPO": "<absolute-path-to-pact-repo>",
"PACT_USER": "<user-id>"
}
}
}
}
Important:
~/...). Expand ~ to the full home directory path.PACT_DISPLAY_NAME in the env block.Install the pact CLI for terminal-based inbox checking and background polling.
Step 1: Build and link
cd ~/pact # or wherever the pact source lives
npm install && npm run build
npm link # makes `pact` available globally
Step 2: Create config file
Write ~/.pact.json:
{
"repo": "<absolute-path-to-pact-repo>",
"user": "<user-id>",
"display_name": "<display-name>",
"poll_interval": 60
}
Or set environment variables instead:
export PACT_REPO=<path>
export PACT_USER=<user-id>
Step 3: Verify
pact inbox
Do both Path A and Path B. The MCP client gives you PACT tools inside your editor. The CLI gives you inbox checking and background polling from any terminal.
If the user has group subscriptions, set them up after the source is connected:
Via MCP tools (if connected):
Call pact_do with action: "subscribe", recipient: "+group-name" for each group.
Via CLI (if installed):
Subscriptions are stored in members/{user_id}.json in the pact repo. The subscribe action handles this automatically.
pact_discover — should return a catalog of available pact typespact_do with action: "inbox" — should return inbox results (empty is fine)pact inbox
Common issues:
npm run build)For continuous inbox monitoring from the terminal:
# Watch mode — polls every 60 seconds
pact poll --watch
# Custom interval
pact poll --watch --interval 30
# With desktop notifications (macOS/Linux)
pact poll --watch --notify
To run as a background process:
nohup pact poll --watch --notify > ~/.pact-poll.log 2>&1 &
Tell the user what was configured:
<path><user-id><list> (if any)pact_discoverpact_dopact_do with action: "subscribe", recipient: "+group-name"