BVG MCP Server

Local setup required. This server has to be cloned and prepared on your machine before you register it in Claude Code.
1

Set the server up locally

Run this once to clone and prepare the server before adding it to Claude Code.

Run in terminal
git clone <repository-url>
cd mcp-bvg
npm install
npm run build
2

Register it in Claude Code

After the local setup is done, run this command to point Claude Code at the built server.

Run in terminal
claude mcp add bvg-mcp -- node "<FULL_PATH_TO_MCP_BVG>/dist/index.js"

Replace <FULL_PATH_TO_MCP_BVG>/dist/index.js with the actual folder you prepared in step 1.

README.md

An MCP server for interacting with the Berlin Public Transport (BVG) API.

BVG MCP Server

A Model Context Protocol (MCP) server for interacting with the BVG (Berlin Public Transport) API. This server provides tools to search for locations, plan journeys, get real-time departures/arrivals, and more.

Features

This MCP server provides the following tools:

Location Search

  • bvg_locations_search: Search for stops, addresses, and points of interest
  • bvg_locations_nearby: Find nearby stops and POIs by coordinates

Stop Information

  • bvg_stop_details: Get detailed information about a specific stop
  • bvg_stop_departures: Get upcoming departures at a stop
  • bvg_stop_arrivals: Get upcoming arrivals at a stop

Journey Planning

  • bvg_journey_plan: Plan journeys from A to B using public transport

Trip and Vehicle Information

  • bvg_trip_details: Get detailed information about a specific trip
  • bvg_radar: Find vehicles in a geographic area with movement data

Installation

  1. Clone the repository:
git clone <repository-url>
cd mcp-bvg
  1. Install dependencies:
npm install
  1. Build the project:
npm run build

Usage

As an MCP Server

The server communicates via stdio and can be used with any MCP-compatible client.

npm start

Configuration for Claude Desktop

Add this to your Claude Desktop configuration file (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):

{
  "mcpServers": {
    "bvg-transport": {
      "command": "node",
      "args": ["/absolute/path/to/mcp-bvg/build/index.js"]
    }
  }
}

Configuration for VS Code

This project includes VS Code configuration files in the .vscode directory:

  • Tasks: Build, watch, start server, and test examples
  • Launch configurations: Debug the MCP server and examples
  • Settings: TypeScript and editor preferences
  • MCP Config: Ready-to-use MCP server configuration

To use with VS Code:

  1. Open the project folder in VS Code
  2. Use Cmd+Shift+P → "Tasks: Run Task" to access build tasks
  3. Use F5 to debug the MCP server
  4. The MCP configuration is available in .vscode/mcp-config.json

Example Queries

Here are some example queries you can make:

Search for Locations

Search for "Alexanderplatz" in Berlin

Find Nearby Stops

Find stops near coordinates 52.5200,13.4050 (Brandenburg Gate)

Get Departures

Get the next departures from Alexanderplatz station

Plan a Journey

Plan a journey from Alexanderplatz to Potsdamer Platz

API Reference

The server uses the BVG REST API v6: https://v6.bvg.transport.rest/api.html

Development

Scripts

  • npm run build: Compile TypeScript to JavaScript
  • npm run dev: Watch mode for development
  • npm start: Start the MCP server
  • npm test: Run example tests
  • npm run clean: Clean build directory

Project Structure

src/
├── index.ts              # Main MCP server
├── types/
│   └── bvg.ts           # TypeScript types for BVG API
├── utils/
│   └── api.ts           # HTTP client and utilities
└── tools/               # MCP tool implementations
    ├── locations.ts
    ├── nearby.ts
    ├── stops.ts
    ├── journeys.ts
    └── additional.ts

License

MIT License

MIT License

Tools (8)

bvg_locations_searchSearch for stops, addresses, and points of interest
bvg_locations_nearbyFind nearby stops and POIs by coordinates
bvg_stop_detailsGet detailed information about a specific stop
bvg_stop_departuresGet upcoming departures at a stop
bvg_stop_arrivalsGet upcoming arrivals at a stop
bvg_journey_planPlan journeys from A to B using public transport
bvg_trip_detailsGet detailed information about a specific trip
bvg_radarFind vehicles in a geographic area with movement data

Configuration

claude_desktop_config.json
{"mcpServers": {"bvg-transport": {"command": "node", "args": ["/absolute/path/to/mcp-bvg/build/index.js"]}}}

Try it

Search for 'Alexanderplatz' in Berlin and tell me the stop ID.
Find stops near coordinates 52.5200, 13.4050.
What are the next departures from Alexanderplatz station?
Plan a journey from Alexanderplatz to Potsdamer Platz.

Frequently Asked Questions

What are the key features of BVG MCP Server?

Search for Berlin transit stops, addresses, and points of interest. Retrieve real-time arrival and departure schedules for specific stops. Plan complex journeys between two locations in Berlin. Track vehicles in a specific geographic area using radar functionality. Access detailed trip information for transit routes.

What can I use BVG MCP Server for?

Commuters planning their daily route across Berlin using natural language. Developers testing transit-related AI agents with real-time BVG data. Tourists looking for the nearest public transport stops based on their current location. Monitoring vehicle movement and transit status in specific Berlin neighborhoods.

How do I install BVG MCP Server?

Install BVG MCP Server by running: git clone <repository-url> && cd mcp-bvg && npm install && npm run build

What MCP clients work with BVG MCP Server?

BVG MCP Server works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep BVG MCP Server docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare