We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
FileUrl
resources/list
simple-resource
1 parent 29c69e6 commit f7265f7Copy full SHA for f7265f7
examples/servers/simple-resource/mcp_simple_resource/server.py
@@ -2,7 +2,7 @@
2
import click
3
import mcp.types as types
4
from mcp.server.lowlevel import Server
5
-from pydantic import AnyUrl
+from pydantic import AnyUrl, FileUrl
6
7
SAMPLE_RESOURCES = {
8
"greeting": "Hello! This is a sample text resource.",
@@ -26,7 +26,7 @@ def main(port: int, transport: str) -> int:
26
async def list_resources() -> list[types.Resource]:
27
return [
28
types.Resource(
29
- uri=AnyUrl(f"file:///{name}.txt"),
+ uri=FileUrl(f"file:///{name}.txt"),
30
name=name,
31
description=f"A sample text resource named {name}",
32
mimeType="text/plain",
0 commit comments