Skip to content

MCP Server

The fuk-mcp server exposes the Forstliche Umweltkontrolle database as Model Context Protocol tools. It lets any MCP-capable AI client — Claude Code / Desktop, Cursor, ChatGPT, or your own agent — read the ICP Forests monitoring data in plain language, without writing SQL or knowing the endpoints.

It is a thin, read-only layer in front of the same PostgREST API documented under Getting Started. The difference is the level of abstraction: the REST API returns raw rows and coded values, the MCP server returns resolved, plausibility-checked answers (plot names instead of codes, decimal coordinates, tree species instead of numbers) and links back to the matching dashboard page.

Access token required

The server holds the LFB API key, so it does not require every user to have one. Instead the MCP endpoint itself is protected by a bearer token. Request a token from Waldmonitoring@LFB.Brandenburg.de, the same way you would request an API key.

Endpoint

Production URLhttps://mcp.forstliche-umweltkontrolle.de/mcp
ProtocolMCP over streamable HTTP (JSON-RPC 2.0). The client sends an initialize request, receives an Mcp-Session-Id, and reuses it for every following call — MCP clients handle this automatically.
AuthAuthorization: Bearer <token>, or a ?token=<token> query parameter for clients that will not send a static header (e.g. VS Code)
Health checkGET https://mcp.forstliche-umweltkontrolle.de/health (no token)

This is not a page you open in a browser

An MCP endpoint speaks JSON-RPC over POST. Opening the URL in a browser sends a GET without a token and correctly returns 401 Unauthorized. Use an MCP client or curl as shown below.

Available tools

The server offers four topic tools for the common questions and four generic tools for everything else.

ToolWhat it does
list_plotsThe Level II monitoring plots with name, decimal coordinates, altitude, latest stand survey and dashboard link. Translates a plot name ("Kienhorst") into the plot code every other tool needs.
list_variablesWhich variables are measured (unit, description) and — per plot — by which instruments and over which period.
get_timeseriesDaily meteorology (mm_mem) for one plot and variable, aggregated to daily / monthly / yearly, with min / max / mean.
get_crown_conditionMean crown defoliation per survey year (cc_trc), optionally by tree species — the headline vitality indicator.
list_tablesThe tables and views of a schema.
describe_tableColumns, types and the ICP Forests documentation link for a table.
query_tableAny read query: column selection, filters, ordering, paging, exact count, JSON or CSV.
lookup_codeResolve the coded values (tree species, defoliation classes, variables …) against the ICP dictionaries.

The generic tools reach all four schemas: icp_download (measurements), icp_dictionaries (code lists), fuk (LFE helper views) and public (dictionary mirror).

Data quality

The tools remove the ICP Forests missing-value markers instead of averaging them in: -9999 in numeric fields, -1 in code_defoliation ("no assessment"), and meteorological values outside the plausibility range curated in fuk.d_variable_with_thresholds — the same range the dashboard charts use. get_timeseries reports how many values it excluded and accepts include_implausible: true when you need the untouched series.

Client configuration

Add the server to your MCP client. The exact file depends on the client (.mcp.json, .cursor/mcp.json, Claude Desktop's config), but the shape is the same:

json
{
  "mcpServers": {
    "fuk": {
      "type": "http",
      "url": "https://mcp.forstliche-umweltkontrolle.de/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_TOKEN_HERE"
      }
    }
  }
}

Once connected, the client lists the eight tools and you can ask questions in natural language.

VS Code

VS Code does not reliably forward a static Authorization header and instead tries an interactive OAuth login, which this server does not offer. Put the token in the URL as a ?token= query parameter (ideally via an input prompt, so it is not stored in the file):

json
{
  "servers": {
    "fuk": { "type": "http", "url": "https://mcp.forstliche-umweltkontrolle.de/mcp?token=${input:fuk-token}" }
  },
  "inputs": [
    { "id": "fuk-token", "type": "promptString", "description": "fuk-mcp token", "password": true }
  ]
}

Example questions

With the server connected, an assistant can answer questions like:

  • "Which monitoring plots are there in Brandenburg, and what tree species grow on them?" → list_plots
  • "Show the monthly air temperature at Grünewald in 2025." → get_timeseries
  • "How did crown defoliation at Kienhorst develop over the last five years?" → get_crown_condition
  • "What does tree species code 134 mean?" → lookup_code
  • "List the deposition measurements for plot 1206 since 2020 as CSV." → query_table

Quick test with curl

You do not need an MCP client to check that the server is reachable and your token works. Send an initialize request — a valid token returns 200 with the server info; a wrong or missing token returns 401:

bash
curl -i -X POST "https://mcp.forstliche-umweltkontrolle.de/mcp" \
  -H "Authorization: Bearer YOUR_TOKEN_HERE" \
  -H "Content-Type: application/json" \
  -H "Accept: text/event-stream, application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "initialize",
    "params": {
      "protocolVersion": "2025-06-18",
      "capabilities": {},
      "clientInfo": { "name": "curl", "version": "1" }
    }
  }'

The response carries an Mcp-Session-Id header; calling the tools by hand means replaying that id on every subsequent request. In practice you let an MCP client do that — the point of the server is to be used through one.

How it relates to the REST API and the Supabase MCP

  • The REST API is the right choice for scripts, R / Python analyses and bulk downloads — anything where you write the query yourself and want the raw data.
  • The fuk-mcp server is the right choice for AI assistants that should answer questions about the data in context, with codes resolved and implausible values removed.
  • The built-in Supabase MCP shipped with the database is a generic SQL / administration interface (execute_sql, migrations, logs) intended for development, not for public, domain-level questions.

All three read from the same database.