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.
Shell (allowlisted), HTTP, FileRead, FileWrite, FileEdit, CodeSearch, and ProjectInfo ship in the core and register automatically. DatabaseQuery (read-only SQL) and ZipPackager are opt-in. Add your own by implementing one interface. Framework adapters register extra native tools on top.
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.
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 output as it is generated for responsive chat interfaces, 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.
Forty lifecycle events fire across the agent, tools, providers, memory, conversations, and guards, 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, 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.