Skip to content
Back to search

dsfl-codemode-gateway

Code-mode MCP gateway (FastMCP) over the BGT, CBS wijken en buurten and subsurface MCP servers, with stateless geo functions

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/orchardsol--dsfl-codemode-gateway/badge.svg)](/listings/orchardsol--dsfl-codemode-gateway)

HTML

<a href="/listings/orchardsol--dsfl-codemode-gateway"><img src="/api/listings/orchardsol--dsfl-codemode-gateway/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 57 lines
  1. # dsfl-codemode-gateway
  2. A code-mode MCP gateway built with [FastMCP](https://gofastmcp.com) 4.2.2. It puts code mode in front of three existing MCP servers:
  3. - BGT, at `bag.ldproxy.net`
  4. - CBS wijken en buurten, at `bag.ldproxy.net`
  5. - subsurface models
  6. The client sees three tools: `search`, `get_schema` and `execute`. The model writes Python that calls the upstream tools inside a sandbox (Monty). Only what that code returns reaches the model's context.
  7. This was built for the AI-ready DSFL tests, to try "an agent with server-side code execution" as an execution environment.
  8. ## What's here
  9. | File | What it is |
  10. | --- | --- |
  11. | `gateway.py` | The gateway. Each upstream server is mounted under its own prefix (`bgt_`, `wijkenbuurten_`, `subsurface_`). The upstream servers' instructions are passed on, so the model gets the same guidance as with direct access. |
  12. | `geo.py` | Optional generic geo functions, mounted under `geo_`. They are stateless and know nothing about a dataset or a question. |
  13. | `gw.sh` | Starts or stops one gateway, found by its port. |
  14. | `probe.py`, `probe_calls.py`, `probe_geo.py` | Smoke tests against a running gateway. |
  15. The geo functions in `geo.py` cover:
  16. - coordinate transformation with PROJ, using RDNAPTRANS for RD New
  17. - measures in a metric CRS
  18. - spatial joins and relations
  19. - overlay
  20. - grid cells over polygons
  21. - zonal statistics
  22. - fetching every page of a collection tool
  23. - simplifying geometry
  24. ## Run
  25. You need [uv](https://docs.astral.sh/uv/) and Python 3.14.
  26. ```sh
  27. uv sync
  28. ./gw.sh start 18090 # plain gateway on http://127.0.0.1:18090/mcp
  29. ./gw.sh start 18091 geo # with the geo_ functions
  30. uv run python probe.py http://127.0.0.1:18090/mcp
  31. ./gw.sh stop 18090
  32. ```
  33. | Environment variable | Default | Meaning |
  34. | --- | --- | --- |
  35. | `CODEMODE_PORT` | `18090` | Port to serve on; the gateway listens on 127.0.0.1 only. |
  36. | `SUBSURFACE_URL` | `http://localhost:18082/mcp` | The subsurface-models MCP server. |
  37. | `GEO` | unset | Set to `1` to mount `geo.py`. |
  38. Each `execute` program may make up to 10,000 tool calls and is stopped after 280 seconds of wall-clock time. Nothing is kept between `execute` calls.
  39. The gateway needs no credentials: the upstream servers are public.
  40. ## License
  41. MIT, see [LICENSE](LICENSE).

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.