> ## Documentation Index
> Fetch the complete documentation index at: https://ownpay.org/docs/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> OwnPay is licensed under AGPL-3.0 and is completely free - no licensing fees.
> Production docs URL: https://ownpay.org/docs - append .md to any page URL for clean markdown.
> OwnPay requires PHP 8.3+, MySQL/MariaDB, and Redis.
> MCP server available at https://ownpay.org/docs/mcp for programmatic documentation queries.
> Use root-relative links (e.g. /quickstart) for internal navigation - do NOT include /docs prefix.
> Plugin development: consult /developer/plugins/ pages for correct interfaces and manifests.
> Canonical locations: API auth = /api/authentication, webhook verification = /api/webhooks, rate limits = /resources/rate-limiting, transaction statuses = /fundamentals/payment-flow.
> The documentation uses the Diataxis framework: Tutorials (learning), How-to (tasks), Reference (lookup), Explanation (understanding).

# AI Tools

> Use AI agents to build OwnPay integrations and plugins. Connect the MCP server for live docs, install AI Skills, and use prompt templates for gateway, addon, theme, and integration development.

## What are AI Tools?

OwnPay provides a suite of AI-powered development tools that let you build production-ready plugins, integrations, and custom gateways using AI assistants like Claude, ChatGPT, and Cursor. Instead of reading through dozens of documentation pages to understand interfaces and conventions, your AI agent reads the docs for you and generates correct code on the first attempt.

The AI Tools ecosystem has two main components:

<CardGroup cols={2}>
  <Card title="MCP Server" icon="server" href="/docs/developer/ai/mcp">
    A Model Context Protocol server that gives your AI assistant **live access to all OwnPay documentation** at query time. Every question reads real docs - not stale training data. Supports Claude Desktop, Cursor, VS Code (Cline/Roo Code), and Windsurf.
  </Card>

  <Card title="AI Skills" icon="sparkles" href="/docs/developer/ai/skills">
    Pre-built instruction files that teach your AI assistant the OwnPay architecture, plugin system, coding conventions, and interface contracts before you ask it anything. Install once, and every subsequent prompt benefits from that context.
  </Card>
</CardGroup>

<Tip>
  Use both MCP and Skills together for the best results. Skills teach the AI what OwnPay is and how to think about it. MCP lets it look up exact method signatures, hook names, and configuration details on demand.
</Tip>

## Quickstart

Get up and running with AI-assisted OwnPay development in three steps:

## Why use AI with OwnPay?

<CardGroup cols={3}>
  <Card title="Faster development" icon="bolt">
    Generate a complete gateway adapter with all required methods in seconds. What used to take hours of reading docs and writing boilerplate now takes a single prompt.
  </Card>

  <Card title="Fewer errors" icon="shield-check">
    The MCP server feeds your AI the exact interface signatures, hook names, and return types. No more guessing at method signatures or missing required methods.
  </Card>

  <Card title="Consistent conventions" icon="circle-check">
    Skills enforce OwnPay coding standards automatically - PSR-12 style, BCMath for money, no dangerous function calls, proper CSP nonce handling.
  </Card>

  <Card title="All plugin types" icon="puzzle">
    Generate gateways, addons, themes, and integrations. Each template covers the full plugin lifecycle: manifest, registration, hooks, and settings UI.
  </Card>

  <Card title="Live documentation" icon="book">
    MCP queries run against the latest docs. When OwnPay adds a new hook or changes an interface, your AI already knows about it.
  </Card>

  <Card title="Works with your tools" icon="code">
    Claude Desktop, Claude Code, Cursor, ChatGPT, VS Code (Cline/Roo Code), and Windsurf - use whichever AI assistant you already prefer.
  </Card>
</CardGroup>

## AI prompt templates

These collapsible prompts are pre-built instructions you can paste into Claude, ChatGPT, or Cursor to generate complete, working plugins. Fill in the bracketed placeholders with your specific details before sending.

<Accordion title="Gateway plugin prompt">
  Copy and paste this into your AI assistant:

  ```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
  You are an expert PHP developer. Build a complete OwnPay gateway plugin.

  Requirements:
  - Implement both OwnPay\Plugin\PluginInterface and OwnPay\Gateway\GatewayAdapterInterface
  - Include manifest.json with type "gateway" and capabilities ["gateway", "webhook_receive", "settings", "database"]
  - Implement initiate(), verify(), verifyWebhook(), refund() methods
  - Use hash_equals() for all HMAC comparisons in verifyWebhook()
  - Reject webhook timestamps older than 5 minutes
  - All monetary amounts are BCMath strings (for example "150.00")
  - Include fields() method returning credential configuration fields
  - Include supportedCurrencies() method
  - Follow PSR-12 coding style
  - No eval(), exec(), or shell_exec()

  Gateway name: [YOUR GATEWAY NAME]
  Gateway API base URL: [YOUR GATEWAY API URL]

  Read the OwnPay gateway plugin documentation via MCP for the exact interface signatures and return shapes.
  ```
