Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

pja-ant
Copy link
Contributor

@pja-ant pja-ant commented Sep 9, 2025

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:

Screenshot 2025-09-09 at 22 18 40

Breaking Changes

Not breaking, purely additional functionality.

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

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

@pja-ant pja-ant requested a review from a team as a code owner September 9, 2025 21:23
@pja-ant pja-ant requested a review from ihrpr September 9, 2025 21:23
@@ -119,10 +119,12 @@ async def wrap(_: MCPServer[LifespanResultT, Request]) -> AsyncIterator[Lifespan


class FastMCP(Generic[LifespanResultT]):
def __init__(
def __init__( # noqa: PLR0913
Copy link
Contributor Author

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...

Copy link
Member

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?

Copy link
Member

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.

Copy link
Member

@dsp-ant dsp-ant left a 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
Copy link
Member

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")."""
Copy link
Member

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.

Copy link
Contributor Author

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)

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