Some checks are pending
🚀 LLM Fusion MCP - CI/CD Pipeline / 🔍 Code Quality & Testing (3.10) (push) Waiting to run
🚀 LLM Fusion MCP - CI/CD Pipeline / 🔍 Code Quality & Testing (3.11) (push) Waiting to run
🚀 LLM Fusion MCP - CI/CD Pipeline / 🔍 Code Quality & Testing (3.12) (push) Waiting to run
🚀 LLM Fusion MCP - CI/CD Pipeline / 🛡️ Security Scanning (push) Blocked by required conditions
🚀 LLM Fusion MCP - CI/CD Pipeline / 🐳 Docker Build & Push (push) Blocked by required conditions
🚀 LLM Fusion MCP - CI/CD Pipeline / 🎉 Create Release (push) Blocked by required conditions
🚀 LLM Fusion MCP - CI/CD Pipeline / 📢 Deployment Notification (push) Blocked by required conditions
- Unified access to 4 major LLM providers (Gemini, OpenAI, Anthropic, Grok) - Real-time streaming support across all providers - Multimodal capabilities (text, images, audio) - Intelligent document processing with smart chunking - Production-ready with health monitoring and error handling - Full OpenAI ecosystem integration (Assistants, DALL-E, Whisper) - Vector embeddings and semantic similarity - Session-based API key management - Built with FastMCP and modern Python tooling 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
52 lines
1.7 KiB
Python
52 lines
1.7 KiB
Python
#!/usr/bin/env python3
|
|
"""Test the MCP tools directly."""
|
|
|
|
import sys
|
|
import os
|
|
sys.path.insert(0, 'src')
|
|
|
|
# Test simple calculator without MCP wrapper
|
|
def simple_calculator(operation: str, a: float, b: float):
|
|
"""Test version of the calculator tool."""
|
|
try:
|
|
operations = {
|
|
"add": lambda x, y: x + y,
|
|
"subtract": lambda x, y: x - y,
|
|
"multiply": lambda x, y: x * y,
|
|
"divide": lambda x, y: x / y if y != 0 else None
|
|
}
|
|
|
|
if operation.lower() not in operations:
|
|
return {
|
|
"error": f"Unknown operation: {operation}. Available: {list(operations.keys())}",
|
|
"success": False
|
|
}
|
|
|
|
if operation.lower() == "divide" and b == 0:
|
|
return {
|
|
"error": "Division by zero is not allowed",
|
|
"success": False
|
|
}
|
|
|
|
result = operations[operation.lower()](a, b)
|
|
|
|
return {
|
|
"result": result,
|
|
"operation": operation,
|
|
"operands": [a, b],
|
|
"success": True
|
|
}
|
|
except Exception as e:
|
|
return {
|
|
"error": str(e),
|
|
"success": False
|
|
}
|
|
|
|
if __name__ == "__main__":
|
|
print("Testing simple calculator tool:")
|
|
print("Add 5 + 3:", simple_calculator('add', 5, 3))
|
|
print("Subtract 10 - 3:", simple_calculator('subtract', 10, 3))
|
|
print("Multiply 4 * 7:", simple_calculator('multiply', 4, 7))
|
|
print("Divide 15 / 3:", simple_calculator('divide', 15, 3))
|
|
print("Divide by zero:", simple_calculator('divide', 10, 0))
|
|
print("Invalid operation:", simple_calculator('invalid', 1, 2)) |