Skip to content

Unable to assign handlers to McpServerOptions.Handlers after upgrading to v0.9.0 (readonly regression?) #1331

@gabaoalb

Description

@gabaoalb

Describe the bug
After upgrading from v0.8.0 to v0.9.0, it is no longer possible to assign handlers to McpServerOptions.Handlers. The property now appears to be readonly, which prevents configuring custom handlers as demonstrated in the documentation/examples.

To Reproduce
Steps to reproduce the behavior:

  1. Upgrade the library from 0.8.0 to 0.9.0
  2. Attempt to implement the "fine-grained control" example from the GitHub repository
  3. Assign a value to McpServerOptions.Handlers

Expected behavior
McpServerOptions.Handlers should remain assignable so that MCP servers can define custom tool handlers. This configuration is required for dynamically handling tool calls made by the LLM.
In my use case, the MCP server retrieves data from an external API and dynamically assembles tool behavior based on an OpenAPI JSON schema. Preventing handler assignment blocks this workflow entirely.

Logs
Image

Additional context

  • It changed from version 0.8.0 to 0.9.0
  • No relevant code changes on my side besides the version bump
  • I'm not sure if I could set a handler in any other way than what's shown in the examples.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions