Agent Integration Guide

March 7, 2026 · View on GitHub

New to Pare? Start with the Quickstart Guide for a step-by-step setup walkthrough. This page covers advanced integration details.

This guide covers how to configure coding agents to use Pare MCP tools instead of raw CLI commands.

Why Structured Output Matters

When a coding agent runs git log --oneline -20, the raw CLI output must be parsed from unstructured text. This has three problems:

  1. Token waste — Raw CLI output is verbose. A git status call returns decorative headers, alignment spacing, and ANSI codes that consume tokens without adding value. Pare's structured JSON is typically 40-70% smaller.

  2. Fragile parsing — Agents guess at text formats that change between tool versions, locales, and configurations. Structured JSON with named fields eliminates this class of errors.

  3. Inconsistent schemasdocker ps output differs from docker ps --format json. Pare normalizes all output into a consistent schema per tool, so the agent always knows what to expect.

Pare solves all three by wrapping CLI tools in MCP servers that return structured JSON with optimized schemas.

Quick Setup Per Agent

Claude Code

  1. Copy the rule file into your project:
cp rules/CLAUDE.md CLAUDE.md
  1. (Optional) Install the PreToolUse hook for automatic enforcement:
mkdir -p .claude/hooks
cp hooks/pare-prefer-mcp.sh .claude/hooks/
chmod +x .claude/hooks/pare-prefer-mcp.sh
  1. Add to .claude/settings.json:
{
  "hooks": {
    "PreToolUse": [
      {
        "matcher": "Bash",
        "hooks": [
          {
            "type": "command",
            "command": "./.claude/hooks/pare-prefer-mcp.sh"
          }
        ]
      }
    ]
  }
}

See Claude Code Hooks Deep Dive for details.

Hook path note: The hook path ./.claude/hooks/pare-prefer-mcp.sh is project-relative. Claude Code must be invoked from the project root directory for the hook to be found.

Cursor

Copy the rule file:

mkdir -p .cursor/rules
cp rules/.cursor/rules/pare.mdc .cursor/rules/pare.mdc

The alwaysApply: true frontmatter ensures the rules are active for every conversation.

Windsurf

Copy the rule file to your project root:

cp rules/.windsurfrules .windsurfrules

The file must stay under 6,000 characters (it currently uses ~1,800).

Cline

Copy the rule file:

mkdir -p .clinerules
cp rules/.clinerules/pare.md .clinerules/pare.md

GitHub Copilot

Copy the rule file:

mkdir -p .github
cp rules/.github/copilot-instructions.md .github/copilot-instructions.md

Gemini CLI

Copy the rule file to your project root:

cp rules/GEMINI.md GEMINI.md

Aider

Copy the conventions file:

cp rules/CONVENTIONS.md CONVENTIONS.md

Note: Aider does not support MCP natively. See the file for workaround options.

Claude Code Hooks Deep Dive

The hooks/pare-prefer-mcp.sh script is a PreToolUse hook that intercepts Bash tool calls before they execute. When the agent tries to run a CLI command that has a Pare MCP equivalent, the hook blocks the call and returns a deny response with the correct MCP tool name.

How It Works

  1. Claude Code sends the tool input as JSON on stdin:

    {
      "tool_name": "Bash",
      "tool_input": {
        "command": "git status"
      }
    }
    
  2. The hook extracts the command, identifies the binary (git), and checks if it maps to a Pare server.

  3. If matched, it returns a deny response:

    {
      "hookSpecificOutput": {
        "hookEventName": "PreToolUse",
        "permissionDecision": "deny",
        "permissionDecisionReason": "Use pare-git status instead of 'git status'. The MCP tool returns structured JSON with fewer tokens."
      }
    }
    
  4. Claude Code sees the denial and uses the suggested MCP tool instead.

Compound Commands

The hook only checks the first command in pipes and chains:

  • echo foo | grep bar — allowed (first command is echo)
  • grep pattern file | wc -l — denied (first command is grep)
  • cd /tmp && git status — allowed (first command is cd)

Configuration

Toggle individual servers on/off in the config section at the top of the script:

PARE_GIT=1        # Comment out to allow raw git commands
PARE_GITHUB=1
PARE_NPM=1
PARE_SEARCH=1
PARE_LINT=1
PARE_BUILD=1
PARE_TEST=1
PARE_DOCKER=1
PARE_HTTP=1
PARE_MAKE=1
PARE_CARGO=1
PARE_GO=1
PARE_PYTHON=1
PARE_K8S=1
PARE_SECURITY=1

