A simple MCP (Model Context Protocol) server with two functions to call RMV APIs for information about nearby stations and departure boards.
-
Install dependencies and create a virtual environment:
This project uses
uv, an extremely fast Python package installer and resolver which creates and manages virtual environments (likevenv). If you don't have it, see the official uv documentation to install it.uv init
By using uv, there is no need to explicetily create a venv and install requirements. All information about the uv project is in the file pyproject.toml. Consequently, there is no requirements.txt in this repo.
-
Configure your RMV Access ID:
- Create a
.envfile in the project root. - Add your RMV
ACCESS_IDto it:ACCESS_ID="your-rmv-api-access-id" - You can get an
ACCESS_IDfrom the RMV open data platform.
- Create a
-
Integrate the MCP server to Gemini CLI
Go and find the file .gemini/settings.json in your home directory. Add the following block:
"mcpServers": { "rmvServer": { "command": "uv", "args": [ "run", "--project", "/YOURPATH/rmv_mcp/", "/YOURPATH/rmv_mcp/rmv_server.py" ] }
},
```
In Gemini CLI check with /mcp the new MCP server:
rmvServer - Ready (2 tools)
Tools:
- get_departureboard
- get_nearbystations