gogo-backend-mcp
A lightweight MCP-powered backend for serving curated travel spots straight from model.spot. The FastMCP server in trip.py exposes tools that let any compatible client request the latest main attractions, supporting sites, and the top ten most popular destinations.
Features
major_views,sub_views, andtop_10_spotstools implemented via FastMCP.- SQLAlchemy ORM mapped through
model/spot.pywith GeoAlchemy spatial support. - Environment-driven configuration with
.envplus sensible defaults inutil/database.py.
Requirements
python -m pip install -r requirements.txt
Environment
Copy .env.example (if you create one) or create a .env file with at least:
DATABASE_URL=postgresql+psycopg://user:password@localhost/spot_db
LOG_LEVEL=INFO
util/database.py will fall back to postgresql+psycopg://postgres:password@localhost/spot_db when nothing is provided.
Database
- The app expects a PostgreSQL database with a
public.spottable matchingmodel.spot.Spot. - The table requires the PostGIS extension for the
locationgeometry column. - Apply your own migrations or schema creation outside this service; SQLAlchemy will not auto-create tables here.
Running locally
python trip.py
The MCP server listens on stdio and exposes three async tools:
major_views– active spots withpopularity > 3000.sub_views– active spots with1 < popularity < 3000.top_10_spots– ten most popular active spots.
Each tool returns JSON data from the respective helper in src/action.py.
Logging
util/logging_setup.py configures a single console handler; change LOG_LEVEL or wrap calls with your own handlers if you need file logging.
MCP Setup
This project uses FastMCP to create an MCP server. The server exposes three tools that clients can call to retrieve travel spot data.
{
"servers": {
"trip-mcp": {
"command": "uv",
"args": [
"--directory",
"/{Project Parent Location}",
"run",
"trip.py"
],
"env": {
}
}
// add your MCP stdio servers configuration here
// example:
// "my-mcp-server": {
// "type": "stdio",
// "command": "my-command",
// "args": [],
// "env": {
// "TOKEN": "my_token"
// }
// }
}
}
#� �g�o�g�o�-�b�a�c�k�e�n�d�-�m�c�p�6���