We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/neupaneprashant/yahoo-finance-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server
test_setup.py•2.08 KiB
#!/usr/bin/env python3
"""
Setup verification script for Yahoo Finance MCP Server
This script verifies that all dependencies are installed and the server can be imported.
"""
import sys
def check_dependencies():
"""Check if all required dependencies are installed."""
print("Checking dependencies...")
missing = []
try:
import yfinance
print(" ✅ yfinance installed")
except ImportError:
print(" ❌ yfinance not found")
missing.append("yfinance")
try:
import pandas
print(" ✅ pandas installed")
except ImportError:
print(" ❌ pandas not found")
missing.append("pandas")
try:
import mcp
print(" ✅ mcp installed")
except ImportError:
print(" ❌ mcp not found")
missing.append("mcp")
return missing
def check_server():
"""Check if the server can be imported."""
print("\nChecking server...")
try:
from server import yfinance_server
print(" ✅ Server imports successfully")
# Check if server has tools
if hasattr(yfinance_server, 'list_tools'):
print(" ✅ Server structure looks correct")
return True
except Exception as e:
print(f" ❌ Server import failed: {e}")
return False
def main():
"""Run all checks."""
print("=" * 50)
print("Yahoo Finance MCP Server - Setup Verification")
print("=" * 50)
missing = check_dependencies()
server_ok = check_server()
print("\n" + "=" * 50)
if not missing and server_ok:
print("✅ All checks passed! Setup is complete.")
print("\nNext steps:")
print("1. Restart Claude Desktop")
print("2. The yfinance MCP server should be available")
print("3. Try asking Claude: 'Get stock info for AAPL'")
return 0
else:
print("❌ Some checks failed. Please install missing dependencies:")
if missing:
print(f" pip install {' '.join(missing)}")
return 1
if __name__ == "__main__":
sys.exit(main())