这是indexloc提供的服务,不要输入任何密码
Skip to content

Decouple MCP components from McpServer #95

@galatanovidiu

Description

@galatanovidiu

Problem statement

Currently, components such as McpPrompt, McpTool, and McpResource hold a reference (nullable property and/or get_mcp_server() call) to McpServer, while McpServer itself owns or registers those same components.
This creates a circular dependency and a blur of responsibilities between “server”, “registry/manager”, and “component”.

Why this matters

  • Circular dependencies complicate testing, maintenance, and future refactoring.
  • The responsibility model is unclear: the server is both manager and owner, and components know about the server.
  • For extensibility, a cleaner architecture is beneficial.

TODO

  • Explore introducing a cleaner separation of responsibilities between server, component registry, and components.

Link to original discussion: PR #91 (comments)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions