AI Agents. Native to PHP.
One Composer package gives any PHP app an AI agent with tools, memory and input guards. Switch between Anthropic, OpenAI, Gemini and OpenAI-compatible providers with an environment variable.
Quickstart
Section titled “Quickstart”Install the core package. No framework is required:
composer require phpclaw/phpclawSet one API key, such as ANTHROPIC_API_KEY or OPENAI_API_KEY, then give the agent a tool and ask:
use PhpClaw\Claw;use PhpClaw\Tools\DatabaseQueryTool;
$agent = Claw::builder() ->tools([new DatabaseQueryTool($pdo)]) ->build();
echo $agent->send('How many orders came in today?')->text;The database tool accepts only read-only queries. Without a tool, the agent can answer only from what the model already knows.
Using Laravel, Symfony, WordPress or another platform? Each adapter wires phpClaw into it. See Getting Started.
Explore the docs
Section titled “Explore the docs” Getting Started Install, set a provider, add tools, and send your first message.
Adapters Adapters for Laravel, Symfony, WordPress, Drupal, Magento, Joomla, PrestaShop and OpenCart.
Providers Anthropic, OpenAI, Groq, Gemini, Mistral, DeepSeek, local Ollama, or a custom OpenAI-compatible endpoint.
MCP Serve your phpClaw tools to MCP clients over stdio or HTTP.
Security Eight input guards, a shell allowlist, SSRF checks, a file sandbox and read-only SQL, and what they do not cover.