from mcp.server.fastmcp import FastMCP from business_manager.tools import BusinessManagerTools import os from dotenv import load_dotenv # Load environment variables load_dotenv() # Initialize FastMCP mcp = FastMCP("Business-Manager") # Initialize Tools manager_tools = BusinessManagerTools() @mcp.tool() def register_new_lead(client_name: str, email: str, requirements: str) -> str: """ Register a new potential ebook project and client. """ project = manager_tools.tracker.register_project(client_name, email, requirements) return f"New Lead Registered: {project['id']} for {client_name}. Status: Lead." @mcp.tool() def update_project_status(project_id: str, status: str) -> str: """ Update the status of an existing project (e.g., 'Lead', 'Quoted', 'Paid', 'Delivered'). """ project = manager_tools.tracker.update_status(project_id, status) if project: return f"Project {project_id} updated to status: {status}." return f"Error: Project {project_id} not found." @mcp.tool() def get_business_dashboard() -> str: """ Retrieve an LLM-powered summary of the business's current health and projects. """ return manager_tools.get_business_summary() @mcp.tool() def get_workflow_advice(project_id: str) -> str: """ Get strategic advice on the next steps for a specific project. """ return manager_tools.orchestrate_workflow(project_id) @mcp.tool() def consult_kb(category: str) -> str: """ Consult the business knowledge base for 'legal', 'rates', or 'policies'. """ info = manager_tools.kb.get_info(category) return f"Business {category.capitalize()} Info:\n{info}" def main(): mcp.run() if __name__ == "__main__": main()