run_server.py•1.19 kB
#!/usr/bin/env python
"""Run the Finizi B4B MCP server."""
import os
import sys
from pathlib import Path
# Ensure we're in the right directory and have the src in path
project_root = Path(__file__).parent
sys.path.insert(0, str(project_root / "src"))
# Set up environment variables if .env exists
env_file = project_root / ".env"
if env_file.exists():
from dotenv import load_dotenv
load_dotenv(env_file)
print(f"Loaded environment from {env_file}")
else:
print("No .env file found, using default configuration")
print("Copy .env.example to .env and configure as needed")
# Import and run the server
from finizi_b4b_mcp import mcp
if __name__ == "__main__":
print("\n" + "="*50)
print("Starting Finizi B4B MCP Server")
print("="*50)
print("\nAuthentication Tools Available:")
print(" - login(phone, password)")
print(" - logout()")
print(" - whoami()")
print("\n" + "="*50)
api_url = os.getenv("B4B_API_BASE_URL", "http://localhost:8000")
print(f"\nConfigured to connect to B4B API at: {api_url}")
print("Make sure the B4B API server is running.")
print("\n" + "="*50 + "\n")
# Run the server
mcp.run()