# Taphra > Full-stack PHP for the agent era: a framework for PHP 8.2 and later with routing, controllers and views, DataStores for SQL databases, auth, queues, email, localisation, billing, AI providers, an agent loop and an MCP server, in one Composer package. Version 1.1.0, MIT licence. Start a project with `composer create-project taphra/skeleton my-app` (or `taphra/api-starter`, `taphra/ai-chat`, `taphra/mcp-server`). Each starter has an `AGENTS.md` with the app's layout, commands and safety rules. Taphra is not Laravel or Symfony: do not assume their APIs. In an app, the installed framework source is in `vendor/taphra/taphra/` (the core in `taphra/src/`, the packages in `packages//src/`), and it is short enough to read. ## Documentation - [Taphra documentation](https://taphra.dev/docs/): These guides cover Taphra 1.x for PHP 8.2 and later, in the order you are likely to need them. Each page covers one topic and links to the others where they... ## Overview - [Taphra](https://taphra.dev/docs/introduction/): Full-stack PHP for the agent era. AI and MCP included. ## Start here - [Getting started](https://taphra.dev/docs/getting-started/): This page takes you from an empty folder to a running Taphra app with one HTML page and one JSON endpoint. You need PHP and Composer; a database is optional... - [Configuration and environments](https://taphra.dev/docs/configuration/): Taphra reads its settings from YAML files in app/Config/ and picks the environment (development, staging or production) from the APP_ENV environment... ## Building an app - [Routing and controllers](https://taphra.dev/docs/routing/): This page covers how a URL reaches a controller action: the /controller/action convention, routes declared in app/Config/routes.yml, named routes, route... - [Views and helpers](https://taphra.dev/docs/views/): Views are plain PHP templates. This page covers views, layouts, elements and blocks, how output is escaped, the global template helpers, the HTML and form... - [Requests and validation](https://taphra.dev/docs/requests/): This page covers reading request input with Taphra\Request, JSON bodies, uploaded files, the validator, and the two ways to validate in a controller... - [REST APIs](https://taphra.dev/docs/rest-apis/): This page covers JSON APIs: RestController and its response helpers, routes bound to HTTP methods, request bodies through a FormRequest, output shaped by an... ## Data - [Database](https://taphra.dev/docs/database/): This page covers connections, migrations, seeders and factories, transactions and raw SQL. Reading and writing rows is in DataStores; building SQL by hand... - [DataStores](https://taphra.dev/docs/datastores/): A DataStore is a class for one database table. It reads and writes rows, builds queries, applies casts, mass-assignment rules, timestamps and soft deletes... - [SqlQuery](https://taphra.dev/docs/sqlquery/): SqlQuery builds one SQL statement: SELECT (with joins, grouping, sub-queries, CTEs, set operations and window functions), INSERT, UPDATE, DELETE or an... ## Security - [Authentication](https://taphra.dev/docs/authentication/): This page covers who the user is: the Auth facade and its drivers, passwords, logging in with a session, protecting pages and API routes, remember-me... - [Security](https://taphra.dev/docs/security/): This page lists what Taphra protects by default, what each default does, and what you still set up yourself, then ends with a checklist for production.... ## AI - [AI](https://taphra.dev/docs/ai/): Taphra's AI layer talks to Anthropic, OpenAI, OpenAI-compatible servers and Ollama through one interface: completions, token streaming, structured output... - [MCP server](https://taphra.dev/docs/mcp/): The Model Context Protocol (MCP) lets an AI client such as a desktop app, an IDE or an agent call into your application. Taphra serves methods of your... - [AI builder](https://taphra.dev/docs/ai-builder/): php taphra ai:build turns a description in plain English into files in your app: it plans them, then writes them with your approval. Every file change... ## Application services - [Queues](https://taphra.dev/docs/queues/): A queue moves slow work out of the request: the request pushes a job and answers at once, and a worker process (php taphra queue:work) runs the job in the... - [Cache](https://taphra.dev/docs/cache/): Taphra\Cache\Cache stores values between requests: results you compute, query results, and whole page output. It runs on files by default and on APCu... - [Events](https://taphra.dev/docs/events/): Taphra\Event is an in-process event bus: one part of the app announces that something happened, other parts react to it. Listeners run synchronously, inside... - [Scheduler](https://taphra.dev/docs/scheduler/): The scheduler runs recurring tasks (a nightly cleanup, an hourly sync, a daily report) from one cron entry. You list the tasks in app/Console/Kernel.php... - [Email](https://taphra.dev/docs/email/): Taphra\Email builds and sends messages through PHPMailer: SMTP, sendmail, qmail or PHP's mail(). Bodies are plain text or HTML with {{ name }} placeholders... - [Localisation](https://taphra.dev/docs/localisation/): Taphra translates messages from YAML catalogs in app/Translations/, with ICU plural and select rules, and formats numbers for the active locale. The engine... - [Billing](https://taphra.dev/docs/billing/): Taphra\Billing creates customers and subscriptions, takes one-time charges and refunds, lists payment methods, opens hosted checkout and billing portal... ## Architecture - [Service container and providers](https://taphra.dev/docs/container/): Taphra ships a small PSR-11 container, Taphra\Container\Container, and a two-phase ServiceProvider base class for wiring your own services. This page covers... - [Logging and debugging](https://taphra.dev/docs/logging/): This page covers where Taphra writes its logs, how to write your own lines, the request ID that ties the lines of one request together, the request log... ## Testing and operations - [Testing](https://taphra.dev/docs/testing/): This page sets up PHPUnit in an application, tests routes in-process with Taphra\Testing\HttpTestCase, gives the tests their own database, logs users in... - [Command line](https://taphra.dev/docs/cli/): Every Taphra app has a taphra script at its root. It is a Symfony Console application: php taphra list shows the commands, php taphra help shows a... - [Deployment](https://taphra.dev/docs/deployment/): This page takes a Taphra app to a production server: the web server and its document root, the environment, the steps to run on every deploy, OPcache... - [Upgrading](https://taphra.dev/docs/upgrading/): This page explains how Taphra versions change, where the upgrade notes for each release live, and what to change in an app that was built on a pre-release... ## Tutorials - [Tutorial 1: Hello World](https://taphra.dev/docs/tutorials/01-hello-world/): A Taphra page and a JSON endpoint, running on your machine in a few minutes. - [Tutorial 2: REST API](https://taphra.dev/docs/tutorials/02-rest-api/): A JSON API for blog posts, on SQLite: list, read, create, update and delete,with validation, proper status codes, and a token for the writes. - [Tutorial 3: AI Chatbot](https://taphra.dev/docs/tutorials/03-ai-chatbot/): A chat page whose replies stream in from an AI model as they are written,with each visitor's conversation kept between messages. - [Tutorial 4: MCP Server](https://taphra.dev/docs/tutorials/04-mcp-server/): Give desktop AI apps, IDEs and other MCP clients access to your app through the ModelContext Protocol: tools they can call, a resource they can read and a... - [Tutorial 5: Agent with Tools](https://taphra.dev/docs/tutorials/05-agent-with-tools/): An agent is a model that can call your PHP code. You describe tools (a name,a description and a JSON Schema for the input); the model decides which tocall... ## Reference - [How Taphra compares](https://taphra.dev/docs/framework-comparison/): This page is for choosing a framework. It compares Taphra 1.1 with the PHP frameworks you are most likely to weigh it against, says where each of them is... - [Changelog](https://taphra.dev/docs/changelog/): All notable changes to Taphra are documented in this file. - [taphra/db](https://taphra.dev/docs/packages/db/): The database layer of the Taphra framework, usable on its own. It gives you: - [taphra/validator](https://taphra.dev/docs/packages/validator/): Input validator for PHP with string rules such as required|email|max:255. One class, no Composer dependencies; it needs only the mbstring extension. - [taphra/container](https://taphra.dev/docs/packages/container/): PSR-11 service container and ServiceProvider base class for Taphra. - [taphra/crypt](https://taphra.dev/docs/packages/crypt/): Authenticated encryption for PHP with libsodium secretbox (XSalsa20-Poly1305). One class, no Composer dependencies; it needs only the sodium extension... - [taphra/l10n](https://taphra.dev/docs/packages/l10n/): Localisation for PHP. Messages are named by dot-notation keys or by their source text (gettext style). ICU MessageFormat (plural, select, number) is... - [taphra/ai](https://taphra.dev/docs/packages/ai/): AI layer for PHP: one interface over Anthropic, OpenAI, Ollama and OpenAI-compatible servers, with streaming, conversations, embeddings, structured output... - [taphra/billing](https://taphra.dev/docs/packages/billing/): Provider-agnostic billing layer for PHP, built for the Taphra framework and usable without it. Version 1 ships with a Stripe provider and a null provider... ## Optional - [All guides in one file](https://taphra.dev/llms-full.txt): the Markdown of every page above - [Why Taphra](https://taphra.dev/why/): why Taphra works well when coding agents write the code - [Benchmarks](https://taphra.dev/benchmarks/): requests per second against other PHP frameworks, with the method - [Source](https://github.com/taphra/taphra)