Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
a03bf40
Rebuild the 2.x package skeleton: metadata, MIT license and test harness
ajibarra Oct 15, 2026
395a9a3
Add McpConfig defaults, McpLogger and default cache configs
ajibarra Oct 15, 2026
3fa1d36
Add an autowiring PSR-11 bridge over Cake's container
ajibarra Oct 15, 2026
49b5cda
Add CurrentIdentity and the identity-to-AccessToken middleware
ajibarra Oct 15, 2026
e5d85e2
Enforce per-tool authorization: call guard, list filter and PSR-14 di…
ajibarra Oct 15, 2026
41c7236
Add RbacToolAuthorizer on top of cakedc/auth Rbac
ajibarra Oct 15, 2026
0a6d827
Add ServerFactory: discovery, cache-backed sessions, container bridge…
ajibarra Oct 15, 2026
c7c731e
Serve MCP over Streamable HTTP at a Cake route
ajibarra Oct 15, 2026
978dea0
Assert the failing tool was reached in the leak test
ajibarra Oct 15, 2026
4f5d580
Add the mcp server stdio command
ajibarra Oct 15, 2026
52740fe
Add CI workflow, README, docs and changelog for 2.0.0-beta1
ajibarra Oct 15, 2026
70d46cc
Document the temporary mcp/sdk pin for host installs
ajibarra Oct 15, 2026
8c8d743
Keep info logs off STDOUT in the stdio server command
ajibarra Oct 15, 2026
bfbb11a
Add a front controller for manual testing of the test app
ajibarra Oct 15, 2026
557a7d8
Do not call a parent constructor Cake 5.0 Command lacks
ajibarra Oct 15, 2026
9ab9fa9
Log exception details and unused context from the SDK
ajibarra Oct 15, 2026
8836b17
Keep authentication on unless identity.required is explicitly false
ajibarra Oct 15, 2026
115913d
Fix documentation inaccuracies from the final review
ajibarra Oct 15, 2026
208ef33
Document tool annotations and check they reach tools/list
ajibarra Oct 15, 2026
1a13fdc
Add ToolError::invalid() to send Cake validation errors to the model
ajibarra Oct 15, 2026
0ce6b2c
Add McpTestTrait to test an application's tools in memory
ajibarra Oct 15, 2026
e9d9741
Add Mcp.server.configure to customize the SDK builder
ajibarra Oct 15, 2026
bce6eb6
Run the official MCP conformance suite against the plugin endpoint
ajibarra Oct 15, 2026
5f7214d
Add bin/cake mcp inspector to open the MCP Inspector on the server
ajibarra Oct 15, 2026
e9d4948
McpTestTrait: load routes, show the server log on failure, check tool…
ajibarra Oct 15, 2026
cc009a9
Keep field names of flat error arrays, add server title, description …
ajibarra Oct 15, 2026
b6b58cd
Inspector command: delete the config on Ctrl+C, support Windows, pass…
ajibarra Oct 15, 2026
d46e3eb
Conformance script: wait for php-fpm, clean files it created, match t…
ajibarra Oct 15, 2026
476d30a
Inspector command: poll the process so SIGTERM is passed on, warn wit…
ajibarra Oct 15, 2026
981124d
Run the test suite with the oauth plugin and a SQLite database
ajibarra Oct 16, 2026
aa060eb
Add the Mcp.auth settings
ajibarra Oct 16, 2026
57fb75d
Reject non-array and null Mcp.auth values
ajibarra Oct 16, 2026
86391d0
Validate MCP access tokens with the oauth plugin of the same app
ajibarra Oct 16, 2026
0231683
Protect the MCP endpoint with OAuth tokens and serve its resource met…
ajibarra Oct 16, 2026
f90810e
Accept JWT access tokens from an external authorization server
ajibarra Oct 16, 2026
ed4efd0
Keep token claims out of the top level of the external identity
ajibarra Oct 16, 2026
f0cb972
Let McpTestTrait act with scopes and check insufficient_scope
ajibarra Oct 16, 2026
852031d
Add bin/cake mcp check
ajibarra Oct 16, 2026
09117ab
mcp check: report external audiences and verify the metadata route
ajibarra Oct 16, 2026
e9108bf
mcp check: test the unconnected metadata route, reset test state
ajibarra Oct 16, 2026
0bcdfc3
Test the whole OAuth flow of a remote MCP client
ajibarra Oct 16, 2026
f595602
Document OAuth for the MCP endpoint
ajibarra Oct 16, 2026
7fdb9c5
Fix the external identity example in the OAuth docs
ajibarra Oct 16, 2026
eb233aa
Tidy the external identity example in the OAuth docs
ajibarra Oct 16, 2026
fa94299
Fix the OAuth review findings in code and tests
ajibarra Oct 16, 2026
306e015
Update the OAuth docs, changelog and CI for the review findings
ajibarra Oct 16, 2026
d880037
Require mcp/sdk ^0.9 now that 0.9.0 is released
ajibarra Oct 19, 2026
df31f53
Bound the request body with Mcp.http.maxBodyBytes and answer 413 befo…
ajibarra Oct 19, 2026
3adce38
Run the newest alpha of the conformance suite
ajibarra Oct 19, 2026
2a1830e
Merge pull request #1 from CakeDC/feature/2.1-oauth
steinkel Oct 29, 2026
8ee3d85
Prepare 2.0.0
ajibarra Nov 7, 2026
dd4a4b1
Audit log of MCP calls, keep the 403 of a missing scope, rate limitin…
ajibarra Nov 7, 2026
7a39340
Fix the rate limit example test on CakePHP before 5.3, and the loggin…
ajibarra Nov 7, 2026
158c3e3
mcp check: tools, authorizer, tool scopes and logging
ajibarra Nov 7, 2026
911d801
mcp check: no SDK info lines in the output
ajibarra Nov 7, 2026
7359994
Docs: generic tool name in the audit log example
ajibarra Nov 7, 2026
9afe08a
#44492 Require CakePHP 4.5+, PHPUnit 9 and the CakePHP 4 versions of …
Nov 19, 2026
968ebff
#44492 Remove the OAuth and external token modes, which need CakePHP …
Nov 19, 2026
3a5e8f3
#44492 Port src to CakePHP 4: PSR-17 factories from laminas-diactoros…
Nov 19, 2026
a109733
#44492 Port the test suite to PHPUnit 9 and the test app to CakePHP 4…
Nov 19, 2026
d5bdfc6
#44492 Require psr/log 2 or 3: the typed PSR-3 loggers do not fit psr…
Nov 19, 2026
a3fff9e
#44492 Docs for the 1.x line: CakePHP 4.5+, require ^1.1, Authenticat…
Nov 19, 2026
9d441bf
#44492 Merge 1.next-cake4: the CakePHP 4 port replaces the prototype,…
Nov 19, 2026
d8b5949
#44492 CI and docs on PHP 8.2 and 8.3, since CakePHP 4 needs laminas-…
Nov 19, 2026
5ab17a1
#44492 Drop minimum-stability dev and prefer-stable, and restrict PHP…
Nov 19, 2026
d467ae2
#44492 Date the 1.1.0 changelog entry
Nov 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Kept out of the archives Composer installs.
/.github export-ignore
/tests export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/phpcs.xml export-ignore
/phpstan.neon export-ignore
/phpunit.xml.dist export-ignore
76 changes: 76 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: CI

