move fastapi to main
This commit is contained in:
@@ -50,6 +50,7 @@ class Calculator(LangToolBase):
|
|||||||
return [self.calculator]
|
return [self.calculator]
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
# Global calculator instance
|
# Global calculator instance
|
||||||
calculator = Calculator(CalculatorConfig())
|
calculator = Calculator(CalculatorConfig())
|
||||||
|
|
||||||
@@ -63,7 +64,4 @@ mcp = FastMCP("Calculator Server")
|
|||||||
async def calculate(python_expression: str) -> dict:
|
async def calculate(python_expression: str) -> dict:
|
||||||
"""For mathematical calculation, always use this tool to calculate the result of a python expression. You can use 'math' or 'random' directly, without 'import'."""
|
"""For mathematical calculation, always use this tool to calculate the result of a python expression. You can use 'math' or 'random' directly, without 'import'."""
|
||||||
return await calculator.calculator_async(python_expression)
|
return await calculator.calculator_async(python_expression)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
mcp.run(transport="streamable-http", host="0.0.0.0", port=9000)
|
mcp.run(transport="streamable-http", host="0.0.0.0", port=9000)
|
||||||
|
|||||||
Reference in New Issue
Block a user