You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was focused on geocontext and gpf-schema-store and did not look into mcp-carto enough till now. I should have.
Current status in production
The current happy path is
GeoContext v0.9.8
↓
returns:
method: POST
url: https://data.geopf.fr/wfs
query: {...}
body: cql_filter=...
get_url: https://data.geopf.fr/wfs?...&cql_filter=...
↓
LLM
takes get_url
↓
MCP Carto v0.1.2
receives get_url in layers[].data_url
↓
Carto UI
detects cql_filter
sends a POST request to data.geopf.fr/wfs
displays the GeoJSON
The less happy path is
GeoContext v0.9.8
↓
returns:
method: POST
url: https://data.geopf.fr/wfs
query: {...}
body: cql_filter=...
get_url: null
↓
LLM
cannot use the normal get_url → layers[].data_url handoff
↓
LLM may try to recover by rebuilding a long data_url from:
url + query + body.cql_filter
↓
MCP Carto v0.1.2
receives the rebuilt URL in layers[].data_url
↓
Carto UI
detects cql_filter in data_url
extracts cql_filter
removes cql_filter from the URL
sends a POST request to data.geopf.fr/wfs
↓
If the rebuilt URL is valid:
receives the GeoJSON
displays it on the map
↓
If the LLM fails to rebuild the URL correctly:
no GeoJSON is loaded
nothing is displayed
Expose a stable /layers/{id}.geojson URL from GeoContext so MCP Carto can consume a simple GeoJSON layer without knowing the underlying WFS complexity => Geocontext acting as WFS proxy
Store the request “recipe” in GeoContext rather than the result, then replay that recipe when Carto calls the layer URL. => Geocontext serving the POST request recipe via URL to bypass the LLM
Temporarily materialize the GeoJSON in GeoContext, then provide Carto with a simple URL pointing to the precomputed result => Geocontext acting as WFS caching proxy
Use an MCP resource from GeoContext to carry the GeoJSON or compiled request, then evolve Carto so it can consume that resource instead of a raw URL. => MCP resource are not supported by a lot of AI assistant
Pass query with references directly to MCP Carto and let Carto do the work of building the query once again. => a bit cumbersome
Discussion
Let's say we choose the /layers/{id}.geojson which proxifies the WFS interrogation => it smells like valkey + http routes of mcp-framework
I was focused on
geocontextandgpf-schema-storeand did not look intomcp-cartoenough till now. I should have.Current status in production
The current happy path is
The less happy path is
Another bad mistake I've just spotted : https://github.com/ignfab/mcp-carto/blob/166bcff0189c7ff1f605b0c90c188e127fde7d0e/server.ts#L64 => should be
result_type=requestwithgpf_wfs_get_featurestool !I wonder how it can work so well in demo 🤪
Possible solutions to stabilize the contract
Update MCP Carto to accept a structured
http_requestsource withmethod,url,query,headers, andbody, instead of only acceptinglayers[].data_url=> could be ok but we will still have this problem gpf_wfs_get_features - ensure that it doesn't returns huge geometries (4Mo) in cql_filter #151Expose a stable
/layers/{id}.geojsonURL from GeoContext so MCP Carto can consume a simple GeoJSON layer without knowing the underlying WFS complexity => Geocontext acting as WFS proxyStore the request “recipe” in GeoContext rather than the result, then replay that recipe when Carto calls the layer URL. => Geocontext serving the POST request recipe via URL to bypass the LLM
Temporarily materialize the GeoJSON in GeoContext, then provide Carto with a simple URL pointing to the precomputed result => Geocontext acting as WFS caching proxy
Use an MCP resource from GeoContext to carry the GeoJSON or compiled request, then evolve Carto so it can consume that resource instead of a raw URL. => MCP resource are not supported by a lot of AI assistant
Pass query with references directly to MCP Carto and let Carto do the work of building the query once again. => a bit cumbersome
Discussion
Let's say we choose the /layers/{id}.geojson which proxifies the WFS interrogation => it smells like valkey + http routes of mcp-framework