on:
push:
branches: ['1.next-cake4']
pull_request:

permissions:
contents: read

jobs:
testsuite:
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
php-version: ['8.2', '8.3']
dependencies: ['highest']
include:
- php-version: '8.2'
dependencies: 'lowest'
name: PHP ${{ matrix.php-version }} (${{ matrix.dependencies }})
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
with:
path: cakephp-mcp
- uses: shivammathur/setup-php@eb7c497e18156a6bbabfef1d3a82760b9eda3962 # 2.40.0
with:
php-version: ${{ matrix.php-version }}
extensions: mbstring, intl, pdo_sqlite, openssl
coverage: none
- uses: ramsey/composer-install@a8d0d959dab41457692a5e2041bd9b757a119e3f # 3.2.1
with:
dependency-versions: ${{ matrix.dependencies }}
working-directory: cakephp-mcp
- run: vendor/bin/phpunit
working-directory: cakephp-mcp

cs-stan:
runs-on: ubuntu-24.04
name: Coding standard and static analysis
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
with:
path: cakephp-mcp
- uses: shivammathur/setup-php@eb7c497e18156a6bbabfef1d3a82760b9eda3962 # 2.40.0
with:
php-version: '8.3'
coverage: none
- uses: ramsey/composer-install@a8d0d959dab41457692a5e2041bd9b757a119e3f # 3.2.1
with:
working-directory: cakephp-mcp
- run: vendor/bin/phpcs
working-directory: cakephp-mcp
- run: vendor/bin/phpstan analyse --no-progress
working-directory: cakephp-mcp

