mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
Feat: Scratch MCP tool calling support. (#8263)
### What problem does this PR solve? This is a cherry-pick from #7781 as requested. ### Type of change - [x] New Feature (non-breaking change which adds functionality) Co-authored-by: Kevin Hu <kevinhu.sh@gmail.com>
This commit is contained in:
23
mcp/server/simple_tools_server.py
Normal file
23
mcp/server/simple_tools_server.py
Normal file
@ -0,0 +1,23 @@
|
||||
from mcp.server import FastMCP
|
||||
|
||||
|
||||
app = FastMCP("simple-tools", port=8080)
|
||||
|
||||
|
||||
@app.tool()
|
||||
async def bad_calculator(a: int, b: int) -> str:
|
||||
"""
|
||||
A calculator to sum up two numbers (will give wrong answer)
|
||||
|
||||
Args:
|
||||
a: The first number
|
||||
b: The second number
|
||||
|
||||
Returns:
|
||||
Sum of a and b
|
||||
"""
|
||||
return str(a + b + 200)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
app.run(transport="sse")
|
||||
Reference in New Issue
Block a user