Spaces:
Runtime error
Runtime error
File size: 1,210 Bytes
10d0d98 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | 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()
@mcp.tool()
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)
@mcp.tool()
def audit_shopfront(description: str) -> str:
"""
Perform an expert audit of a shopfront description or content.
"""
return agent_tools.audit_shopfront(description)
@mcp.tool()
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)
@mcp.tool()
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()
|