Skip to content

Conversation

@Nyholm
Copy link
Contributor

@Nyholm Nyholm commented Nov 22, 2025

I want to allow users to build their servers like:

$server = Server::builder()
    //->setServerInfo('My demo', '1.1.0', 'Basic demo')
    ->setSession(new FileSessionStore(__DIR__.'/sessions'))
    ->setDiscovery(__DIR__)
    ->build();

Motivation and Context

This comes from a pure DX perspective. If I forget to specify my server info, I dont want everything to crash with:

PHP Fatal error:  Uncaught TypeError: Mcp\Server\Configuration::__construct(): Argument #1 ($serverInfo) must be of type Mcp\Schema\Implementation, null given, called in...

With this PR it "just works".

How Has This Been Tested?

I ran the script locally a few times. Also tested with @modelcontextprotocol/inspector

Breaking Changes

Nope.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Small DX improvment

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

@CodeWithKyrian
Copy link
Contributor

I agree with you @Nyholm! The default name for the server info though is debatable.

@Nyholm
Copy link
Contributor Author

Nyholm commented Nov 22, 2025

Yeah. True true.

I was considering "app" (just as default value for $name in Implementation), but I felt that was a little too boring. =)

I'll be happy to go with any suggestion. This is not important for me.

@chr-hertel
Copy link
Member

Yes, let's go with "app" 👍

@Nyholm
Copy link
Contributor Author

Nyholm commented Nov 30, 2025

Thank you.

The PR is updated with the default name

@Nyholm
Copy link
Contributor Author

Nyholm commented Nov 30, 2025

Thank you

@Nyholm Nyholm merged commit b250f4a into modelcontextprotocol:main Nov 30, 2025
10 checks passed
@Nyholm Nyholm deleted the feat-server-info branch November 30, 2025 10:30
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.

3 participants