Repository navigation
mcp-data-platform-v1.148.0
Summary
v1.148.0 adds endpoints: a managed script bound to an HTTP route at /endpoints/{name}/... that answers each request with its handle(req) function. Endpoints come with the platform's own bot check (proof of work, or Cloudflare Turnstile or hCaptcha), and scripts can mint and verify signed tokens. That completes epic #2170. The built-in knowledge pages now cite one another and have an index page, and the Storage page waits for enough history before it shows a growth rate.
It also fixes a v1.147.0 regression: every /portal/assets/{id} URL answered 404. That broke share links for signed-in readers, notification links, the portal_url returned by save_asset and the exports, and any reload of an open asset. Deployments on v1.147.0 should upgrade.
The build moves to Go 1.27 and mcp-trino v1.8.0. A Parquet trino_export of a ROW column works again on the new Trino driver.
Upgrade notes in brief: two migrations run at startup (203, 204). Endpoints stay off until an administrator binds a script. Details under Upgrading.
New
Endpoints (#2171, #2172, #2173, #2174)
An endpoint answers HTTP with platform data: a lookup a partner system calls, a feed an automated client pulls with an API key, a page that sends a form. A request to /endpoints/{name}/... runs the bound script's handle(req) inline on the replica that received it.
Binding. A script has at most one binding, and an endpoint name is unique across the deployment. Bind with manage_script (endpoint_set, endpoint_list, endpoint_enable, endpoint_disable) or in the Endpoint section of a script's page under Automations. Only an administrator can create, change, enable or disable a binding, on either surface.
| Field | Default | Bound |
|---|---|---|
endpoint |
required | lowercase letters, digits, -, _; at most 63 |
methods |
GET |
GET, HEAD, POST, PUT, PATCH, DELETE; HEAD is answered wherever GET is |
path |
empty | /{id} style template, whole-segment parameters, at most 8 segments |
auth_mode |
required | public or signed_in |
open_reads |
false | GET and HEAD on a public endpoint need no bot check |
timeout_seconds |
10 | 1 to 60 |
max_memory_bytes |
64 MiB | 1 MiB to 1 GiB |
max_body_bytes |
1 MiB | 1 byte to 10 MiB |
allowed_origins |
none | at most 20 scheme://host[:port] origins |
rate_limit |
600 a minute | 1 to 100,000, per replica |
caller_rate_limit |
120 a minute | 1 to rate_limit, per replica |
- A script can be bound only when it defines a top-level
handle(req)that takes one parameter. Saving a bound script whose source no longer defines it is refused, and the refusal names the endpoint. - A script that defines
handlebut nomain()is a script, not a library. A library cannot be bound. - A public binding is refused while the deployment has no bot check, unless an administrator sets
allow_public_without_check.
The handler.
reqis a frozen dict:method,path,params,query,form,headers,body(bytes),jsonandcaller.headersis lower-cased and leaves outAuthorization,Cookie,X-API-KeyandProxy-Authorization.jsonis the parsed body when its content type is JSON; a body that claims JSON and is not gets a 400 before the script runs.caller(user_id,email,auth_type) comes only from the credential, or is None.- The handler returns
{status, headers, json | body}with a status from 200 to 599. It cannot setSet-Cookie,Content-Length,Transfer-Encoding,Connection,Content-Security-Policy,X-Content-Type-Options,X-Frame-OptionsorAccess-Control-*. - The request runs as
script:<name>with the roles of the version's author. Every platform call it makes is authorized by the persona filter, rate limited and audited, as a script run's calls are. The request has its own audit row, with sourceendpointand event kindendpoint_request, sharing a session id with the calls it made. - Each replica compiles a version once. Every request checks when its binding and script were last written, so the next request on any replica runs a newly saved version.
platform.exportandplatform.publish_datafail in a handler. A request writes noscript_runsrow.
Limits and failures.
| Answer | When |
|---|---|
| 404 | No enabled endpoint has the name, or the path does not match the template |
| 405 | The endpoint does not answer the method (Allow lists the ones it does) |
| 413 | The body is past max_body_bytes; the script does not run |
| 429 | Past rate_limit or the caller's caller_rate_limit, with Retry-After |
| 500 | The script failed or returned a malformed response |
| 503 | Past the memory budget, or the replica is already running 32 handlers (Retry-After: 1) |
| 504 | Past timeout_seconds |
Failed requests are listed on the script's page and kept 7 days.
Auth modes.
public: a request needs a bot check answer inX-Bot-Check, except GET and HEAD whenopen_readsis set. A missing, invalid, expired, reused or other-endpoint answer gets a 403 naming the reason. A check that cannot be made gets a 503.signed_in: a browser session (with CSRF checked on a write) or an API key. An anonymous request gets a 401 withWWW-Authenticate.
HTTP surface.
- CORS: an endpoint answers its own cross-origin requests from
allowed_originsand never allows credentials. A preflight from an unlisted origin gets a 403. - Rate limits: per endpoint, and per caller on
signed_in, on each replica. No limit uses the client address. - Headers: every answer carries
Content-Security-Policy: default-src 'none'; sandboxandX-Content-Type-Options: nosniff, andCache-Control: no-storeunless the handler set one. - Metrics:
endpoint_requests_total{endpoint,status_class}andendpoint_request_duration_seconds{endpoint}, andhttp_rate_limited_total{limiter="endpoint"}for 429s. Request metrics and the slow-request log carry the route template, never the path.
Docs: Endpoints
Bot checks (#2173)
Configured under Admin > Settings > Bot check or GET|PUT /api/v1/admin/settings/bot-check.
| Provider | What it is |
|---|---|
pow (default) |
The platform's own proof-of-work challenge. It calls no third party |
turnstile |
Cloudflare Turnstile, verified on the server |
hcaptcha |
hCaptcha, verified on the server |
none |
No check. A public endpoint is refused until allow_public_without_check is set |
- A page loads
/botcheck/solver.jsand callsPlatformBotCheck.answer("<endpoint>"). For proof of work it fetches a challenge fromGET /botcheck/challenge?endpoint=<name>and solves it. For Turnstile and hCaptcha it renders the provider's widget into a container you pass. - A proof-of-work challenge is signed with a key derived from
auth.browser_session.signing_key, bound to one endpoint, and answerable forchallenge_ttl_seconds(default 300). The default difficulty is 16 bits. Pastrate_thresholdanswers a minute (30), each doubling of the rate adds a bit, up tomax_difficulty(22). - Every accepted answer, provider tokens included, is recorded in PostgreSQL, so it cannot be replayed on any replica. Used answers are swept once their challenge has expired.
- The Turnstile or hCaptcha secret key is a stored secret (Admin > Secrets) whose
allow_connectionsnamesbot_checkand which lists no personas. It never appears in a response or a log.
Docs: Endpoints: Bot checks
Signed tokens in scripts (#2175)
platform.mint_token(claims, ttl, secret, endpoints=None, single_use=False) returns a signed token. platform.verify_token(token, secret) returns what it found. A handler can issue a token when a form opens, for example, and check it when the form is submitted.
claimsis a dict up to 4 KiB encoded, andttlis the token's lifetime in seconds, at most 30 days.secretnames a stored secret whoseallow_connectionslistsscript_token. If itsallow_personasnames personas, the persona the version author's roles resolve to must be one of them. The script never holds the key: the platform signs with HMAC-SHA256 under a key derived from the secret.- A token minted in an endpoint request is bound to that endpoint, or to the endpoints
endpointsnames. One minted in a scheduled run or a draft is bound to the script. verify_tokenanswers{"ok": True, "claims": ..., "expires_at": ..., "single_use": ...}, or{"ok": False, "reason": ..., "message": ...}with a reason ofexpired,tampered,other_endpoint,usedormalformed.- With
single_use=True, the accepting verify records the token's id, and a second verify on any replica answersused. A record is deleted once its token has expired. - Drafts and runs record mints and verifies with the secret's name, never its value. A script's tests replay that recording, so they need neither the key nor the database. The flow diagram shows each as a card.
Docs: Endpoints: Signed tokens
Built-in knowledge pages form a graph (#2200)
- The built-in pages now cite one another in prose, and each ends with the pages a reader goes to next.
- A new page, What the platform documents about itself (
platform-index), lists every built-in page with a one-line summary. It is generated from the shipped set, and the agent instruction baseline points to it. - An
mcp:knowledge_page:<slug>citation resolves to the live page with that slug. The portal links it and shows it in the graph and in backlinks. - References are derived on every start, so an upgraded deployment gets them with no page changed.
Docs: Knowledge
Fixed
Asset pages and share links answer 404 on v1.147.0 (#2205)
Since v1.147.0, every request for /portal/assets/{id} got a plain-text 404 page not found instead of the portal. That broke:
- share links (
/portal/view/{token}) opened by a signed-in reader, which redirect to the asset page - links in notifications
- the
portal_urlreturned bysave_assetand bytrino_export,api_exportandgraphql_export - reloading or bookmarking an open asset
Navigating inside the portal kept working.
Cause. v1.147.0 made a missing build file under /portal/assets/ answer 404 (#2139). The asset viewer's route is under the same prefix. A path there now counts as a build file only when it has an extension. Asset ids never have one, and a missing .js or .css file still answers 404.
A Parquet trino_export of a ROW column failed (#2183)
The new Trino driver (trino-go-client v1.2 and later) decodes a ROW into its own row type, which the Parquet writer refused with "expected a row". The writer now reads a row by position, top-level or nested inside an ARRAY, MAP or ROW.
A deployment page that cited a built-in page by slug lost all its references (#2200)
The reference write failed on a foreign key and dropped every reference the page made. A citation by slug is now stored as the page's id.
Storage growth rates waited for enough history (#2201)
- The 7-day rate now waits for a day of history, and the 30-day rate for a week. Until then, the Storage page says "Not enough history" with how much there is. A new install raises no fill-date alert from its first hours.
- A store holding one size grows at exactly 0, rather than at a small negative rate.
- A value under one byte reads "< 1 B" rather than "undefined".
- "No capacity known" links to the Storage settings.
Storage pages name SeaweedFS only where a bucket is on it (#2181)
- Storage page: the footer names only the capacity sources the report carries: the database limit, bucket budgets, the SeaweedFS cluster's disks, and each spool's volume. Before, it named SeaweedFS on every install.
- Storage settings: the SeaweedFS master and volume server fields appear only when a bucket is on SeaweedFS or a master address is already stored.
Smaller fixes (#2183)
- Resource handler errors are sanitized before they are logged (CodeQL
go/log-injection). - Webhook spool files and their lock file are created
0600, not0640.
Security and dependencies
- Go 1.27 (
go 1.27.0, toolchaingo1.27.2). Building from source now needs Go 1.27 or later. github.com/txn2/mcp-trinov1.8.0 andgithub.com/trinodb/trino-go-clientv1.4.1 (from v0.337.0).trino_queryreturns nested values as before: a ROW is the array of its field values, and a DATE or TIMESTAMP inside an ARRAY, MAP or ROW is the text Trino sent.- Go: go-pdfium 1.21.3, prometheus/client_golang 1.25.0, golang.org/x/tools 0.52.0, gqlparser 2.5.63, kin-openapi 0.151.0.
- Portal tooling: eslint 10.13.0, typescript-eslint 8.71.2, eslint-plugin-react-hooks 7.1.1, msw 3.0.3, jsdom 30.1.3, tsx 4.23.15.
- Scanning tools: golangci-lint v2.14.0, govulncheck v1.9.0, and gosec pinned to a master commit, because its latest release cannot load packages built by go1.27.2 (securego/gosec#1771). github/codeql-action 4.39.0.
- Not taken:
typescript7 (#2155), which typescript-eslint and openapi-typescript do not yet support.
Upgrading from v1.147.x
- Migrations:
000203_script_endpointsaddsscript_endpoints,script_endpoint_failuresandbot_check_answers.000204_script_token_usesaddsscript_token_uses.- Both run at startup and both have down migrations.
- Nothing is exposed by default: no route under
/endpoints/answers until an administrator binds a script. - Bot check: the default provider is proof of work, which needs
auth.browser_session.signing_key. Without it, the settings page says no challenge can be issued, and a public binding is refused until you set a provider orallow_public_without_check. - A proxy or CDN in front:
/endpoints/and/botcheck/answer CORS themselves rather than through the platform's CORS layer. A CDN may replace the body of the 504 an endpoint returns on timeout. - Knowledge pages: the first start derives the built-in pages' references, on every replica. Nothing needs to be done.
- API:
- New routes:
/endpoints/{name}and/endpoints/{name}/{rest...},GET|OPTIONS /botcheck/challenge,GET /botcheck/solver.js,GET|PUT /api/v1/admin/settings/bot-check,GET|PUT /api/v1/portal/scripts/{id}/endpoint, andPOST /api/v1/portal/scripts/{id}/endpoint/enableand/disable. GET /api/v1/admin/storagegainsseaweedfs_buckets, and each store gainshistory_hours,rate_7d_min_history_hoursandrate_30d_min_history_hours.rate_7d_bytes_per_dayandrate_30d_bytes_per_dayare nownulluntil there is enough history.- The audit event kinds gain
endpoint_request.
- New routes:
Docs
- New: Endpoints: binding, the handler, auth modes, bot checks, signed tokens, CORS, limits and observability
- API Gateway: the reserved
bot_checkandscript_tokennames for stored secrets - Knowledge: the built-in pages' citations and index
- Storage Capacity: history thresholds and the No capacity known link
- Data Retention and Observability: what the endpoint, bot check and token tables keep, and the endpoint metrics
- Installation: Go 1.27
Changelog
Features
- 725f9b4: feat(scripts): endpoints, scripts that answer HTTP requests (#2171) (#2202) (@cjimti)
- d0ed9a1: feat(scripts): signed tokens, built-in page graph, storage rates (#2175) (#2204) (@cjimti)
Bug Fixes
- 0a1601f: fix(portal): serve /portal/assets/{id} as the portal again (#2205) (#2207) (@cjimti)
- 54817c0: fix(storage): name SeaweedFS only where a bucket is on it (#2181) (#2182) (@cjimti)
Others
Installation
Homebrew (macOS)
brew install txn2/tap/mcp-data-platformClaude Code CLI
claude mcp add mcp-data-platform -- mcp-data-platformDocker
docker pull ghcr.io/txn2/mcp-data-platform:v1.148.0Verification
All release artifacts are signed with Cosign. Verify with:
cosign verify-blob --bundle mcp-data-platform_1.148.0_linux_amd64.tar.gz.sigstore.json \
mcp-data-platform_1.148.0_linux_amd64.tar.gzArchives and checksums also carry GitHub artifact attestations. Verify with:
gh attestation verify mcp-data-platform_1.148.0_linux_amd64.tar.gz \
--repo txn2/mcp-data-platform