fix: correct MCP server port binding and test response logic

- Fixed port configuration in `math_server.py` to ensure proper server startup
- Updated response handling in `multi_server_test.py` to resolve missing outputs during testing
pull/819/head
Pavan Kumar 2 days ago committed by ascender1729
parent c8954ebfb1
commit 60d51457f1

@ -29,4 +29,4 @@ def divide(a: float, b: float) -> float:
if __name__ == "__main__": if __name__ == "__main__":
print("Starting Math Server on port 6274...") print("Starting Math Server on port 6274...")
mcp.run(transport="sse", host="0.0.0.0", port=6274) mcp.run(transport="sse", port=6274)

@ -88,15 +88,20 @@ def main():
print(f"Response: {response}") print(f"Response: {response}")
print("-" * 50) print("-" * 50)
else: else:
response = super_agent.run(user_input) try:
print("\nSuper Agent Response:") response = super_agent.run(user_input)
print("-" * 50) print("\nSuper Agent Response:")
if isinstance(response, dict): print("-" * 50)
result = response.get('result', response) if isinstance(response, dict):
print(f"Calculation Result: {result}") result = response.get('result', response)
else: print(f"Result: {result}")
print(f"Calculation Result: {response}") elif hasattr(response, 'content'):
print("-" * 50) print(f"Result: {response.content}")
else:
print(f"Result: {response}")
print("-" * 50)
except Exception as e:
print(f"Error processing calculation: {str(e)}")
except KeyboardInterrupt: except KeyboardInterrupt:
print("\nExiting gracefully...") print("\nExiting gracefully...")

Loading…
Cancel
Save