GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - kannicht/mrcsx-mobility: Self-hosted MCP server for public transport integration

BranchesTags
Open more actions menu

Latest commit

 

History

8 Commits
8 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
src
src
 
 
tests
tests
 
 
.dockerignore
.dockerignore
 
 
.gitignore
.gitignore
 
 
Dockerfile
Dockerfile
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 
tsconfig.json
tsconfig.json
 
 

Repository files navigation

mrcsx-mobility

A lightweight, self-hosted Model Context Protocol (MCP) server for public transport integration.

Current version: 0.3.0

Features

  • Remote MCP server using Streamable HTTP
  • Mandatory OAuth 2.0 authentication
  • JWT access token validation with remote JWKS
  • Explicit OAuth client and user authorization
  • Public transport stop, address and place search
  • Transitous integration
  • Provider-independent mobility data model
  • Bounded in-memory TTL/LRU cache
  • Concurrent request deduplication
  • Upstream request rate limiting
  • Hardened, non-root Docker runtime
  • Automated unit, integration and container tests

MCP tools

Tool Description
mobility_ping Connectivity check with optional nonce
mobility_search_places Search stops, stations, addresses and places

All MCP tools are read-only and require authentication.

Journey planning, departures and real-time transport information are not yet implemented.

Example search

{
  "query": "Braunschweig Hauptbahnhof",
  "type": "stop",
  "limit": 5
}

Search results contain normalized geographic information, provider identifiers and available transport modes.

Addresses without provider identifiers return id: null and can be referenced using their coordinates.

Architecture

flowchart TD
    Client[MCP Client]
    OAuth[OAuth Authorization Server]
    HTTP[HTTP and MCP Server]
    Auth[Access Token Validation]
    Tools[MCP Tools]
    Provider[Mobility Provider]
    Cache[TTL/LRU Cache]
    API[Transitous API]

    Client -->|OAuth| OAuth
    Client -->|HTTPS / Bearer Token| HTTP
    HTTP --> Auth
    Auth -->|JWKS| OAuth
    Auth --> Tools
    Tools --> Provider
    Provider --> Cache
    Provider -->|Cache miss| API
Loading

The mobility provider is shared across MCP server instances within the application process.

Configuration

Server

Variable Default
MOBILITY_HOST 127.0.0.1 outside Docker
MOBILITY_PORT 3100
MOBILITY_PUBLIC_HOST Optional

OAuth

All OAuth variables are required.

Variable Description
MOBILITY_OAUTH_ISSUER HTTPS authorization server issuer
MOBILITY_OAUTH_RESOURCE Public HTTPS MCP resource URL
MOBILITY_OAUTH_JWKS_URI Authorization server JWKS URL
MOBILITY_OAUTH_SCOPE Required scope: mobility:read
MOBILITY_OAUTH_CLIENT_ID Authorized OAuth client UUID
MOBILITY_OAUTH_ALLOWED_SUBJECT Authorized user UUID

Pocket ID is the currently tested authorization server.

The application validates JWT signatures, token type, issuer, audience, expiration, issue time, client identifier, subject and required scope.

The server refuses to start without valid OAuth configuration. There is no unauthenticated MCP mode.

Transitous

Variable Default
MOBILITY_TRANSITOUS_BASE_URL https://api.transitous.org
MOBILITY_TRANSITOUS_USER_AGENT Required
MOBILITY_TRANSITOUS_TIMEOUT_MS 5000

The User-Agent must identify the application, version and operator contact information.

Example:

mrcsx-mobility/0.3.0 (mailto:[email protected])

HTTP endpoints

Endpoint Authentication
/health Public
/.well-known/oauth-protected-resource/mcp Public
/mcp Mandatory OAuth

Deploy behind an HTTPS reverse proxy. Do not expose the application's plain HTTP port directly to the internet.

The health endpoint indicates application availability, not upstream Transitous availability.

Provider resource limits

  • Request timeout: 5 seconds by default
  • Maximum response size: 1 MiB
  • Maximum concurrent upstream requests: 2
  • Minimum interval between upstream requests: 1 second
  • Cache TTL: 15 minutes
  • Maximum cache entries: 128
  • Maximum serialized cached value size: 4 MiB in total
  • No automatic retries
  • No background polling

These are application-level limits, not official Transitous quotas. They apply per provider instance.

Privacy

The application does not persist search queries or results.

Search queries and results are temporarily cached in memory. Search queries are transmitted to the configured external mobility provider.

OAuth access tokens, cookies and user identifiers are not forwarded to Transitous.

Operators and users should avoid including unnecessary personal information in search requests.

See the Transitous privacy policy: https://transitous.org/privacy/

Data sources and attribution

This project uses Transitous for public transport and geographic data.

  • Transitous: https://transitous.org/
  • Data sources: https://transitous.org/sources/
  • API usage policy: https://transitous.org/api/
  • © OpenStreetMap contributors: https://www.openstreetmap.org/copyright

Applications and MCP clients displaying results must preserve appropriate visible attribution and comply with the applicable data source licenses and API usage policies.

The MIT license of this project does not cover third-party transport or geographic data.

Development

Requirements:

  • Node.js 24
  • npm
  • Docker and OpenSSL for container smoke tests

Install dependencies:

npm ci --ignore-scripts

Run type checking and automated tests:

npm run check

Build the container and execute smoke tests:

docker build -t mrcsx-mobility:dev .
bash tests/docker/run.sh mrcsx-mobility:dev

Automated tests use simulated OAuth and Transitous endpoints. They do not require access to the public Transitous API.

Roadmap

  • v0.1.0: MCP connectivity
  • v0.2.0: Mandatory OAuth authentication
  • v0.3.0: Transitous and geographic search
  • Journey planning
  • Departure and arrival information
  • Real-time transport information
  • Additional provider implementations

License

MIT. See LICENSE.

About

Self-hosted MCP server for public transport integration

Topics

dockermcpmodel-context-protocoloauth2public-transportself-hostedtransitoustypescript

Resources

Readme
MIT license
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.