Skip to main content
Glama
Berlin Services MCP Server

Berlin Services MCP Server

by MananCoder29

Berlin Services MCP Server - Enhanced

A production-grade Model Context Protocol (MCP) server for Berlin city services (Dienstleistungen). It features resilient caching, advanced search, PDF form discovery, and filling capabilities.

Features

  • Comprehensive Tools: Search, browse, and get detailed information on Berlin services.

  • Form Management: Discover, analyze, and fill PDF forms for various services.

  • Resilient Caching: Optimized for performance with intelligent fallback for offline use.

  • Remote Sync: Supports both local and remote (Cloud) deployments.

Related MCP server: Berlin Open Data MCP Server

Technical Architecture

1. Data Sourcing

The server pulls data from the official Berlin City Services API

  • Live Fetching: Tools like search_services and get_service_details hit the live API.

  • Resilient Caching: Implements a dual-layer cache (Memory + Disk) to ensure high performance and offline reliability.

  • Smart Fallback: If the API is down and no cache exists, it falls back to a minimal set of core services to remain functional.

2. Advanced PDF Processing

Powered by PyMuPDF (fitz), the server provides sophisticated document handling:

  • Field Extraction: Automatically detects fillable fields in PDF forms hosted on the city's servers.

  • Intelligent Filling: Maps user data to PDF fields using smart matching and common translation fragments.

  • Loop Protection: Includes a LoopProtector to prevent redundant tool executions and LLM loops.

  • Visual Previews: Can render specific pages of a PDF to JPEG for a quick in-chat snapshot (useful for verification without leaving the chat).

3. Deployment Modes

  • Local Mode: Optimized for use with Claude Desktop. In this mode, open_file_locally can be used to open filled PDFs directly with your system's default viewer.

  • Remote/Cloud Mode: Designed for deployment on platforms like Fly.io or Railway. Replaces local file opening with secure synchronization and in-chat previews.

Prerequisites

  • Python 3.11 or higher

  • uv (recommended) or pip

Local Setup

Using uv (Recommended)

  1. Install dependencies and sync the environment:

    uv sync
  2. Run the server as a module:

    export PYTHONPATH=$PYTHONPATH:$(pwd)/src && uv run python -m berlin_mcp.main

    Note: If you've installed the package via uv sync, you can also just run:

    uv run berlin-mcp

Using pip

  1. Install dependencies:

    pip install -r requirements.txt
  2. Run the server:

    export PYTHONPATH=$PYTHONPATH:$(pwd)/src && python -m berlin_mcp.main

Claude Desktop Configuration

Add the following to your Claude Desktop configuration file. Replace /Users/mananshah/Desktop/Berlin-Services-MCP-Server with the actual absolute path to the folder.

macOS

File location: ~/Library/Application Support/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "berlin-services": {
      "command": "uv",
      "args": [
        "run",
        "--directory",
        "/Users/YourUser/Desktop/Berlin-Services-MCP-Server",
        "python",
        "-m",
        "berlin_mcp.main"
      ],
      "env": {
        "PYTHONPATH": "src"
      }
    }
  }
}

Windows

File location: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "berlin-services": {
      "command": "uv",
      "args": [
        "run",
        "--directory",
        "C:\\Users\\YourUser\\Desktop\\Berlin-Services-MCP-Server",
        "python",
        "-m",
        "berlin_mcp.main"
      ],
      "env": {
        "PYTHONPATH": "src"
      }
    }
  }
}

Tools and Resources

The server exposes the following tools to help you navigate and manage Berlin city services:

Tool

Description

search_services

Advanced search for Berlin services with paging and filters.

get_service_details

Get complete details about a service including forms and prerequisites.

get_service_forms

Get all forms associated with a service with detailed metadata.

search_forms

Search for forms across all services.

get_forms_by_type

Get all forms of a specific type across services.

get_service_prerequisites

Get all prerequisites and requirements for a service.

get_service_checklist

Get a comprehensive checklist for completing a service application.

analyze_form_for_filling