conformance:
runs-on: ubuntu-24.04
name: MCP conformance
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
with:
path: cakephp-mcp
- uses: shivammathur/setup-php@eb7c497e18156a6bbabfef1d3a82760b9eda3962 # 2.40.0
with:
php-version: '8.3'
coverage: none
- uses: ramsey/composer-install@a8d0d959dab41457692a5e2041bd9b757a119e3f # 3.2.1
with:
working-directory: cakephp-mcp
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: '22'
- run: tests/Conformance/run.sh
working-directory: cakephp-mcp
10 changes: 7 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
.idea
vendor
composer.lock
/vendor/
/composer.lock
/.phpunit.cache/
/tests/test_app/tmp/
.phpunit.result.cache
/tests/Conformance/tmp/
/tests/Conformance/results/
80 changes: 80 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# Changelog

## 1.1.0 (2026-11-19)

Port of 2.1.1 to CakePHP 4.5+, replacing the 1.x prototype. Require `^1.1`: version 1.0.0 on Packagist is the
CakePHP 5 code of 2.0.0, tagged by mistake.

- Everything in 2.1.1 except OAuth 2.1: the endpoint for both protocol eras, stdio, tool discovery with constructor injection, `CurrentIdentity`, per-tool authorization and `RbacToolAuthorizer`, the audit log, `bin/cake mcp check`, `bin/cake mcp inspector`, `McpTestTrait` and `ToolError::invalid()`.
- Only `host` mode: the identity set by your authentication (`cakephp/authentication` 2.x) becomes the SDK access token. Any other `Mcp.auth.mode` (`oauth` and `external` are 2.x only) stops the application at bootstrap with the reason.
- Not ported: the protected resource metadata route and its `401` challenge, the scope policy (`Mcp.auth.scopes`, `403 insufficient_scope`), `McpTestTrait::assertMcpInsufficientScope()` and the rate limiting example (CakePHP 4 has no `RateLimitMiddleware`). `mcpActingAs()` still takes scopes and claims, which never refuse a call.
- The SDK gets the PSR-17 factories of `laminas/laminas-diactoros`, which CakePHP 4 already requires.
- `bin/cake mcp check` follows the CakePHP 4 log scopes: the skeleton's `debug` and `error` engines have `'scopes' => false` and take only messages without a scope.
- Requires `mcp/sdk` ^0.9 and `psr/log` ^2.0 or ^3.0.
- Tests on PHPUnit 9; phpcs and PHPStan level 8; the official MCP conformance suite passes for both protocol revisions.
- PHP 8.2 and 8.3: CakePHP 4 needs `laminas/laminas-diactoros` 2.x, which does not install on PHP 8.4.

The entries below 1.1.0 are the history of the 2.x line (CakePHP 5), kept for reference: their OAuth features are not in 1.x.

## 2.1.1 (2026-11-07)

