{
  "markdown": "# PayPal AI Toolkit\n\nA Claude Code plugin that integrates PayPal's APIs and MCP server into your development workflow. Get AI-assisted help with PayPal payments, subscriptions, invoices, disputes, and more — directly in your editor.\n\n## Features\n\n- **Best practices Skill** — auto-injects PayPal API knowledge when you're working on payment integrations\n- **Commands** — quick reference commands for common developer tasks\n- **Hooks** — automatically checks PayPal best practices before Claude writes integration code\n- **MCP Server integration** — connects Claude to PayPal's sandbox MCP servers for direct API operations via natural language\n\n![Demo of installation and usage](https://github.com/user-attachments/assets/787a2b4c-4276-422c-9124-fd535571a68c)\n\n## Installation\n\n### Prerequisites\n\n- Claude Code (`claude --version`)\n- A PayPal Developer account at https://developer.paypal.com\n- A PayPal sandbox access token\n\n### Install\n\nPayPal AI Toolkit is available on the official Anthropic marketplace, which Claude Code adds automatically. Install it with:\n\n```\n/plugin install paypal@claude-plugins-official\n```\n\nThen run `/reload-plugins` to activate it.\n\n#### Local / development install\n\nTo work on the plugin itself, clone the repo and load it directly instead:\n\n```bash\ngit clone https://github.com/paypal/AI-Toolkit.git\n```\n\nThen start Claude Code with the plugin loaded:\n\n```bash\ncd your-project/\nclaude --plugin-dir /path/to/AI-Toolkit\n```\n\n### Configure your sandbox access token\n\n1. Generate a sandbox access token:\n\n   ```bash\n   curl -X POST https://api-m.sandbox.paypal.com/v1/oauth2/token \\\n     -u \"YOUR_SANDBOX_CLIENT_ID:YOUR_SANDBOX_CLIENT_SECRET\" \\\n     -d \"grant_type=client_credentials\" \\\n     | jq -r .access_token\n   ```\n\n   Get the client ID and secret from the [PayPal Developer Dashboard](https://developer.paypal.com/dashboard/applications/sandbox).\n\n2. Paste the single-line value into `~/.claude/settings.json`, merging into the existing `\"env\"` block:\n\n   ```json\n   \"env\": {\n     \"PAYPAL_SANDBOX_ACCESS_TOKEN\": \"A21AA…\"\n   }\n   ```\n\n3. **Fully quit Claude Code** (close the app — not just `/clear`) and reopen.\n\n4. Run `/paypal:setup` to verify.\n\n> **Use `settings.json`, not `~/.zshrc`.** GUI launches don't source `~/.zshrc`, and a line-wrapped `export` embeds a newline in the token that breaks the HTTP header.\n\nTokens expire in up to 8 hours depending on scope — check the `expires_in` field in the response. Run `/paypal:setup refresh` when you hit a 401.\n\n## Commands\n\n| Command                         | Description                                       |\n| ------------------------------- | ------------------------------------------------- |\n| `/paypal:doctor [symptom]`      | Scan your codebase for PayPal integration issues  |\n| `/paypal:explain-error <code>`  | Explain a PayPal error code with causes and fixes |\n| `/paypal:sandbox [topic]`       | Sandbox setup, test accounts, and testing tips    |\n| `/paypal:setup [mode]`          | Configure the plugin, verify MCP, refresh tokens  |\n| `/paypal:test-accounts [topic]` | Test cards, BNPL, Venmo, webhooks, and scenarios  |\n\n### Examples\n\n```\n/paypal:explain-error INSTRUMENT_DECLINED\n/paypal:explain-error 422 UNPROCESSABLE_ENTITY\n/paypal:sandbox subscriptions\n/paypal:sandbox webhooks\n/paypal:setup\n/paypal:doctor webhooks not firing\n```\n\n## MCP Server\n\nThe plugin connects to PayPal's sandbox MCP server, which exposes tools for:\n\n- **Orders & Payments** — create orders, capture payments, process refunds\n- **Invoices** — create, send, manage, and generate QR codes for invoices\n- **Subscriptions** — manage billing plans and subscriptions\n- **Disputes** — list and respond to buyer disputes\n- **Catalog** — manage products and pricing\n- **Shipment** — create and track shipments\n- **Reporting** — list transactions, get merchant insights\n\n### Transport and environments\n\nThe server uses **SSE** at the `/sse` path. `paypal-sandbox` activates once you set `PAYPAL_SANDBOX_ACCESS_TOKEN` in `~/.claude/settings.json`.\n\n## Skills\n\nThe `paypal-best-practices` skill is automatically invoked when Claude detects you're working on PayPal integrations. It provides:\n\n- Recommended APIs and deprecated APIs to avoid\n- Authentication and credential best practices\n- Orders, Subscriptions, and Invoices API flows\n- Webhook verification and security guidance\n- Error handling patterns\n- Sandbox testing guidance\n\nThe `paypal-routing` skill routes PayPal-related questions to the right command or reference file and is not directly user-invocable.\n\n## Hooks\n\nA `PreToolUse` hook checks whether a file edit touches PayPal SDK, API, or checkout code. If it does, Claude is required to consult the `paypal-best-practices` skill and the correct SDK version reference (v5 or v6) before writing the code.\n\n## Plugin Structure\n\n```\nAI-Toolkit/\n├── .claude-plugin/\n│   ├── marketplace.json     # Marketplace registry (for /plugin install)\n│   └── plugin.json          # Plugin manifest\n├── .mcp.json                # PayPal sandbox MCP server (SSE)\n├── skills/\n│   ├── paypal-best-practices/\n│   │   ├── SKILL.md         # Auto-injected best practices context\n│   │   └── references/      # Topic-specific integration guides\n│   └── paypal-routing/\n│       └── SKILL.md         # Intent routing (non-user-invocable)\n├── commands/\n│   ├── doctor.md            # /paypal:doctor\n│   ├── explain-error.md     # /paypal:explain-error\n│   ├── sandbox.md           # /paypal:sandbox\n│   ├── setup.md             # /paypal:setup\n│   └── test-accounts.md     # /paypal:test-accounts\n├── hooks/\n│   └── hooks.json           # Pre-write best-practices check\n├── LICENSE                  # Apache-2.0\n└── README.md\n```\n\n## Resources\n\n- [PayPal Developer Docs](https://developer.paypal.com/docs/)\n- [PayPal REST API Reference](https://developer.paypal.com/api/rest/)\n- [PayPal MCP Server](https://docs.paypal.ai/developer/tools/ai/mcp-quickstart)\n- [PayPal Agent Toolkit](https://github.com/paypal/agent-toolkit)\n- [PayPal Developer Dashboard](https://developer.paypal.com/dashboard)\n",
  "bytes": 6061,
  "sha": "fea3eada8b95695e5daeb53420e5daca43916d5dc78a43df01c638098b1c68df",
  "repo_slug": "paypal/ai-toolkit",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/plg_paypal_ai_toolkit_paypal_2899d935/readme"
}