Spaces:
Runtime error
Runtime error
from mcp.server.fastmcp import FastMCP | |
from typing import Any | |
mcp = FastMCP( | |
name = "Test FastMCP Server", | |
instructions="This server allows testing of tools", | |
host='0.0.0.0', | |
) | |
# Implement your server's tools | |
async def example_tool(param1: str, param2: int) -> str: | |
"""An example tool that demonstrates MCP functionality. | |
Args: | |
param1: First parameter description | |
param2: Second parameter description | |
Returns: | |
A string result from the tool execution | |
""" | |
# Tool implementation | |
result = f"Processed {param1} with value {param2}" | |
return result | |
def read_document(name: str) -> str: | |
"""Read a document by name.""" | |
# This would normally read from disk | |
return f"Content of {name}" | |
def review_code(code: str) -> str: | |
return f"Please review this code:\n\n{code}" | |
if __name__=="__main__": | |
mcp.run(transport="streamable-http", ) | |