- `bin/cake mcp check` lists the tools the server offers and warns when there is none.
- `bin/cake mcp check` checks the authorizer: with `RbacToolAuthorizer`, it warns when there are no rules, or none for plugin `CakeDC/Mcp` and controller `Tools`, because then no one can call a tool.
- `bin/cake mcp check` warns, in `oauth` and `external` modes, about tools that need no scope and about names in `Mcp.auth.scopes.tools` that are not tools.
- `bin/cake mcp check` warns when no Log engine takes the errors of the `mcp` scope (the skeleton's `debug` and `error` engines do not), so a failing tool would leave no trace.
- `bin/cake mcp check` decides whether the audit lines reach a Log engine as `Log::write()` does: an engine of the `mcp` scope, or one given as an object, now counts.
- `bin/cake mcp check` prints only its results: listing the tools no longer writes the SDK's info lines to the console (warnings and errors still go to the `mcp` log).
- Docs: testing the endpoint with `OAuthTestTrait` links to the oauth plugin's note on the migrations the test database needs.

## 2.1.0 (2026-11-07)

- Audit log of MCP calls (`Mcp.audit`), off by default: allowed, denied, failed and refused calls with the identity, client, tool, arguments and duration, to the `mcp_audit` log scope and the `Mcp.audit` event. See the Audit log section of `docs/configuration.md`, which also shows how to store the records in a table.
- `bin/cake mcp check` reports the audit log, and warns when it is on and no Log engine lists the `mcp_audit` scope.
- Fix: a `403 insufficient_scope` reached clients as `401`, because PHP turns any response with a `WWW-Authenticate` header into a 401 when, as in Cake's `ResponseEmitter`, the status line is sent first. The endpoint now keeps the 403 (see the troubleshooting guide).
- Docs: rate limiting the MCP route with CakePHP's `RateLimitMiddleware` (per token, per user or per address).
- Docs: the Logging section said the skeleton's `debug` and `error` engines receive the `mcp` messages; they have `'scopes' => null` and do not.
- Tests: the rate limiting example is skipped on CakePHP before 5.3, which has no `RateLimitMiddleware`.
- Docs: claude.ai custom connectors are now under Customize > Connectors > Add custom connector.

## 2.0.0 (2026-11-07)

Complete rewrite for CakePHP 5 on top of the official `mcp/sdk`, with OAuth 2.1 for remote MCP clients. Version
1.0.0 on Packagist was this same code tagged by mistake: require `^2.0`. The 1.x line (`1.next-cake4`) is the
CakePHP 4 plugin.

### Server

- Remote MCP over Streamable HTTP at a Cake route (`/mcp` by default), serving both protocol eras (handshake with sessions, and the stateless 2026-07-28 revision).
- `bin/cake mcp server` for stdio.
- `bin/cake mcp inspector` opens the MCP Inspector already configured for this server, over stdio or HTTP.
- Tool discovery through `#[McpTool]`, `#[McpResource]` and `#[McpPrompt]` attributes in `src/Mcp/`, with constructor injection from Cake's container (autowired).
- Sessions and the discovery cache stored in Cake cache configs.
- Authentication delegated to the host: the identity set by `cakephp/authentication` becomes the SDK access token and the injectable `CurrentIdentity`.
- Per-tool authorization with `ToolAuthorizerInterface`; `RbacToolAuthorizer` for `cakedc/auth` permission rules.
- `server.title`, `server.description` and `server.websiteUrl` config keys, reported in the server info.
- `Mcp.server.configure` hands the SDK builder to the host for anything the plugin does not configure itself; the plugin's own settings and the authorizer still apply.
- `McpTestTrait` calls the application's tools in memory from a Cake test case, acting as any identity, with assertions for results, tool errors, JSON-RPC errors, denials and `tools/list`.
- `ToolError::invalid()` turns Cake validation errors (an entity or a `Validator` result) into a tool error the model can read and act on.
- Checked against the official MCP conformance suite for both protocol revisions, behind nginx and php-fpm (`tests/Conformance/run.sh`, also in CI).
- DNS-rebinding protection defaults to the `App.fullBaseUrl` host. That only protects when `App.fullBaseUrl` is set explicitly (the Cake 5 skeleton derives it from the request `Host` otherwise); set `Mcp.http.allowedHosts`, which is required for servers with `identity.required` set to `false`.
- Removed `bin/mcp-server` and `CakeDC\Mcp\Server\CakeServer`.
- Requires `mcp/sdk` ^0.9.

### OAuth 2.1 for remote clients

- `Mcp.auth` with three modes: `host` (default, as 2.0), `oauth` (access tokens of `cakedc/cakephp-oauth-server` in the same application) and `external` (JWT access tokens of Auth0, Keycloak, Microsoft Entra ID, WorkOS or any OpenID Connect issuer, through `firebase/php-jwt` and `psr/cache`). The `Mcp.auth` section is validated strictly and fails closed.
- Protected resource metadata (RFC 9728) at `/.well-known/oauth-protected-resource` plus the MCP route, and the `401` challenge that points MCP clients to it.
- Scope policy per method and per tool (`Mcp.auth.scopes`), with `implies` and step-up through `403 insufficient_scope`.
- `McpConfig::isEndpoint()` recognises the MCP route and its metadata path, for the CSRF skip callback and to keep other bearer-token authenticators off them.
- `bin/cake mcp check` inspects the endpoint configuration (authentication, resource, metadata route, allowed hosts, CSRF, authenticators, including the `Auth.Authenticators` of `cakedc/users`) without network calls.
- `McpTestTrait::mcpActingAs()` takes scopes and claims, and `assertMcpInsufficientScope()` asserts a refused call. In `oauth` mode the scopes are expanded with the `implies` of the declared resource, as the authorization server does.
- `McpConfig::rbacPermissions()` returns the `bypassAuth` rule `cakedc/users` hosts need for the endpoint and its metadata.
- oauth mode needs `cakedc/cakephp-oauth-server` 1.0.0 or newer (it brings `cakedc/oauth-server`), CakePHP 5.1.10+ and `cakephp/authentication` 3.3.6+.
- `Mcp.http.maxBodyBytes` (default 4 MiB, the SDK's own limit) bounds the request body. The same value is passed to the SDK transport and to its `AuthorizationMiddleware`.
- A POST over that limit is answered with `413` and a JSON-RPC error (code `-32600`) whose message and `data.maxBodyBytes` name the limit and suggest a smaller payload, before authentication. Before, `oauth` and `external` modes answered it with a `400` Bearer `invalid_request` challenge.
- `bin/cake mcp check` understands a Token authenticator of `cakedc/cakephp-oauth-server` 1.0.0 that protects several resources (`OAuthServer.users.resource` as a list), and passes when one of them is the MCP endpoint at the MCP route.

### Contributors

- Contributors: the PHPUnit suite now runs on SQLite with the oauth packages. It needs the sibling clones `../oauth-server` and `../cakephp-oauth-server` (path repositories); both are public repositories, and CI checks them out at their `1.0.0` tags.
- Contributors: `tests/Conformance/run.sh` (and so CI) runs the newest published alpha of the official conformance suite instead of a pinned version; `CONFORMANCE_PACKAGE` still pins one for a reproducible run.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2025-2026 Cake Development Corporation (https://www.cakedc.com)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
131 changes: 124 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,130 @@
# MCP Server for CakePHP
# CakePHP MCP Server

## Installation
* composer require cakedc/cakephp-mcp
Expose tools, resources and prompts from a CakePHP 4 application to Claude and
any other [Model Context Protocol](https://modelcontextprotocol.io) client.
Built on the official [`mcp/sdk`](https://github.com/modelcontextprotocol/php-sdk).

## Usage
* Select one or many methods in your CakePHP project. Add the attribute to expose the method to the MCP server.
This is the 1.x line, for CakePHP 4.5+. The 2.x line (CakePHP 5) also has
OAuth 2.1 for remote clients; see [Not available in 1.x](#not-available-in-1x).

- Remote MCP over Streamable HTTP, mounted as a regular Cake route (`/mcp`).
- `bin/cake mcp server` for local stdio clients, and `bin/cake mcp inspector` to try the server by hand.
- Tools are plain PHP classes with `#[McpTool]` attributes, with constructor injection.
- Authentication stays in your app (`cakephp/authentication`); the plugin reads the identity.
- `bin/cake mcp check` finds what keeps remote clients from connecting, without network calls.
- Per-tool authorization, including `config/permissions.php` rules through `cakedc/auth`.
- `McpTestTrait` to test your tools, and who may call them, from a regular Cake test case.
- An audit log of MCP calls (`Mcp.audit`, off by default): who called which tool, with which arguments, and how it ended, to a log scope or your own table.

## Requirements

- PHP 8.2 or 8.3 (CakePHP 4 needs `laminas/laminas-diactoros` 2.x, which stops at PHP 8.3)
- CakePHP 4.5+
- `cakephp/authentication` 2.x (or any authentication that sets the `identity` request attribute)

## Install

```bash
composer require cakedc/cakephp-mcp:^1.1
```

It installs `mcp/sdk` ^0.9, the official PHP SDK. Require `^1.1`: version 1.0.0
on Packagist is the CakePHP 5 code of 2.0.0, tagged by mistake.

Load the plugin in `src/Application.php`:

```php
$this->addPlugin('CakeDC/Mcp');
```

Let MCP requests through CSRF protection (in `Application::middleware()`):

```php
$csrf = new CsrfProtectionMiddleware();
$csrf->skipCheckCallback(fn (ServerRequest $request): bool => $request->getPath() === '/mcp');
```

## Your first tool

Create `src/Mcp/ArticleTools.php`:

```php
namespace App\Mcp;

use Cake\ORM\Locator\LocatorAwareTrait;
use Mcp\Capability\Attribute\McpTool;

class ArticleTools
{
use LocatorAwareTrait;

/**
* Lists the titles of the latest articles.
*
* @return list<string>
*/
#[McpTool(name: 'latest_articles')]
public function latest(int $limit = 5): array
{
return $this->fetchTable('Articles')->find()
->select(['title'])
->order(['created' => 'DESC'])
->limit($limit)
->all()
->extract('title')
->toList();
}
}
```
example here

## Authenticate callers

By default `/mcp` requires an identity. Add an authenticator that reads a Bearer
token, for example with `cakephp/authentication`:

```php
$service->loadIdentifier('Authentication.Token', ['tokenField' => 'api_token']);
$service->loadAuthenticator('Authentication.Token', [
'header' => 'Authorization',
'tokenPrefix' => 'Bearer',
]);
```

## Test your MCP server works properly
## Connect Claude

- Claude Code: `claude mcp add --transport http my-app https://example.com/mcp --header "Authorization: Bearer <token>"`
- claude.ai: Customize > Connectors > Add custom connector, with the URL and (where available) a request header.

## Not available in 1.x

The 1.x line is a port of 2.1.1 to CakePHP 4. It leaves out what needs
CakePHP 5 or packages that only exist for it:

- OAuth 2.1 for remote clients: the `oauth` and `external` values of
`Mcp.auth.mode`, the protected resource metadata
(`/.well-known/oauth-protected-resource`) and its `401` challenge, and the
scope policy (`Mcp.auth.scopes`) with `403 insufficient_scope`. Only `host`
mode is available; any other value stops the application at bootstrap.
- `McpTestTrait::assertMcpInsufficientScope()`. `mcpActingAs()` still takes
scopes and claims, which reach the access token but never refuse a call.
- The rate limiting example, since CakePHP 4 has no `RateLimitMiddleware`.

Everything else (the endpoint, stdio, tools, authorization, the audit log,
`mcp check`, `mcp inspector` and `McpTestTrait`) is the same as in 2.1.1.

## Documentation

- [Installation](docs/installation.md)
- [Configuration](docs/configuration.md)
- [Writing tools](docs/tools.md)
- [Authentication](docs/authentication.md)
- [Authorization](docs/authorization.md)
- [Testing your tools](docs/testing.md)
- [stdio](docs/stdio.md)
- [Connecting clients](docs/clients.md)
- [Troubleshooting](docs/troubleshooting.md)
- [Protocol conformance](docs/conformance.md)

## License

MIT. Copyright (c) Cake Development Corporation.
24 changes: 0 additions & 24 deletions bin/mcp-server

This file was deleted.

Loading
Loading