Spaces:
Configuration error
Configuration error
Create geo_agent_mcp.py
Browse files- geo_agent_mcp.py +22 -0
geo_agent_mcp.py
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from mcp_server import serve
|
| 2 |
+
from geo_engine import compute_full_geo
|
| 3 |
+
from mcp_config import metadata
|
| 4 |
+
|
| 5 |
+
def geo_score_tool(input_text: str) -> dict:
|
| 6 |
+
"""
|
| 7 |
+
MCP entrypoint:
|
| 8 |
+
Given a brand name or URL, returns a JSON with:
|
| 9 |
+
- corpus_score
|
| 10 |
+
- structure_score
|
| 11 |
+
- quality_score
|
| 12 |
+
- hygiene_score
|
| 13 |
+
- geo_score (weighted average)
|
| 14 |
+
- recommendations (per category)
|
| 15 |
+
"""
|
| 16 |
+
return compute_full_geo(input_text)
|
| 17 |
+
|
| 18 |
+
if __name__ == "__main__":
|
| 19 |
+
serve(
|
| 20 |
+
geo_score_tool,
|
| 21 |
+
mcp_tool_metadata=metadata
|
| 22 |
+
)
|