Commit graph

247 commits

Author SHA1 Message Date
Edouard Courty
158e64627f
feat(server): add server lifecycle events (#175)
Signed-off-by: Edouard Courty <edouard.courty2@gmail.com>
2026-02-23 22:40:43 +01:00
Den Delimarsky
04a9a16be2
Add SECURITY.md with GitHub Security Advisories guidance (#250) 2026-02-22 19:20:00 +01:00
Sule-Balogun Olanrewaju
2166b38d56
Add missing handler for resource subscribe and unsubscribe (#220) 2026-02-18 00:11:35 +01:00
Johannes Wachter
02e86377e4
Add elicitation support for server-to-client user input requests (#228)
- Add ElicitAction enum (accept/decline/cancel)
- Add schema definitions for elicitation fields (string, number, boolean, enum)
- Add ElicitationSchema wrapper for requestedSchema
- Add ElicitRequest and ElicitResult for elicitation/create method
- Update ClientCapabilities to support elicitation capability
- Add elicit() method to ClientGateway
- Store client capabilities in session during initialization
- Add comprehensive unit tests
- Add elicitation example server with book_restaurant, confirm_action, and collect_feedback tools
2026-02-15 23:34:19 +01:00
Sule-Balogun Olanrewaju
aafac3ddf5
Feat: Improve invalid resource template messages (#245) 2026-02-13 21:46:03 +01:00
Alexis Lefebvre
0b1d0380c9
feat: test Symfony 8 (#243) 2026-02-13 18:03:43 +01:00
Alexis Lefebvre
6e97aafb9c
feat: improve invalid resource messages (#242) 2026-02-13 18:02:43 +01:00
Volodymyr Panivko
8f8af90007
Fix Invalid data in Session (#241)
Signed-off-by: Volodymyr Panivko <sveneld300@gmail.com>
2026-02-11 20:35:41 +01:00
Volodymyr Panivko
43e7a39a21
Add Middleware handlers to StreamableHttpTransport (#218) 2026-02-11 20:33:31 +01:00
Ridwan Kasim
f3ecb2ebd8
[Server] Fix HTTP Transport Header Compliance (#227)
* fix: added the Allow header for bad method status code

* fix code style

---------

Co-authored-by: Tobias Nyholm <tobias.nyholm@gmail.com>
2026-02-08 15:58:13 +01:00
Christopher Hertel
c19d550c27
[Server] Shift away session decode from constructor (#238)
* Shift away session decode from constructor

* add a small test

---------

Co-authored-by: Tobias Nyholm <tobias.nyholm@gmail.com>
2026-02-08 15:49:14 +01:00
Christopher Hertel
6503059a4b
Throw package specific exceptions in CallbackStream (#233) 2026-02-08 15:42:10 +01:00
Christopher Hertel
9621039e54
Rename Psr16StoreSession to Psr16SessionStore for consistency (#236) 2026-02-08 15:31:19 +01:00
Christopher Hertel
77d6433e4b
Extend gitattributes for latest additions on root level (#237) 2026-02-08 15:30:29 +01:00
Jonathan Hefner
940eb90872
Add API documentation generation with phpDocumentor (#184)
* Add API documentation generation with phpDocumentor

- Add phpDocumentor configuration and `docs` Makefile target
- Generate docs during CI to catch errors before releases
- Set up GitHub Pages with Jekyll for hosting generated docs
- Add GitHub Actions workflow to deploy docs to GitHub Pages on releases

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Fix phpDocumentor errors in type annotations

Change class-string union types to use phpDocumentor-compatible syntax
and reorder docblock tags so class descriptions precede `@author` tags.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Fix CI: pin phar-io/composer-distributor ^1.0.2

phar-io/composer-distributor 1.0.0 has a bug where it uses the wrong
package version when determining the phpDocumentor download URL,
causing CI to fail with 404 errors when using --prefer-lowest.
Version 1.0.2 fixes this issue.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Integrate markdown guides into phpDocumentor output

Configure phpDocumentor to generate both API documentation and user
guides in a single unified site. This replaces the previous Jekyll-based
approach where API docs were copied into the docs folder.

- Add `<guide>` configuration to `phpdoc.dist.xml`
- Create custom template with "Guides" navigation link
- Replace `docs/index.html` redirect with `docs/index.md` guide index
- Update workflow to publish `build/docs` directly without Jekyll
- Track `.phpdoc/template/` while still ignoring `.phpdoc/cache/`

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Fine-tuning for path, config, and layout

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Christopher Hertel <mail@christopher-hertel.de>
2026-02-01 16:22:40 +01:00
Christopher Hertel
2fe982505f
Switch pipeline to conformance baseline (#230) 2026-02-01 11:59:44 +01:00
Christopher Hertel
c081b90d74
Update codestyle based on updated Symfony rules (#229) 2026-02-01 11:54:31 +01:00
Sule-Balogun Olanrewaju
e485fde727
Refactor the schema tool array to use normalizeSchemaProperties method (#223) 2026-01-18 23:38:16 +01:00
Mateu Aguiló Bosch
ab4f686e18
refactor: put formatters into dedicated classes (#224)
Split formatting logic from Reference classes into dedicated formatter classes:
- ToolResultFormatter: Formats tool execution results into Content items
- PromptResultFormatter: Formats prompt results into PromptMessage items
- ResourceResultFormatter: Formats resource results into ResourceContents items

This refactor:
- Eliminates 122 lines of code duplication between ResourceReference and
  ResourceTemplateReference (identical formatting logic)
- Improves code organization by separating formatting concerns from
  capability reference management
- Makes formatters independently testable and reusable
- Reduces Reference classes by ~450 lines while maintaining all functionality

Changes:
- Create src/Capability/Formatter/* with three formatter classes
- Update Reference classes to delegate to formatters instead of inline logic
- Add comprehensive test coverage for all formatter classes
- All existing tests pass; no behavioral changes
2026-01-18 22:17:44 +01:00
adam jones
48af7bd547
chore: update licensing to Apache 2.0 for new contributions (#222) 2026-01-18 21:29:44 +01:00
Tobias Nyholm
42fe1430ce
make static methods in Error final (#204) v0.3.0 2026-01-11 22:16:27 +01:00
Tobias Nyholm
8b57fdf3d0
Add $runnerControl parameter to StdioTransport constructor (#205)
* Add $runnerControl parameter to StdioTransport constructor

* fix cs

* fix phpstan baseline

---------

Co-authored-by: Christopher Hertel <mail@christopher-hertel.de>
2026-01-11 22:12:33 +01:00
落月
2c16b3e084
[Server] Use getDescription to get all descriptions. (#188)
* Remove `getSummary` method and update descriptions in snapshots and code

* Add changelog entry

---------

Co-authored-by: Christopher Hertel <mail@christopher-hertel.de>
2026-01-11 22:08:05 +01:00
Antoine Bluchet
7cb29125bd
Add interface abstractions for SchemaGenerator and Discoverer with DI improvements (#215)
* schema generator injection

* add interface for schema generator

* improve discoverer dependency

* remove some comments

* make some classes final

* simplify condition

* code review

* Extend changelog for covering interfaces

* Adopt SchemaGeneratorInterface after rebase and #153

---------

Co-authored-by: Christopher Hertel <mail@christopher-hertel.de>
2026-01-11 22:03:43 +01:00
落月
1de4ea933f
Rename schema to resource in Capability and related classes (#217) 2026-01-11 21:52:04 +01:00
Tobias Nyholm
ed205ef793
Use SchemaValidator to validate tool input (#203)
* Use SchemaValidator to validate tool input

* add test

* add changelog

* fix cs

* Improve error message

* fix tests

* fix tests

* fix baseline

* update snapshot files

* Remove BC compat while switching to v0.3.0

---------

Co-authored-by: Christopher Hertel <mail@christopher-hertel.de>
2026-01-11 21:46:53 +01:00
Sule-Balogun Olanrewaju
c0938a19bd
feat: Add output schema support to MCP tools (#153) 2026-01-11 21:14:48 +01:00
Kyrian Obikwelu
4c3e5e61c7
fix: use Docker PHP-FPM to support sampling in conformance tests (#219) 2026-01-02 15:59:56 +01:00
落月
96ab01712b
Add support for binary resource in conformance server example (#216) 2025-12-31 00:55:04 +01:00
Christopher Hertel
2f29b1dbe5
[Server][Conformance] Kicking off adoption of conformance testing (#181) v0.2.2 2025-12-28 07:32:37 +01:00
Tobias Nyholm
7f02285753
Use the throwable object in $context['exception'] (#207)
* Use the throwable object in $context['excpetion']

* add changelog

* remove 'exception' from context

* revert debug
2025-12-27 23:46:35 +01:00
Tobias Nyholm
abd0ddf13d
Remove ability to use parameter name _session and _request (#206)
* Remove ability to use parameter name _session and _request

These are reserved for internal use. This will fix https://github.com/modelcontextprotocol/php-sdk/issues/168

* fix cs

* add changelog

* add test
2025-12-27 23:16:44 +01:00
Tobias Nyholm
6d74dce073
be more generous with PSR versions (#202)
The only difference is return types. Since we dont implement these interfaces, it does not matter for us
2025-12-27 22:53:22 +01:00
Tobias Nyholm
0dc077892e
Normalize composer.json with ergebnis/composer-normalize (#208) 2025-12-27 22:48:48 +01:00
Tobias Nyholm
df2563fd20
make sure StdioTransport does not break BC for 0.2.1 (#201) v0.2.1
* make sure StdioTransport does not break BC for 0.2.1

* fix phpstan baseline
2025-12-27 16:05:06 +01:00
Christopher Hertel
732c552821
Add changelog entry for SF v5.4 support (#199) 2025-12-27 15:41:06 +01:00
Tobias Nyholm
6dac6f3b4a
Move examples to server directory (#198)
* move examples to server directory

This will prepare for the client implementation in https://github.com/modelcontextprotocol/php-sdk/pull/192

* fix move bootstrap too
2025-12-27 15:39:05 +01:00
Tobias Nyholm
c3244fcdd4
Allow to install with sf 5.4 (#197)
* Allow to install with sf 5.4

* fix syntax

* fix dependencies
2025-12-27 15:27:05 +01:00
Tobias Nyholm
7a8045a5ef
Add a way to stop the stdioTransport in a graceful way (#195)
* Add a way to stop the stdioTransport in a graceful way

* fix cs

* fix: minors

* move around files

* add changelog
2025-12-27 14:21:55 +01:00
Christopher Hertel
a07083a65a
House keeping in cs fixer config and makefile (#196) 2025-12-25 00:04:13 +01:00
Tobias Nyholm
3b31954ac6
Add changelog for 0.2.0 (#187) v0.2.0 2025-12-20 08:50:08 +01:00
Kyrian Obikwelu
2c9692214c
fix: use RequestContext in client-communication server example (#190) 2025-12-20 08:49:48 +01:00
Kyrian Obikwelu
3818173d2f
[Schema] Fix: correct Resource type hints in ListResourcesResult (#191)
* fix: correct Resource type hints in ListResourcesResult

* fix: phpstan errors

* fix: phpstan errors
2025-12-20 08:49:29 +01:00
Tobias Nyholm
69cd04f752
fix bug with Builder::addLoders() (#186) 2025-12-16 07:48:00 +01:00
Tobias Nyholm
a1e0f61b6b
Add RequestContext and logging (#176)
* Implemented MCP logging specification with auto-injection

* Add RequestContext

* fix tests and style

* Better deprecation

* fix: minor

* Remove ClientAwareInterface

* fix cs

* fix docs

---------

Co-authored-by: Adam Jamiu <jamiuadam120@gmail.com>
2025-12-16 00:12:02 +01:00
Antoine Bluchet
369932378f
align addLoaders with addRequestHandlers (#183) 2025-12-09 09:47:31 +01:00
Christopher Hertel
32757f6b45
Adding PHP 8.5 to pipeline (#182) 2025-12-06 15:01:35 +01:00
Tobias Nyholm
50ece31c7f
add changelog for 0.2.0 release (#173) 2025-11-30 15:49:04 +01:00
Christopher Hertel
8117f1fdc7
Extend changelog for covering 0.1 (#172) 2025-11-30 15:17:03 +01:00
落月
691e4f7d1a
fix: delete http code (#158) 2025-11-30 14:56:15 +01:00