Skip to main content
Glama

MSFConsole MCP Server

by LYFTIUM-INC
test_tool_calls.pyโ€ข4.25 kB
#!/usr/bin/env python3 """ Test tool calls without full MSF initialization """ import asyncio import json import sys import os # Add current directory to path sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) async def test_tool_calls(): """Test that tools can be called through the server interface.""" print("๐Ÿš€ Testing Tool Call Interface") print("=" * 40) # Mock test without real MSF initialization from mcp_server_stable import MSFConsoleMCPServer server = MSFConsoleMCPServer() results = {"success": 0, "failed": 0, "tests": []} # Test new ecosystem tools (without initialization) new_tools = [ ("msf_venom_direct", {"payload": "test"}), ("msf_database_direct", {"action": "status"}), ("msf_rpc_interface", {"action": "status"}), ("msf_interactive_session", {"session_id": "1", "action": "sysinfo"}), ("msf_report_generator", {"report_type": "json"}), ("msf_evasion_suite", {"payload": "test"}), ("msf_listener_orchestrator", {"action": "create"}), ("msf_workspace_automator", {"action": "create_template", "workspace_name": "test"}), ("msf_encoder_factory", {"payload_data": "test", "encoding_chain": ["xor"]}), ("msf_integration_bridge", {"tool": "nmap", "action": "status"}) ] for tool_name, args in new_tools: print(f"๐Ÿ”ง Testing {tool_name}...", end=" ") try: # Test that the tool exists in routing if not server.initialized: # Mock initialization status for routing test server.initialized = True # This should not hang since we're testing routing, not MSF execution # The tools should fail gracefully without MSF initialization result = await asyncio.wait_for( server.handle_tool_call(tool_name, args), timeout=5.0 # 5 second timeout ) if result and "content" in result: content = result["content"][0].get("text", "") if "Unknown tool" in content: print("โŒ Tool not found in routing") results["failed"] += 1 results["tests"].append({"tool": tool_name, "status": "not_found"}) else: print("โœ… Tool found and callable") results["success"] += 1 results["tests"].append({"tool": tool_name, "status": "callable"}) else: print("โŒ No response") results["failed"] += 1 results["tests"].append({"tool": tool_name, "status": "no_response"}) except asyncio.TimeoutError: print("โฐ Timeout (likely hanging)") results["failed"] += 1 results["tests"].append({"tool": tool_name, "status": "timeout"}) except Exception as e: print(f"โŒ Error: {str(e)[:30]}") results["failed"] += 1 results["tests"].append({"tool": tool_name, "status": "error", "error": str(e)}) # Results print("\n" + "=" * 40) print("๐Ÿ“Š TOOL CALL TEST RESULTS") print("=" * 40) print(f"โœ… Callable: {results['success']}/10") print(f"โŒ Issues: {results['failed']}/10") print(f"๐Ÿ“ˆ Success Rate: {(results['success']/10)*100:.1f}%") # Detailed results print("\n๐Ÿ“ Detailed Results:") for test in results["tests"]: status_emoji = { "callable": "โœ…", "not_found": "๐Ÿ”", "no_response": "โŒ", "timeout": "โฐ", "error": "๐Ÿ’ฅ" }.get(test["status"], "โ“") print(f" {status_emoji} {test['tool']}: {test['status']}") if "error" in test: print(f" Error: {test['error'][:60]}") return results["success"] >= 7 # 70% threshold if __name__ == "__main__": success = asyncio.run(test_tool_calls()) if success: print("\n๐ŸŽ‰ Tool call test PASSED!") print("โœ… New tools are properly integrated and callable") else: print("\nโš ๏ธ Tool call test found issues")

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/LYFTIUM-INC/msfconsole-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server