chore: add detailed logging to MCP server for end-to-end data flow visibility

- Instrumented `mock_math_server.py` to log incoming agent requests and tool responses
- Ensured logs clarify the MCP protocol: agent → MCP server → tool → response → agent
- Supports debugging and compliance with Model Context Protocol (MCP) flow
pull/819/head
Pavan Kumar 2 days ago committed by ascender1729
parent 80146d875c
commit f69682f31b

@ -10,10 +10,15 @@ mcp = FastMCP("Math-Mock-Server")
def add(a: int, b: int) -> int:
"""Add two numbers together"""
try:
print(f"MCP Server: Processing addition request for {a} + {b}")
time.sleep(0.1) # Simulate processing time
return a + b
result = a + b
print(f"MCP Server: Returning result {result}")
return result
except Exception as e:
return {"error": f"Error adding numbers: {str(e)}"}
error_msg = f"Error adding numbers: {str(e)}"
print(f"MCP Server: {error_msg}")
return {"error": error_msg}
@mcp.tool()
def multiply(a: int, b: int) -> int:

Loading…
Cancel
Save