Skip to content

[Server] Fail when discovery dependency is missing - #432

Open
ousamabenyounes wants to merge 1 commit into
modelcontextprotocol:mainfrom
ousamabenyounes:fix/issue-398
Open

[Server] Fail when discovery dependency is missing#432
ousamabenyounes wants to merge 1 commit into
modelcontextprotocol:mainfrom
ousamabenyounes:fix/issue-398

Conversation

@ousamabenyounes

Copy link
Copy Markdown

Summary

  • fail immediately when file-based discovery is configured without symfony/finder
  • preserve custom discoverers, which do not require Finder
  • cover the missing optional dependency in an isolated regression test

Fixes #398.

Test verification (RED → GREEN)

Reproduced on unmodified main with production-only dependencies:

BUG: build succeeded with Mcp\Server

With the regression test present and the production fix reverted (RED):

Failed asserting that exception of type "Mcp\Exception\RuntimeException" is thrown.
FAILURES!
Tests: 1, Assertions: 2, Failures: 1.

With the fix applied (GREEN):

OK (1 test, 3 assertions)

Full local validation:

Composer validation: passed
PHP CS Fixer: passed
PHPStan: passed
PHPUnit unit + integration: OK (1237 tests, 3384 assertions)
phpDocumentor: passed
Changed executable line coverage: 2/2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Builder::build() silently skips configured file-based discovery when symfony/finder is missing — should fail loudly

1 participant