A real agent, not a wrapper
phpClaw runs a reason-act-observe loop: the model decides a step, calls a tool, reads the actual result, and continues until the task is done. You get answers grounded in your real data, not guesses.
Capabilities
phpClaw is not a thin LLM wrapper. It is a complete agent engine: tool-calling, memory, security, streaming, and framework integration, all in one self-hosted package. Here is exactly what it does.
phpClaw runs a reason-act-observe loop: the model decides a step, calls a tool, reads the actual result, and continues until the task is done. You get answers grounded in your real data, not guesses.
CodeSearch, FileRead and ProjectInfo are on by default in every adapter (on Drupal, in Drush and the agent service, not the chat page). Shell (allowlisted), HTTP, FileWrite, FileEdit, DatabaseQuery (read-only SQL) and ZipPackager ship in the core and are opt-in, except where an adapter adds them by default: ZipPackager on WordPress and Joomla, Shell and HTTP on Magento and in the Drupal Drush and agent service. In plain PHP, Claw::builder() registers no tools until you pass them to tools(), except load_skill, which is added when you register a skill. Add your own by implementing one interface. CMS adapters add native tools on top; Laravel and Symfony native tools are opt-in.
Anthropic, OpenAI, Groq, Gemini, Mistral, DeepSeek, and local Ollama are first-class, plus a Custom option for any OpenAI-compatible endpoint. Set one key; switch providers without changing application code.
Eight guards run by default: prompt injection, code injection, destructive SQL, role-switching, homoglyph, unicode, message-length, and PII detection. A rate-limit guard is available opt-in. Unsafe input is blocked before it ever reaches the LLM.
Pluggable memory drivers (file, array, Redis, namespace router, and framework-native stores) keep conversation history and state. Multi-turn conversations remember what came before, and each new message is matched against stored memory so the top three hits are added to the prompt.
Expose any phpClaw app as a Model Context Protocol server, over stdio or Streamable HTTP, so Claude Code, Cursor, or Claude Desktop can call your tools directly.
Stream the answer as it is generated when the agent has no tools; with tools, or with durable runs on, the finished answer is delivered in chunks. Or collect the full response with per-run metrics: provider, model, iterations, duration, and token counts.
Laravel, Symfony, WordPress, Drupal, Joomla, PrestaShop, OpenCart, and Magento each get an adapter that feels built-in: native CLI commands, the framework database layer for memory, and idiomatic config.
Fifty-four lifecycle events fire across the agent, tools, providers, memory, conversations, guards and graphs, so you can hook logging, metrics, or custom behavior into every step of a run.
In practice
Ask "how many orders came in today?" and the agent reasons about your request, runs a safe read-only query with the Database tool (on by default in the CMS adapters, opt-in elsewhere), reads the real result, and replies in plain language. No prompt engineering, no training data, no separate service. Just your app, your data, and one API key.
MIT licensed. Runs locally with Ollama at zero cost.