CWACoderWithAttitude/rmv-mcp-server
If you are the rightful owner of rmv-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
The RMV MCP Server is designed to enable Language Model Models (LLMs) to access and utilize public transport data from RMV, Germany, by interfacing with the RMV API.
= RMV MCP Server
Imagine you could ask questions about train connections, departure times, and station information using natural language. Like this one:
I'd like to go from Gross Gerau to the alt bischofsheim restaurant.
tomorrow evening.
https://claude.ai/share/46422223-8b62-4a44-ae0f-49c4575c9d4f[Which gets you exactly the information you need. ]
== TL;DR
MCP servers are addons to LLMs that enable the users to ask questions on YOUR data (in DBs, APIs, fielsystems,...) with natural language. This MCP Server enables LLMs to use data on trains, stations and connections provided by RMV, Germany.
== What's this project about?
To be honest the above description does not tell the full story. The MCP inventor Anthropic has a https://www.anthropic.com/news/model-context-protocol[full blown explanation] on MCPs.
This MCP server enables you to query stations, connections and departures from an LLM like Claude. It is built using the https://gofastmcp.com/getting-started/welcome[FastMCP] framework.
== Prerequisites
This example is build upon python3.13 and UV 0.8.13.
It usese https://claude.com[Claude Desktop] as LLM client and chat interface.
To access station and connection data, you need to acquire an API key. It can be requested free of charge from RMV at the https://opendata.rmv.de/site/start.html[RMV Open Data Portal].
Copy DOTEnv to .env and add the API key there.
=== Running MCP Server in Dev Mode
FastMCP provides a development mode that allows us to run and test our MCP server locally.
Start the server in dev mode:
[source,bash]
uv run fastmcp dev main.py
This will start the MCP server and open the MCP Inspector in your browser. Allowing you to inspect and debug your MCP server.
- Connect to your MCP sever (left column)
- Select
Toolsfrom the top menu. - Click
List Toolsbelow. It should revealsearch_stationsandget_connections. Select one of them. - The right hand side enables you to run the tool and inspect the results.
How cool is that!
=== Overview MCP Server Architecture
graph TD
subgraph RMV_MCP_Server
A[rmv_stdio.py] --> B[RMVService]
B[RMVService] --> C[RMV API]
end
subgraph Tests
D[test_rmv_stdio.py] --> A[rmv_stdio.py]
D[test_rmv_stdio.py] --> E[fastmcp.client.Client]
end
subgraph External_Services
C[RMV API]
end
subgraph FastMCP_Framework
A[rmv_stdio.py] --> F[FastMCP]
E[fastmcp.client.Client] --> F[FastMCP]
end
=== Claude Desktop Config
I'll show you how to run the RMV MCP server locally using UV and how to connect it to Claude Desktop. To make the service known to Claude Desktop you need to add its configuration to the Claude Desktop config file (see below).
Once you have it, you can enter it in Claude's config file.
Don't forget to update the file with your API key!
[source,json]
{
"mcpServers": {
"my_rmv-mcp-server": {
"command": "/Users/volker/.local/bin/uv",
"args": [
"--directory",
"/Users/volker/Dev/mcp/fast_mcp/rmv-mcp-server",
"run",
"rmv_stdio.py"
],
"env": {
"RMV_API_KEY": "<YOUR_API_KEY>"
}
}
}
}
After adding this restart Claude Desktop is needed.
You can tweak its settings and configuration in the
Settings->Connectorsmenu.
Links
- https://docs.astral.sh/uv/guides/integration/docker/#installing-uv[Installing UV]
- https://support.claude.com/en/articles/11175166-getting-started-with-custom-connectors-using-remote-mcp[Claude Custom connectors]
- Diagram generate with https://marketplace.visualstudio.com/items?itemName=swark.swark[Swark Mermaid Extension]