Spaces:
Runtime error
Runtime error
| from mcp.server.fastmcp import FastMCP | |
| from shopfront_agent.tools import ShopfrontAgentTools | |
| import os | |
| from dotenv import load_dotenv | |
| # Load environment variables | |
| load_dotenv() | |
| # Initialize FastMCP | |
| mcp = FastMCP("Shopfront-Architect") | |
| # Initialize Tools | |
| agent_tools = ShopfrontAgentTools() | |
| def generate_layout_plan(niche: str) -> str: | |
| """ | |
| Propose a high-level shopfront layout plan for a specific niche. | |
| """ | |
| return agent_tools.generate_layout_plan(niche) | |
| def audit_shopfront(description: str) -> str: | |
| """ | |
| Perform an expert audit of a shopfront description or content. | |
| """ | |
| return agent_tools.audit_shopfront(description) | |
| def get_best_practices(category: str, topic: str) -> str: | |
| """ | |
| Retrieve curated UX or SEO best practices. | |
| Args: | |
| category: 'ux' or 'seo' | |
| topic: The specific pattern or practice key. | |
| """ | |
| return agent_tools.kb.get_pattern(category, topic) | |
| def openai_chat(prompt: str) -> str: | |
| """ | |
| Directly query 'The Shopfront Architect' (gpt-4o) for expert advice. | |
| """ | |
| return agent_tools.llm.chat(prompt) | |
| def main(): | |
| mcp.run() | |
| if __name__ == "__main__": | |
| main() | |