shopfront-mcp-agent / server.py
Brettapps's picture
Upload folder using huggingface_hub
10d0d98 verified
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()