CLI to MCP Mapping Reference

pare-git (replaces git)

CLI CommandMCP Tool
git statuspare-git status
git logpare-git log
git diffpare-git diff
git branchpare-git branch
git showpare-git show
git addpare-git add
git commitpare-git commit
git pushpare-git push
git pullpare-git pull
git checkoutpare-git checkout
git tagpare-git tag
git stashpare-git stash
git remotepare-git remote
git blamepare-git blame
git restorepare-git restore
git resetpare-git reset
git cherry-pickpare-git cherry-pick
git mergepare-git merge
git rebasepare-git rebase
git reflogpare-git reflog
git bisectpare-git bisect
git worktreepare-git worktree
git submodulepare-git submodule
git archivepare-git archive
git cleanpare-git clean
git configpare-git config

pare-github (replaces gh)

CLI CommandMCP Tool
gh pr viewpare-github pr-view
gh pr listpare-github pr-list
gh pr createpare-github pr-create
gh pr mergepare-github pr-merge
gh pr commentpare-github pr-comment
gh pr reviewpare-github pr-review
gh pr updatepare-github pr-update
gh pr checkspare-github pr-checks
gh pr diffpare-github pr-diff
gh issue viewpare-github issue-view
gh issue listpare-github issue-list
gh issue createpare-github issue-create
gh issue closepare-github issue-close
gh issue commentpare-github issue-comment
gh issue updatepare-github issue-update
gh run viewpare-github run-view
gh run listpare-github run-list
gh run rerunpare-github run-rerun
gh release createpare-github release-create
gh release listpare-github release-list
gh label listpare-github label-list
gh label createpare-github label-create
gh repo viewpare-github repo-view
gh repo clonepare-github repo-clone
gh discussion listpare-github discussion-list
gh gist createpare-github gist-create
gh apipare-github api

pare-npm (replaces npm, pnpm, yarn)

CLI CommandMCP Tool
npm installpare-npm install
npm auditpare-npm audit
npm outdatedpare-npm outdated
npm listpare-npm list
npm run <script>pare-npm run
npm testpare-npm test
npm initpare-npm init
npm info <pkg>pare-npm info
npm search <query>pare-npm search
nvmpare-npm nvm

pare-search (replaces search tools)

CLI CommandMCP Tool
grep / rgpare-search search
find / fdpare-search find
wcpare-search count
jqpare-search jq
yqpare-search yq

pare-lint (replaces linters/formatters)

CLI CommandMCP Tool
eslintpare-lint lint
prettier --checkpare-lint format-check
prettier --writepare-lint prettier-format
biome checkpare-lint biome-check
biome formatpare-lint biome-format
stylelintpare-lint stylelint
oxlintpare-lint oxlint
shellcheckpare-lint shellcheck
hadolintpare-lint hadolint

pare-build (replaces build tools)

CLI CommandMCP Tool
tscpare-build tsc
npm run buildpare-build build
esbuildpare-build esbuild
vite buildpare-build vite-build
webpackpare-build webpack
turbopare-build turbo
nxpare-build nx
lernapare-build lerna
rolluppare-build rollup

pare-test (replaces test runners)

CLI CommandMCP Tool
vitest / jest / mocha / pytestpare-test run
vitest --coveragepare-test coverage
playwright testpare-test playwright

pare-docker (replaces docker)

CLI CommandMCP Tool
docker pspare-docker ps
docker buildpare-docker build
docker logspare-docker logs
docker imagespare-docker images
docker runpare-docker run
docker execpare-docker exec
docker pullpare-docker pull
docker inspectpare-docker inspect
docker statspare-docker stats
docker compose uppare-docker compose-up
docker compose downpare-docker compose-down
docker compose pspare-docker compose-ps
docker compose logspare-docker compose-logs
docker compose buildpare-docker compose-build
docker network lspare-docker network-ls
docker volume lspare-docker volume-ls

pare-cargo (replaces cargo)

