Skip to content

Commit 7bd4334

Browse files
committed
Export Icon from FastMCP module for simpler imports
1 parent d028efb commit 7bd4334

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -520,8 +520,7 @@ _Full example: [examples/snippets/servers/basic_prompt.py](https://github.com/mo
520520
MCP servers can provide icons for UI display. Icons can be added to the server implementation, tools, resources, and prompts:
521521

522522
```python
523-
from mcp.server.fastmcp import FastMCP
524-
from mcp.types import Icon
523+
from mcp.server.fastmcp import FastMCP, Icon
525524

526525
# Create an icon from a file path or URL
527526
icon = Icon(

examples/fastmcp/icons_demo.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
import base64
88
from pathlib import Path
99

10-
from mcp.server.fastmcp import FastMCP
11-
from mcp.types import Icon
10+
from mcp.server.fastmcp import FastMCP, Icon
1211

1312
# Load the icon file and convert to data URI
1413
icon_path = Path(__file__).parent / "mcp.png"

src/mcp/server/fastmcp/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22

33
from importlib.metadata import version
44

5+
from mcp.types import Icon
6+
57
from .server import Context, FastMCP
68
from .utilities.types import Audio, Image
79

810
__version__ = version("mcp")
9-
__all__ = ["FastMCP", "Context", "Image", "Audio"]
11+
__all__ = ["FastMCP", "Context", "Image", "Audio", "Icon"]

0 commit comments

Comments
 (0)