-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Implementation of SEP 973 - Additional metadata + icons support #1357
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
base: main
Are you sure you want to change the base?
Conversation
@@ -119,10 +119,12 @@ async def wrap(_: MCPServer[LifespanResultT, Request]) -> AsyncIterator[Lifespan | |||
|
|||
|
|||
class FastMCP(Generic[LifespanResultT]): | |||
def __init__( | |||
def __init__( # noqa: PLR0913 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added the noqa
for now, but let me know if you would prefer a refactor in this PR...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should think about refactoring this. @Kludex thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this can be refactored in this PR, can it?
I think the point is that we need to deprecate some of the fields that should actually be on the FastMCP.run()
e.g. port
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor nits, the rest looks good.
@@ -119,10 +119,12 @@ async def wrap(_: MCPServer[LifespanResultT, Request]) -> AsyncIterator[Lifespan | |||
|
|||
|
|||
class FastMCP(Generic[LifespanResultT]): | |||
def __init__( | |||
def __init__( # noqa: PLR0913 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should think about refactoring this. @Kludex thoughts?
"""Optional MIME type for the icon.""" | ||
|
||
sizes: str | None = None | ||
"""Optional string specifying icon dimensions (e.g., "48x48 96x96").""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's comma separated. We might actually still want to change that in the spec, since a list of strings feels more natural.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The spec is spaces, not commas: https://github.com/modelcontextprotocol/modelcontextprotocol/blob/main/schema/draft/schema.ts#L317
Let me know if you plan to change the spec though... (I'd agree that List[str]
is probably better than stringly typed)
Implementation of SEP 973 - adds additional metadata and support for icons for tools/resources/prompts.
See:
Motivation and Context
SEP is approved and already implemented in the TypeScript SDK
How Has This Been Tested?
Unit test added in addition to new example. Used @jesselumarie's https://github.com/jesselumarie/inspector/tree/jesselumarie/test-SEP-974 inspector branch to try it out:
Breaking Changes
Not breaking, purely additional functionality.
Types of changes
Checklist