Commit graph php-sdk/composer.json
Author SHA1 Message Date
adam jones
48af7bd547
chore: update licensing to Apache 2.0 for new contributions (#222) 2026-01-18 21:29:44 +01:00
Christopher Hertel
2f29b1dbe5
[Server][Conformance] Kicking off adoption of conformance testing (#181) 2025-12-28 07:32:37 +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
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
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
Christopher Hertel
32757f6b45
Adding PHP 8.5 to pipeline (#182) 2025-12-06 15:01:35 +01:00
Christopher Hertel
ff26b4ff61
refactor: transport agnostic examples (#131) 2025-11-02 18:07:43 +01:00
Christopher Hertel
fb3c1e65a6
Enable servers to send sampling messages to clients (#101) 2025-11-01 09:02:24 +01:00
Kyrian Obikwelu
f1b471a219
[Server] Add Bidirectional Client Communication Support (#109)
* feat(server): add bidirectional client communication support

* fix(server): use correct session ID string conversion method

* fix: clean up docblocks for request handler methods in Builder

* fix: merge artifacts
2025-10-26 22:48:17 +01:00
Kyrian Obikwelu
0963d243bc
feat: add PSR-17 factory auto-discovery to HTTP transport (#119) 2025-10-26 22:06:10 +01:00
Christopher Hertel
345b94dfbb
Rename example folders (#87) 2025-10-04 19:45:40 +02:00
Christopher Hertel
e46b7c139d
Support for Symfony 8.0 (#79) 2025-09-25 08:53:09 +02:00
xentixar
4db831778b
[Server] Implement discovery caching for improved performance (#39)
* feat: implement discovery caching with state-based approach

- Add DiscoveryState class to encapsulate discovered MCP capabilities
- Add exportDiscoveryState and importDiscoveryState methods to Registry
- Modify Discoverer to return DiscoveryState instead of void
- Create CachedDiscoverer decorator for caching discovery results
- Add importDiscoveryState method to ReferenceRegistryInterface
- Update ServerBuilder to use caching with withCache() method
- Update tests to work with new state-based approach
- Add example demonstrating cached discovery functionality
- Add PSR-16 SimpleCache and Symfony Cache dependencies

* docs: add comprehensive discovery caching documentation

- Add detailed documentation explaining discovery caching architecture
- Include usage examples for different cache implementations
- Document performance benefits and best practices
- Add troubleshooting guide and migration instructions
- Include complete API reference for all caching components
- Fix PHPStan issues by regenerating baseline
- Apply PHP CS Fixer formatting to all new files

* refactor: address reviewer feedback and clean up discovery caching

- Make DiscoveryState class final
- Cache DiscoveryState objects directly instead of arrays (no serialization needed)
- Rename exportDiscoveryState/importDiscoveryState to getDiscoveryState/setDiscoveryState
- Add getDiscoveryState method to ReferenceRegistryInterface
- Remove TTL parameter from CachedDiscoverer (no expiration by default)
- Remove unused methods from DiscoveryState (toArray, fromArray, merge)
- Simplify ServerBuilder to handle decoration internally
- Make Discoverer.applyDiscoveryState() internal (no longer public API)
- Simplify documentation to focus on user perspective
- Remove unnecessary development comments
- Update all tests to work with new architecture
- All tests pass, PHPStan clean, code formatting applied

* refactor: clean up comments and formatting in server.php example

* refactor: improve code formatting and consistency in discovery classes and example server

* Fix method names in cached discovery example

- Change withServerInfo() to setServerInfo()
- Change withDiscovery() to setDiscovery()
- Change withLogger() to setLogger()
- Fixes PHPStan static analysis errors

* refactor: update method names in ServerBuilder for consistency

- Change withCache() to setCache() in ServerBuilder
- Update example and documentation to reflect method name changes
- Ensure consistency across caching implementation in examples and documentation

* refactor: reorganize examples and fix PHPStan baseline

- Move cached discovery example from examples/10 to examples/09
- Update composer.json autoload-dev namespace mapping
- Fix PHPStan baseline by removing invalid entries for non-existent files
- Update server.php to follow proper example pattern with logging and lifecycle

* fix: correct formatting in server.php
2025-09-24 20:54:27 +02:00
Kyrian Obikwelu
719262b15d
feat(server): Rework transport architecture and add StreamableHttpTransport (#49)
* feat(server): Rework transport architecture and add StreamableHttpTransport

- `Server::connect()` no longer contains a processing loop.
- `TransportInterface` is updated with `setMessageHandler()` and `listen()`.
- `StdioTransport` is updated to implement the new interface.
- A new, minimal `StreamableHttpTransport` is added for stateless HTTP.

* refactor(server): use  event-driven message handling

* feat(server): Introduce a formal session management system

* fix: ensure session elements are preserved when building server (regression from #46)

* refactor: consolidate HTTP example to use shared dependencies

* feat(server): Enhance message handling with session support

- Updated `TransportInterface` to use `onMessage` for handling incoming messages with session IDs.
- Refactored `Server`, `Handler`, and transport classes to accommodate session management using `Uuid`.
- Introduced methods for creating sessions with auto-generated and specific UUIDs in `SessionFactory` and `SessionFactoryInterface`.

* feat(server): Integrate session management in message handling

- Added session support to the `Server` and `Handler` classes, allowing for session data to be managed during message processing.
- Updated `TransportInterface` to include session context in the `send` method.
- Refactored various request handlers to utilize session information, ensuring proper session handling for incoming requests.
- Introduced a file-based session store for persistent session data management

* feat: Update session builder method to use set* instead of with*

* feat: Fix test compatibility with new session management architecture

* chore: apply code style fixes

* fix: remove deprecated SSE transport and resolve PHPStan issues
2025-09-21 12:12:40 +02:00
Oskar Stark
a94d348f72
Remove suggest section in composer.json (#34)
* Sort suggest section in composer.json alphabetically

* Remove suggest section from composer.json
2025-09-04 23:50:15 +02:00
Oskar Stark
af5690d4c3
Require Symfony 7.3 instead of unmaintained versions (#26) 2025-09-04 23:29:59 +02:00
Oskar Stark
57ccb5bcf7
Remove unused nyholm/nsa dependency (#28) 2025-09-04 23:29:37 +02:00
Oskar Stark
a027ae4de3
Remove unused development dependencies (#33)
Remove symfony/dependency-injection and symfony/event-dispatcher
from require-dev as they are not used in the codebase. The project
uses psr/event-dispatcher interface instead of symfony's implementation.
2025-09-04 23:24:34 +02:00
Christopher Hertel
2ef051a355
Adopt server examples 2025-08-29 11:19:51 +02:00
Christopher Hertel
da0d5a87a0
Introduce Capability Registry & Discovery 2025-08-29 11:18:33 +02:00
Christopher Hertel
09707b4798
Adopt Schema component in server handlers 2025-08-29 11:12:23 +02:00
Christopher Hertel
6025f890f9
Introduce schema component 2025-08-29 11:11:20 +02:00
Christopher Hertel
ee0dffe369
Kick off the SDK based on Symfony's MCP SDK 2025-08-29 11:09:16 +02:00