Commit graph php-sdk/src/Server
Author SHA1 Message Date
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
df2563fd20
make sure StdioTransport does not break BC for 0.2.1 (#201)
* make sure StdioTransport does not break BC for 0.2.1

* fix phpstan baseline
2025-12-27 16:05:06 +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
Tobias Nyholm
3b31954ac6
Add changelog for 0.2.0 (#187) 2025-12-20 08:50:08 +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
落月
691e4f7d1a
fix: delete http code (#158) 2025-11-30 14:56:15 +01:00
Tobias Nyholm
b250f4ad1a
Allow users to not specify server info (#164)
* Allow users to not specify server info

* change to default name
2025-11-30 11:30:31 +01:00
落月
280e8b62be
Decouple Server from TransportInterface for reusability (#160) 2025-11-30 11:21:21 +01:00
Tobias Nyholm
532d102c4e
fix cs in main (#171) 2025-11-30 11:12:22 +01:00
Tobias Nyholm
48634bd8c0
Tell clients that they are allowed to use Mcp-Session-Id header (#165) 2025-11-30 11:00:51 +01:00
Tobias Nyholm
59ab0888b1
remove redundant methods in Transport (#163) 2025-11-22 11:56:46 +01:00
Camille Islasse
470237ad0b
Make logger nullable in Transport constructors (#152)
- BaseTransport: Accept ?LoggerInterface parameter and convert null to NullLogger
- StdioTransport: Change logger parameter to nullable
- StreamableHttpTransport: Change logger parameter to nullable
- InMemoryTransport: Fix missing parent::__construct() call and add logging
2025-11-20 19:48:17 +01:00
Christopher Hertel
7cd281d0c7
Rework registry to combine provider and registry interface, move capabilities out and enable Registry injection in Builder (#150) 2025-11-20 19:36:57 +01:00
Bujar Begisholli - C24
7a58ab3f5a
Add meta to addPrompt and addResourceTemplate methods and null coalesce nullable properties (#149) 2025-11-14 17:11:38 +01:00
Christopher Hertel
056c7b6103
[Server] Add support for icons on explicit builder registration and attributes (#142)
* Add support for icons on explicit builder registration and attributes

* Update docs/server-builder.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-11-13 22:39:18 +01:00
Bujar Begisholli - C24
63ffeed0cc
[Server] Fix wrong parameter order when creating the tool from array (#147)
Previously, the meta parameter was incorrectly passed to the icons position
due to missing icons argument. Also adds icons support to Builder::addTool()
for consistency with the Tool schema.
2025-11-12 11:34:17 +01:00
Bujar Begisholli - C24
8daca8129e
[Server] Add meta parameter to addTool and addResource methods (#144) 2025-11-12 10:36:31 +01:00
落月
982706851a
Change visibility of handleFiberTermination and flushOutgoingMessages to protected (#143) 2025-11-11 21:42:04 +01:00
Christopher Hertel
5804ba9773
Add support for icons and website url (#141) 2025-11-09 14:53:36 +01:00
Kaipi Yann
d3a07912b0
Roll out meta properties in attributes and more schema classes (#129) 2025-11-08 13:58:26 +01:00
ineersa
09596c0382
Ability to set custom protocol version (#117) 2025-11-08 00:37:01 +01:00
Antoine Bluchet
85549cb835
session save return type (#133) 2025-11-04 22:45:41 +01:00
Antoine Bluchet
9be9e38815
ability to append loaders to server builder (#132) 2025-11-04 22:44:53 +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
Christopher Hertel
67cc641247
fix(server): consistent arg name in session store impl (#127) 2025-10-31 21:02:54 +01:00
Kyrian Obikwelu
ca18caf29d
[Server] Fix: standardize error handling across handlers with MCP specificatio… (#124)
* fix: standardize error handling across handlers with MCP specification compliance

* Update mcp-elements.md

Co-authored-by: Christopher Hertel <mail@christopher-hertel.de>

* docs: clarify error handling behavior for all element types

* docs: remove unnecessary whitespace in mcp-elements.md

* fix: simplify exception signatures to accept simple messages

* refactor: use specific exceptions in examples for better error handling

* feat: throw exceptions from reference provider instead of returning null

---------

Co-authored-by: Christopher Hertel <mail@christopher-hertel.de>
2025-10-30 17:30:58 +01:00
Christopher Hertel
8885d29a4e
fix(server): add completion handler to builder (#126) 2025-10-30 11:49:13 +01:00
Kyrian Obikwelu
55f860808c
fix: extract and pass URI template variables to resource handlers (#123) 2025-10-27 22:20:48 +01:00
落月
f41ea86608
feat(session): implement PSR-16 cache based session storage (#114) 2025-10-27 08:40:26 +01:00
Kyrian Obikwelu
48a19b93a7
[Server] Make CORS headers configurable in StreamableHttpTransport (#118)
* feat: make CORS headers configurable in StreamableHttpTransport

* docs: add CORS configuration documentation for HTTP transport

* refactor: streamline request creation and transport initialization in HTTP client example
2025-10-26 23:58:26 +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
Antoine Bluchet
e4a82f7474
refactor: registry loader (#111) 2025-10-24 21:43:16 +02:00
ineersa
d347c84472
StructuredContent call tool result, added ability to return error from tool (#93) 2025-10-24 21:18:42 +02:00
Antoine Bluchet
6100ffcf3f
Missing Mcp-Protocol-Version to access control (#110) 2025-10-20 22:41:24 +02:00
Kyrian Obikwelu
54a5d1495c
[Server] Refactor protocol pipeline to separate request and notification handling (#106) 2025-10-12 13:53:41 +01:00
Adebayo120
4486776e7d
[Server] Remove redundant Builder.setServerCapabilities method (#107) 2025-10-12 13:51:21 +01:00
ineersa
709a815cde
Add possibility to set custom ServerCapabilities. (#95) 2025-10-11 02:37:58 +02:00
Kyrian Obikwelu
2dbd411194
[Server] Simplify server entrypoint with run-based transport lifecycle (#103)
* feat: replace connect/listen flow with run lifecycle

* feat(transport): add phpstan generics for typed transport returns

* refactor: standardize variable naming for MCP server instances in transport handling

* test: remove unnecessary phpstan-ignore annotation in DocBlockTestFixture
2025-10-10 18:52:06 +01:00
Kyrian Obikwelu
fcf605d5d7
[Server] Simplify server extensibility with pluggable method handlers (#100)
* refactor: use a custom method handler registration system

* refactor: remove redundant Completer and CompleterInterface

* docs: update server-builder documentation to reflect custom method handler changes
2025-10-08 00:25:06 +02:00
Christopher Hertel
cbd1b298e9
Fix missing instructions from builder to handler (#90) 2025-10-07 23:32:51 +02:00
Christopher Hertel
d06b57d285
Address open PHPStan issues from baseline (#92) 2025-10-07 23:16:47 +02:00
Kyrian Obikwelu
4b91567dbd
feat: add completion/complete handler, centralize provider logic, and move completion capability (#97) 2025-10-07 10:34:50 +01:00
Christopher Hertel
cecfa0c3c6
Add request handler for resource templates (#89) 2025-10-04 19:43:41 +02:00
Kyrian Obikwelu
41486bfaa4
[Server] Reorganize server handlers and transport structure for better organization (#86)
* refactor: reorganize server handlers and transport structure

* feat: move the test files to corresponding directories

* fix: linter issues

* fix: correct PHPDoc formatting and streamline handler imports

* refactor: update import statement for ServerBuilder to Builder
2025-09-29 00:58:04 +02:00
Kyrian Obikwelu
3dcd2f717a
refactor: rename ServerBuilder to Builder (#85)
Remove redundant "Server" prefix since class is already in Server namespace.
2025-09-28 17:59:48 +01:00
Sule-Balogun Olanrewaju
095ea2af50
Address issue with pagination limit builder class class (#83) 2025-09-27 13:43:40 +02:00