PHPackages                             ai2web/ai2web - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. ai2web/ai2web

ActiveLibrary

ai2web/ai2web
=============

AI2Web (ai2w) PHP SDK - capability model, manifest builder, validator, negotiation, server handler.

v0.4.2(1mo ago)14↓75%MITPHPPHP &gt;=8.1CI passing

Since Jul 11Pushed 1mo agoCompare

[ Source](https://github.com/ai2web-foundation/ai2web-php)[ Packagist](https://packagist.org/packages/ai2web/ai2web)[ Docs](https://ai2web.dev)[ RSS](/packages/ai2web-ai2web/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (5)DependenciesVersions (6)Used By (0)

 [   ![AI2Web](https://raw.githubusercontent.com/ai2web-foundation/.github/main/profile/ai2web-logo-black.svg)  ](https://ai2web.dev)

AI2Web PHP SDK (`ai2web/ai2web`)
================================

[](#ai2web-php-sdk-ai2webai2web)

[![AI2Web on Launchpadly - Product of the Week (Gold)](https://camo.githubusercontent.com/9b208dce82e16834b784fe03fb4da7a2d6fd00cee38c66f15f4de0f8e76b2135/68747470733a2f2f6c61756e63687061646c792e636f2f656d6265642f6261646765732f737461727475702f6169327765622e7376673f76617269616e743d70726f647563742d7765656b2d676f6c64)](https://launchpadly.co/startup/ai2web?ref=badge)

[![CI](https://github.com/ai2web-foundation/ai2web-php/actions/workflows/ci.yml/badge.svg)](https://github.com/ai2web-foundation/ai2web-php/actions/workflows/ci.yml)[![Packagist Version](https://camo.githubusercontent.com/0c8d2f47a04b14ca27c7a6b98a88e361d796c5718b13d7bc46a37846fd255246/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6169327765622f616932776562)](https://packagist.org/packages/ai2web/ai2web)[![PHP Version](https://camo.githubusercontent.com/ae44c12c029b27ff5e2d59828685903fe7142d4ba8ffceac237fe6a925538ddb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6169327765622f616932776562)](https://packagist.org/packages/ai2web/ai2web)

The PHP reference implementation of the [AI2Web protocol](https://github.com/ai2web-foundation/ai2web-spec) - for Laravel, Symfony, or plain PHP. Mirrors `@ai2web/core`.

```
composer require ai2web/ai2web
```

```
use Ai2Web\Manifest;
use Ai2Web\Validator;
use Ai2Web\Server;

$manifest = Manifest::forSite('Example Store', 'https://example.com', 'ecommerce')
    ->capability('content')
    ->capability('commerce', ['endpoint' => '/ai2w/products', 'checkout' => true])
    ->transports(['mcp' => ['enabled' => true, 'endpoint' => '/ai2w/mcp'], 'rest' => ['enabled' => true]])
    ->auth(['methods' => ['none', 'oauth2'], 'oauth2' => ['pkce' => true, 'scopes' => ['checkout']]])
    ->consent(['requires_user_approval_for' => ['purchase']])
    ->contact(['support' => 'help@example.com'])
    ->build();

$result = Validator::validate($manifest);   // ['score' => 90+, 'tier' => 'Standard', ...]

// Serve every AI2Web route from one call:
$res = Server::handle(['manifest' => $manifest], $_SERVER['REQUEST_METHOD'], parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH));
http_response_code($res['status']);
foreach ($res['headers'] as $k => $v) { header("$k: $v"); }
echo json_encode($res['body']);
```

Classes
-------

[](#classes)

- `Ai2Web\Manifest` - fluent capability-model builder (with the v0.2 modules: governance, usage policy, legal, knowledge, agent identity).
- `Ai2Web\Validator` - validation + AI Readiness scoring (spec §9/§11).
- `Ai2Web\Negotiator` - capability negotiation (spec §5).
- `Ai2Web\Server` - framework-agnostic route handler (serves `/ai2w`, actions, and the `/llms.txt` + `/.well-known/agent.json` projections).
- `Ai2Web\Export` - `toLlmsTxt()` / `toAgentJson()` projections of the manifest (RFC-0015).
- `Ai2Web\Schema` - JSON Schema input validation.
- `Ai2Web\Safety` - `isSafePublicUrl()` / `assertSafePublicUrl()` / `sameOrigin()` SSRF guard.

Test
----

[](#test)

```
php tests/run.php
```

Licence
-------

[](#licence)

MIT.

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance92

Actively maintained with recent releases

Popularity5

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity36

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~3 days

Total

5

Last Release

39d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/15687887?v=4)[rolandfarkas](/maintainers/rolandfarkas)[@RolandFarkas](https://github.com/RolandFarkas)

---

Top Contributors

[![rolandfarkasCOM](https://avatars.githubusercontent.com/u/39647138?v=4)](https://github.com/rolandfarkasCOM "rolandfarkasCOM (10 commits)")

---

Tags

acpagentic-commerceaiap2phpsdkmcpaiprotocolagentsmanifestai2webai2wagentic-web

### Embed Badge

![Health badge](/badges/ai2web-ai2web/health.svg)

```
[![Health](https://phpackages.com/badges/ai2web-ai2web/health.svg)](https://phpackages.com/packages/ai2web-ai2web)
```

###  Alternatives

[wordpress/mcp-adapter

Adapter for Abilities API, letting WordPress abilities to be used as MCP tools, resources or prompts

887389.6k13](/packages/wordpress-mcp-adapter)[php-mcp/laravel

Laravel SDK for building Model Context Protocol (MCP) servers - Seamlessly integrate MCP tools, resources, and prompts into Laravel applications

476214.2k4](/packages/php-mcp-laravel)[mischasigtermans/laravel-toon

Token-Optimized Object Notation encoder/decoder for Laravel with intelligent nested object handling

14657.4k](/packages/mischasigtermans-laravel-toon)[mischasigtermans/laravel-altitude

Claude Code agents for the TALL stack, powered by Laravel Boost

12222.7k](/packages/mischasigtermans-laravel-altitude)[koriym/xdebug-mcp

Universal PHP Xdebug MCP Server with AI-optimized debugging support

5938.1k1](/packages/koriym-xdebug-mcp)[klapaudius/symfony-mcp-server

Build your own LLM tools inside your symfony project by adding to it a Model Context Protocol Server

3227.1k](/packages/klapaudius-symfony-mcp-server)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