CLI CommandMCP Tool
cargo buildpare-cargo build
cargo testpare-cargo test
cargo clippypare-cargo clippy
cargo runpare-cargo run
cargo addpare-cargo add
cargo removepare-cargo remove
cargo fmtpare-cargo fmt
cargo docpare-cargo doc
cargo checkpare-cargo check
cargo updatepare-cargo update
cargo treepare-cargo tree
cargo auditpare-cargo audit

pare-go (replaces go, golangci-lint)

CLI CommandMCP Tool
go buildpare-go build
go testpare-go test
go vetpare-go vet
go runpare-go run
go mod tidypare-go mod-tidy
go fmtpare-go fmt
go generatepare-go generate
go envpare-go env
go listpare-go list
go getpare-go get
golangci-lintpare-go golangci-lint

pare-python (replaces Python tools)

CLI CommandMCP Tool
pip installpare-python pip-install
pip listpare-python pip-list
pip showpare-python pip-show
pip-auditpare-python pip-audit
mypypare-python mypy
ruff checkpare-python ruff-check
ruff formatpare-python ruff-format
blackpare-python black
pytestpare-python pytest
uv installpare-python uv-install
uv runpare-python uv-run
condapare-python conda
pyenvpare-python pyenv
poetrypare-python poetry

pare-k8s (replaces kubectl, helm)

CLI CommandMCP Tool
kubectl getpare-k8s get
kubectl describepare-k8s describe
kubectl logspare-k8s logs
kubectl applypare-k8s apply
helmpare-k8s helm

pare-http (replaces curl, wget)

CLI CommandMCP Tool
curl / wgetpare-http request
curl -X GET <url>pare-http get
curl -X POST <url>pare-http post
curl -I <url>pare-http head

pare-make (replaces make, just)

CLI CommandMCP Tool
make <target> / just <target>pare-make run
List targetspare-make list

pare-security (replaces security scanners)

CLI CommandMCP Tool
trivypare-security trivy
semgreppare-security semgrep
gitleakspare-security gitleaks

pare-process (general fallback)

CLI CommandMCP Tool
Any command not covered abovepare-process run

Fallback Patterns

When a Pare MCP tool call fails, follow these steps:

1. Check the Error Response

All Pare tools return errors in a consistent JSON format:

{
  "error": "Description of what went wrong",
  "code": "ERROR_CODE"
}

Read the error field to understand the problem.

2. Fix and Retry

Common fixes:

  • Missing required parameter — Add the missing field to the tool input.
  • Invalid path — Verify the path exists and is absolute.
  • Permission denied — Check file/directory permissions.
  • Tool not found — The underlying CLI tool is not installed. Install it and retry.

3. Use pare-process run as Last Resort

If a specific Pare tool is unavailable or broken, pare-process run can execute any command and still return structured output:

pare-process run { "command": "git status" }

This is better than raw Bash because the output is still wrapped in a structured response.

4. Never Fall Back to Raw CLI

Do not bypass Pare by running the raw CLI command in a shell. This defeats the purpose of structured output and wastes tokens. If a Pare server is down, inform the user and suggest they check their MCP configuration.

FAQ

Which agents support MCP?

Claude Code, Cursor, Windsurf, Cline, and GitHub Copilot all support MCP tool servers. Aider and some other agents do not have native MCP support.

Do I need all 28 Pare servers?

No. Install only the servers you need. The rule files cover all servers, but agents will simply skip tools that are not available.

Can I use Pare with multiple agents?

Yes. Copy the appropriate rule file for each agent you use. They can all connect to the same Pare MCP servers.

How do I install Pare servers?

See the main README for installation instructions. Each server is an npm package under @anthropic/pare-*.

What if a Pare tool is slower than the raw CLI?

Pare adds minimal overhead (typically < 50ms) for JSON serialization. The token savings from structured output far outweigh this latency. If you observe significant slowness, file an issue.

Can I customize which commands are intercepted?

Yes. The Claude Code hook (hooks/pare-prefer-mcp.sh) has a config section where you can disable individual servers. For other agents, edit the rule file to remove tools you do not want enforced.

What about commands Pare does not cover?

Use pare-process run to execute any command with structured output wrapping. You can also use raw Bash for commands that Pare genuinely does not cover (e.g., ls, cat, echo).

Does the hook affect non-Pare commands?

No. The hook only intercepts commands whose binary name matches a Pare-supported tool. Commands like ls, cat, echo, cd, mkdir, etc. pass through without any interception.