Spaces:
Configuration error
Configuration error
Create mcp_server.py
Browse files- mcp_server.py +17 -0
mcp_server.py
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from fastapi import FastAPI
|
| 2 |
+
from pydantic import BaseModel
|
| 3 |
+
from geo_engine import get_optimizations
|
| 4 |
+
|
| 5 |
+
app = FastAPI()
|
| 6 |
+
|
| 7 |
+
class Input(BaseModel):
|
| 8 |
+
keyword: str
|
| 9 |
+
|
| 10 |
+
@app.post("/tools/geo-agent")
|
| 11 |
+
def geo_agent(input: Input):
|
| 12 |
+
results = get_optimizations(input.keyword)
|
| 13 |
+
return {
|
| 14 |
+
"tool_name": "geo-agent",
|
| 15 |
+
"description": "GEO Agent - Generative Engine Optimization Tool",
|
| 16 |
+
"outputs": results
|
| 17 |
+
}
|