Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/Python/SDK/examples/snippets/servers/     Datei vom 5.10.2026 mit Größe 450 B image not shown  

SSL basic_resource.py   Sprache: Python

 

from mcp.server.mcpserver import MCPServer

mcp = MCPServer(name="Resource Example")


@mcp.resource("file://documents/{name}")
def read_document(name: str) -> str:
    """Read a document by name."""
    # This would normally read from disk
    return f"Content of {name}"


@mcp.resource("config://settings")
def get_settings() -> str:
    """Get application settings."""
    return """{
  "
theme": "dark",
  "
language": "en",
  "
debug": false
}"
""

Messung
CHZG
959810097

¤ Dauer der Verarbeitung: 0.43 Sekunden  ¤

*© Formatika GbR, Deutschland