Download a PDF form and extract its fillable fields.

perform_form_filling

Fill a PDF form and save locally.

download_filled_form

Retrieve a filled PDF form.

get_form_visual_preview

Render a page of a filled PDF as an image.

open_file_locally

Open a file on the user's local system (Local setup only).

delete_filled_form

Manually delete a filled form from the server.

browse_services_by_category

Browse services by category.

find_online_services

Find all services available online.

get_service_locations

Get all locations for a service.

get_api_status

Get API and cache status diagnostics.

clear_cache

Clear the service cache and force refresh.

Security Note

PDF forms filled on remote servers should be downloaded and then deleted using the delete_filled_form tool to ensure data privacy.

Available Tools

18 tools
analyze_form_for_fillingC

Download a PDF form and extract its fillable fields.

Inputs: form_url (required). Returns: object

browse_services_by_categoryC

Browse services by category.

Inputs: category (required), page, page_size. Returns: object

clear_cacheB

Clear the service cache.

Inputs: no named parameters. Returns: object

delete_filled_formC

Manually delete a filled form.

Inputs: filename (required). Returns: object

download_filled_formC

Retrieve a filled PDF form.

Inputs: filename (required), only_preview, delete_after_read, ignore_size_limit. Returns: result

find_online_servicesD

Find all services available online.

Inputs: page, page_size. Returns: object

get_api_statusA

Get API and cache status diagnostics.

Inputs: no named parameters. Returns: object

get_forms_by_typeC

Get all forms of a specific type across services.

Inputs: form_type (required), page, page_size. Returns: object

get_form_visual_previewC

Render a page of a filled PDF as an image.

Inputs: filename (required), page_num. Returns: result

get_service_checklistC

Get a comprehensive checklist for completing a service application.

Inputs: service_id (required). Returns: object

get_service_detailsC

Get complete details about a service including forms and prerequisites.

Inputs: service_id (required). Returns: object

get_service_formsB

Get all forms associated with a service with detailed metadata.

Inputs: service_id (required), include_metadata. Returns: object

get_service_locationsC

Get all locations for a service.

Inputs: service_id (required). Returns: object

get_service_prerequisitesC

Get all prerequisites and requirements for a service.

Inputs: service_id (required). Returns: object

open_file_locallyC

Open a file on the user's local system.

Inputs: file_path (required). Returns: object

perform_form_fillingC

Fill a PDF form and save locally.

Inputs: form_url (required), field_data (required), flatten, force_recompute, +1 more. Returns: object

search_formsC

Search for forms across all services.

Inputs: query (required), page, form_type, page_size. Returns: object

search_servicesC

Advanced search for Berlin services with paging and filters.

Inputs: query (required), page, category, has_forms, +2 more. Returns: object

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    C2.8/5.0

    Scored across 18 tools

    Disambiguation4/5

    Most tools have distinct purposes, but some overlap exists (e.g., 'search_forms' vs 'get_forms_by_type', 'get_service_details' vs 'get_service_prerequisites'). Descriptions help disambiguate.

    Naming Consistency5/5

    All tools follow a consistent verb_noun pattern with snake_case naming. No mixing of conventions (e.g., 'get_service_details', 'search_services').

    Tool Count4/5

    18 tools is on the higher side but appropriate for the broad domain of Berlin services and forms. Each tool covers a distinct aspect without feeling bloated.

    Completeness3/5

    Covers many aspects (services, forms, filling, maintenance) but notably missing a 'list_filled_forms' tool despite having 'delete_filled_form'. Some operations for form lifecycle are incomplete.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      Enables interaction with Berlin's open data catalog through tools for full-text search, metadata retrieval, and dataset analysis. It provides access to over 2,500 datasets across categories like transport, health, and education using the Model Context Protocol.
      6
      5
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables AI assistants to prepare German freedom-of-information requests on FragDenStaat.de: identify the responsible authority with evidence, the applicable act and deadline, track requests, collect replies and attachments, and draft new requests locally before anything is sent.
      15
      MIT