</Accordion>

<Accordion title="Addon plugin prompt">
  Copy and paste this into your AI assistant:

  ```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
  You are an expert PHP developer. Build a complete OwnPay addon plugin.

  Requirements:
  - Implement OwnPay\Plugin\PluginInterface
  - Include manifest.json with type "addon" and capabilities ["addon", "hooks", "http_outbound", "settings"]
  - Register at least one action hook in the register() method using EventManager
  - Include a fields() method for admin settings
  - Access core services from the Container in the boot() method
  - All monetary amounts use BCMath strings
  - Follow PSR-12 coding style
  - No eval(), exec(), or shell_exec()

  Addon purpose: [DESCRIBE WHAT YOUR ADDON DOES]

  Read the OwnPay addon plugin documentation via MCP for the exact PluginInterface methods and hook registration patterns.
  ```
</Accordion>

<Accordion title="Theme plugin prompt">
  Copy and paste this into your AI assistant:

  ```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
  You are an expert PHP and Twig developer. Build a complete OwnPay checkout theme plugin.

  Requirements:
  - Implement OwnPay\Plugin\PluginInterface
  - Include manifest.json with type "theme" and capabilities ["theme", "assets"]
  - Use addFilter on checkout.template to point to your Twig templates
  - Use addAction on checkout.head to inject CSS (include CSP nonce)
  - Use addAction on checkout.footer to inject JS (include CSP nonce)
  - Provide Twig templates for checkout page and status/result page
  - Use {{ variable|e }} for escaping user data in Twig
  - Include a fields() method for theme customization settings (primary color, etc.)
  - Follow PSR-12 coding style

  Read the OwnPay theme plugin documentation via MCP for the exact Twig variables available and hook signatures.
  ```
</Accordion>

<Accordion title="Integration plugin prompt">
  Copy and paste this into your AI assistant:

  ```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
  You are an expert PHP developer. Build a complete OwnPay integration plugin.

  Requirements:
  - Implement OwnPay\Plugin\PluginInterface
  - Include manifest.json with type "integration" and capabilities ["addon", "hooks", "http_outbound", "settings"]
  - Register action hooks for payment.transaction.completed and refund.issued
  - Make outbound HTTP calls (curl) with a 5-second timeout
  - Read configuration from SettingsRepository in the Container
  - Include a fields() method for external API key/URL configuration
  - Never throw from hook callbacks - log errors instead
  - All monetary amounts are BCMath strings
  - Follow PSR-12 coding style

  Integration target: [for example, Slack, HubSpot, QuickBooks]

  Read the OwnPay integration plugin documentation via MCP for the exact hook names and Container service access patterns.
  ```
</Accordion>

## Supported AI tools

<CardGroup cols={2}>
  <Card title="Cursor" icon="code">
    Add the MCP server in Settings > Features > MCP. Agent mode calls it automatically.
  </Card>

  <Card title="Claude Desktop & Claude Code" icon="message">
    Add to claude\_desktop\_config.json or run claude mcp add.
  </Card>

  <Card title="VS Code (Cline / Roo Code)" icon="braces">
    Add the MCP server URL in your extension MCP settings.
  </Card>

  <Card title="Windsurf" icon="wind">
    Add to \~/.codeium/windsurf/mcp\_config.json.
  </Card>
</CardGroup>

## Related pages

* [MCP server](/docs/developer/ai/mcp) - setup and configuration guide
* [AI Skills](/docs/developer/ai/skills) - install and use pre-built skills
* [Developer quickstart](/docs/developer/quickstart) - API integration without AI
* [Plugin system overview](/docs/developer/plugins/overview) - understand hooks, manifest, and lifecycle


## Related topics

- [OwnPay MCP Server - Connect AI Tools to Live Documentation](/docs/developer/ai/mcp.md)
- [OwnPay Skills for AI Agents - Platform Knowledge Pack](/docs/developer/ai/skills.md)
- [Developer Hub](/docs/security/developer-hub.md)
- [API Keys](/docs/security/api-keys.md)
- [Audit Log](/docs/reports/audit-log.md)
