docs: load media examples from disk instead of inline base64 (#3108)
This commit is contained in:
parent
ebcc4dc3fb
commit
3a6f2996cd
1 changed files with 108 additions and 50 deletions
|
|
@ -1,16 +1,14 @@
|
|||
import base64
|
||||
from pathlib import Path
|
||||
|
||||
from mcp.server import MCPServer
|
||||
from mcp.server.mcpserver import Image
|
||||
|
||||
mcp = MCPServer("Brand kit")
|
||||
|
||||
LOGO_PNG = base64.b64decode(
|
||||
"iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAADElEQVR4nGOQ9bsBAAHPAURf8l/aAAAAAElFTkSuQmCC"
|
||||
)
|
||||
LOGO_FILE = Path(__file__).parent / "logo.png" # or the path to your file on disk
|
||||
|
||||
|
||||
@mcp.tool()
|
||||
def logo() -> Image:
|
||||
"""The brand logo as a PNG."""
|
||||
return Image(data=LOGO_PNG, format="png")
|
||||
return Image(path=LOGO_FILE)
|
||||
|
|
|
|||
Loading…
Reference in a new issue