docs: add snippet verification for docs/ pages (#2115)
This commit is contained in:
parent
cfbbd7d71a
commit
1ef124e4a8
1 changed files with 446 additions and 43 deletions
10
examples/snippets/servers/binary_resources.py
Normal file
10
examples/snippets/servers/binary_resources.py
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
from mcp.server.fastmcp import FastMCP
|
||||
|
||||
mcp = FastMCP("Binary Resource Example")
|
||||
|
||||
|
||||
@mcp.resource("images://logo.png", mime_type="image/png")
|
||||
def get_logo() -> bytes:
|
||||
"""Return a binary image resource."""
|
||||
with open("logo.png", "rb") as f:
|
||||
return f.read()
|
||||
Loading…
Reference in a new issue