Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamically configure server capabilities #12

Open
mattt opened this issue Mar 14, 2025 · 2 comments
Open

Dynamically configure server capabilities #12

mattt opened this issue Mar 14, 2025 · 2 comments
Labels
enhancement New feature or request

Comments

@mattt
Copy link
Contributor

mattt commented Mar 14, 2025

Currently, you initialize a Server with capabilities defined up front:

import MCP

let server = Server(
    name: "MyServer", 
    version: "1.0.0",
    capabilities: .init(
        resources: .init(
            subscribe: true
        )
    )
)

It'd be nice to omit the capabilities argument entirely, so that the server determines its capabilities dynamically, based on what handlers have been registered.

@mattt mattt added the enhancement New feature or request label Mar 14, 2025
@stallent
Copy link

stallent commented Mar 16, 2025

Conceptually i get it, but see the other issue I just opened. Two of your three properties above (list and read) do not exist in the spec so curious if the value is still there without these? Unsure.

@mattt
Copy link
Contributor Author

mattt commented Mar 17, 2025

@stallent Thanks for opening #14. That's resolved by #15. Regarding this enhancement specifically, the idea is that the caller could omit an explicit capabilities argument in the initializer; if it supports tools/list and tools/call, then it'd have the effect of capabilities: .init(tools: .init()).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants