docs(publishing): match the MCP page to the shipped server#330
Conversation
Publisher consolidated its MCP surface onto a single endpoint in malloydata/publisher#884, and this page was never updated. Following it today points an agent at a port that is not listening, and at four tools that no longer exist. Verified against the published @malloy-publisher/[email protected] over MCP rather than against the source tree: - The second agent server on :4041 (AGENT_MCP_PORT) is gone. Nothing listens there, and the setting appears nowhere in the codebase. Everything is served from :4040, so the separate "Agent Retrieval Tools and Skills" section folds into MCP Tools. - malloy_projectList, malloy_packageList, malloy_packageGet, and malloy_modelGetText were removed. tools/call returns "Tool not found", and they did not move to resources: resources/list is empty. Progressive malloy_getContext replaced them, so Discovery documents that instead. - The parameter is environmentName, not projectName. - The bridge download 404s: #884 deleted packages/server/dxt/malloy_bridge.py. The bridge still ships inside packages/server/malloy_mcp.dxt and still targets :4040, so the section points there and shows how to unpack it. Two parameter contracts are documented the way the server actually enforces them, since both fail in ways a reader would not predict: - malloy_executeQuery needs sourceName alongside queryName. Running a view with queryName alone fails with "Reference to undefined object"; the server's own constant says "Either 'query' or both 'sourceName' and 'queryName' must be provided". - malloy_getContext ignores packageName unless environmentName is set, and returns the environment list rather than an error, so the discovery steps are documented as needing the ones before them. One thing the page never said, verified against the shipped server rather than assumed: - The endpoint is unauthenticated and Publisher binds 0.0.0.0 by default (server.ts:160), which the MCP listener uses (server.ts:1859), so the npx command at the top of this page exposes malloy_executeQuery on every interface rather than loopback. Publisher's own AGENTS.md and docs/ai-agents.md both carry this warning; the public page did not. The wording here is taken from docs/ai-agents.md rather than invented. Worth a separate issue: publisher's --help (server.ts:105) claims the default is localhost, which is wrong, and is plausibly how the localhost framing reached these docs. This documents only what 0.0.227 serves. malloy_compile and malloy_reloadPackage are on publisher main but not in a release yet, so they are left for the release that carries them. Signed-off-by: Monty Lennie <[email protected]>
The page listed three tools; the shipped server serves five. The two missing ones close the edit-and-run loop, which is the thing an agent most needs and the reason the page exists. They were left out on purpose when this branch was written, because the then current release predated them. That stopped being true when 0.0.228 shipped, so the page would have landed already incomplete. States plainly that compiling before reloading is a speed-up rather than a safety measure: a failed reload keeps serving the previously compiled model. Signed-off-by: Monty Lennie <[email protected]>
|
Pushed a second commit that widens this slightly beyond what the description says, so flagging it rather than letting it pass as a rename. Two tools added. The page documented three tools; the shipped server serves five. One correction that is a scope expansion, and the reason I am commenting. The Quick Start warning said the unauthenticated endpoint meant anyone who can reach port 4040 could run Publisher's own That matters more than a normal docs nit because Deliberately not written: a "compile before reload for safety" rule. A failed reload leaves your files alone and keeps serving the previously compiled model, so compiling first is a speed-up for diagnostics, not a safety measure. Saying otherwise would have described the pre-#890 world. Build is green and I checked the rendered output rather than just the source. |
Publisher consolidated its MCP surface onto a single endpoint in publisher#884, and this page was never updated to match. A reader who follows it today configures their agent to a port that is not listening, and calls four tools that return
Tool not found.I checked every claim against the published
@malloy-publisher/[email protected]over MCP rather than reading the source, since that package is what thenpxcommand at the top of this page actually installs.What the page claimed, and what 0.0.227 does
:4041, set byAGENT_MCP_PORT, with a config block pointing athttp://localhost:4041/mcp:4041, andAGENT_MCP_PORTappears nowhere in the codebase. Everything is served from:4040malloy_projectList,malloy_packageList,malloy_packageGet,malloy_modelGetTexttools/callreturnsMCP error -32602: Tool ... not found. They did not move to resources either:resources/listandresources/templates/listare both emptyprojectNameenvironmentNamemalloy_executeQuerytakesprojectName,packageName,modelPath,queryenvironmentName,packageName,modelPath.queryis optional, becausequeryNameruns a named query or view insteadpackages/server/dxt/malloy_bridge.pyWhat changed
The
:4041section folds into MCP Tools, since there is only one endpoint now. That section documents the three tools the server actually serves:malloy_getContext,malloy_executeQuery,malloy_searchDocs.Discovery now documents progressive
malloy_getContext, which is what replaced the four removed tools. Every parameter is optional, so an agent can start with nothing and narrow down. Calling it with no arguments returns the environments and their packages:{"results":[{"kind":"environment","name":"malloy-samples","packages":["ecommerce","faa","imdb"]}]}The stdio bridge still works, so that section is fixed rather than dropped. The script now ships inside
packages/server/malloy_mcp.dxt, a Desktop Extension bundle, and still targetshttp://localhost:4040/mcp. Hosts that install.dxtfiles can use it directly; everyone else can unpack it, and the documentedunzipcommand is one I ran.Two parameter contracts documented the way the server enforces them
Both fail in ways a reader would not predict, and I got both wrong on the first pass:
malloy_executeQueryneedssourceNamealongsidequeryName. Running a view withqueryNamealone fails withReference to undefined object, because the server emitsrun: top_categorieswith nothing to resolve it against. The server's own constant says "Either 'query' or both 'sourceName' and 'queryName' must be provided". This matters more than it sounds: the samples carry 42 views against 1 top-level query, and this page's own "Define Common Views" section steers readers toward views, so the bare-queryNamepath I first documented would have worked for roughly 1 entity in 43.malloy_getContextignorespackageNameunlessenvironmentNameis set, and returns the environment list rather than an error. It fails silently, which is the worst shape, so the tiers are documented as cumulative and the silent-ignore is stated outright.One thing the page never said
The endpoint is unauthenticated, and Publisher binds
0.0.0.0by default (server.ts:160), which the MCP listener uses (server.ts:1859). So thenpxcommand at the top of this page exposesmalloy_executeQuery, and therefore the databases your models connect to, on every interface rather than loopback. Publisher's ownAGENTS.mdanddocs/ai-agents.mdboth carry that warning; this page did not, which made it the only current description of the MCP surface without it. The wording is lifted fromdocs/ai-agents.mdrather than invented, and I confirmed--host 127.0.0.1really does reach the MCP listener.Worth a separate publisher issue:
--help(server.ts:105) advertises--host ... (default: localhost)while the code defaults to0.0.0.0. The--helptext is wrong, and is plausibly how the localhost framing reached these docs in the first place.What I deliberately did not add
malloy_compileandmalloy_reloadPackagelanded on publishermainin publisher#887, but 0.0.227 was cut before that merged, so they are not in any release yet. Documenting them here would tell readers about tools their server does not have, which is the same defect this PR is fixing. They belong in the update that follows the release carrying them.Verification
npm run build-prodgreen ("All docs compiled in 10.235s"). I checked the renderedmcp_agents.html, not just the source: no4041,projectName, removed tool names, or the dead bridge path survive; the three tool tables render as real HTML; and themalloy_mcp.dxtlink renders as a working anchor.A sweep of the rest of the site found no other page carrying the same claims.
Every claim above was checked against the running server, not inferred: the tool list and parameter contracts came from
tools/list, the removals fromtools/callandresources/list, and the two parameter fixes from actually running a view both ways. Theunzipcommand and the bridge test command in this page are both ones I ran end to end against 0.0.227, and the bridge returned exactly the three tools documented here.