Repository navigation
Make the gateway URL environment-aware - #3
Conversation
Every manifest and adapter hardcoded https://mcp.nullshot.ai/mcp, and scripts/validate.mjs asserted it, so the plugin could only ever talk to production. Nullshot runs separate production, test, preview and local gateways, each with its own accounts, jams and grants. Installing this plugin while working against any of the others pointed a write-scoped agent at production data and gave no sign of it: the tools connect, the jams list, and none of it is the environment the user believes they are in. `NULLSHOT_MCP_URL` now selects the gateway, defaulting to production so an existing install is unaffected. Claude Code and Codex read it through `.mcp.json`, where `${VAR:-default}` expansion is documented for an HTTP server's `url`; the OpenCode and Pi adapters resolve it in code. Cursor, Kimi and Gemini read static manifests with no expansion I could verify, so they stay production-only and the README says so rather than implying otherwise. The existing canonical-URL assertion is satisfied by the default substring alone, so it would have stayed green if the override were later edited away. validate.mjs now also requires the override FORM in the manifests and the variable name in the two code adapters, and the tests cover an actual override taking effect. Reverting either change fails three tests and validate.
AGENTS.md said "Keep every MCP adapter pointed at https://mcp.nullshot.ai/mcp" — a contributor rule instructing the exact change this branch removes. Left as-is it would have walked the override back the next time someone followed the file. Now states the override as the rule, with the reason and a pointer to the validate check that enforces it.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
Bugbot Autofix is ON, but it could not run because the branch was deleted or merged before autofix could start.
Reviewed by Cursor Bugbot for commit 4d0604d. Configure here.
|
|
||
| const NULLSHOT_SERVER = { | ||
| url: "https://mcp.nullshot.ai/mcp", | ||
| url: NULLSHOT_URL, |
There was a problem hiding this comment.
Pi adapter rejects environment URL changes
Medium Severity
Once Pi has written a nullshot entry to mcp.json, a later NULLSHOT_MCP_URL that differs from that stored URL makes ensureNullshotConfig throw, so the extension does not load and cannot switch gateways.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 4d0604d. Configure here.
| }); | ||
| }); | ||
|
|
||
| test("OpenCode adapter points at the gateway named by NULLSHOT_MCP_URL", async () => { |
There was a problem hiding this comment.
Default adapter test ignores env override
Low Severity
The default OpenCode adapter test imports the module at load time and asserts the production gateway, so a developer who has NULLSHOT_MCP_URL set — the override this change introduces — fails the suite before the isolated override test runs.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 4d0604d. Configure here.
Reviewing this branch before merge caught an overclaim in it: I verified
`${VAR:-default}` expansion against Claude Code's documentation and then applied
it to Codex's file too, on the assumption that reading `.mcp.json` implied the
same semantics.
It does not. Codex does not expand `${VAR}` in MCP configuration —
openai/codex#2680 and #7521 are open requests for exactly that, and the
prevailing guidance is not to interpolate. Codex reaches
`plugins/nullshot/.mcp.json` through its plugin manifest, so this branch would
have registered a literal `${NULLSHOT_MCP_URL:-...}` as the server URL and
broken a path that works today. Being unable to change environment is a
limitation; a URL that is not a URL is an outage.
So expansion now applies only where it is verified: the Claude plugin manifest,
which is the file `claude plugin install` registers the server from, plus the
OpenCode and Pi adapters, which resolve the variable in code. The Codex file and
its root twin stay literal, and validate.mjs asserts BOTH directions — the
override present in Claude's manifest, and absent from Codex's.
Codex joins Cursor, Kimi and Gemini as production-only in the README, with the
reason stated rather than left as an omission.
`v0.2.0` was cut before #3, #4, #5 and #6, and every manifest still declared 0.2.0. Two consequences, both silent: - The README's own Pi row installs `@v0.2.0`, so a Pi user pasting it today gets a plugin that can only reach production, teaches `update_jam_todo` instead of atomic claims, and carries the two invented Codex commands. - Claude Code and Cursor read the version to decide whether an update exists. At an unchanged 0.2.0, an already-installed user is never offered any of it, including the Cursor gateway this branch adds. So the version moves to 0.3.0 in all eight places the validator checks, and the Pi row moves with it. `scripts/validate.mjs` now asserts the README's pinned tag matches package.json. It cannot prove the tag exists on the remote from here, but it makes the pin move with the version, which turns four releases of silent staleness into a release step someone has to take. **Merging this requires `git tag v0.3.0 && git push origin v0.3.0`** on the merge commit, or the Pi row points at a tag that is not there yet. Verified: validate green at 0.3.0, 12/12 tests. Non-vacuous — restoring only the README pin to v0.2.0 fails the new assertion. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
* Installing into Cursor now connects Cursor
`.cursor-plugin/plugin.json` declared `skills` and nothing else. A user who
completed Cursor's dashboard install got the planning skills — which name
`start_jam_task`, `upsert_jam_plan`, `list_available_work` — and no server to
call them on. Nothing errors in that state: the plugin is installed, the skills
load, the tools are simply absent. It is the least obvious way to be broken,
which is why it shipped.
The previous change documented this. This one fixes it.
## The manifest
`mcpServers` is a documented Cursor manifest field — a path, an inline object,
or an array — and the inline object here is the shape Cursor's own first-party
remote-MCP plugins use (`third_party/ahrefs`, `third_party/brevo`): no
transport gymnastics, inferred from `url`. It validates against Cursor's
published `schemas/plugin.schema.json`.
`commands` was missing for the same reason skills were not enough: ten command
files shipped in this repo that Cursor had no way to load.
## Why the URL stays literal
Cursor supports manifest `variables`, but they are values the user is PROMPTED
for, with no default. An unset one would write a literally unexpanded `${...}`
into the server URL — a broken server rather than a movable one, which is the
same reasoning that keeps `.mcp.json` plain for Codex. So Cursor remains
production-only, and the README now says where a non-production user goes
instead: the one-click Cursor button in Nullshot's Connect panel, which writes
that environment's gateway directly.
## Verification
- `node --test test/*.test.mjs`: 12 pass. The new test fails, and
`scripts/validate.mjs` throws, against the manifest as it shipped.
- The URL the manifest now carries answers `POST /mcp` with 401 and a
`WWW-Authenticate` naming its resource metadata, so the README's claim that
Cursor discovers OAuth from a 401 is true for Cursor for the first time.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
* Release 0.3.0, and stop the tag going stale again
`v0.2.0` was cut before #3, #4, #5 and #6, and every manifest still declared
0.2.0. Two consequences, both silent:
- The README's own Pi row installs `@v0.2.0`, so a Pi user pasting it today
gets a plugin that can only reach production, teaches `update_jam_todo`
instead of atomic claims, and carries the two invented Codex commands.
- Claude Code and Cursor read the version to decide whether an update exists.
At an unchanged 0.2.0, an already-installed user is never offered any of it,
including the Cursor gateway this branch adds.
So the version moves to 0.3.0 in all eight places the validator checks, and the
Pi row moves with it.
`scripts/validate.mjs` now asserts the README's pinned tag matches
package.json. It cannot prove the tag exists on the remote from here, but it
makes the pin move with the version, which turns four releases of silent
staleness into a release step someone has to take.
**Merging this requires `git tag v0.3.0 && git push origin v0.3.0`** on the
merge commit, or the Pi row points at a tag that is not there yet.
Verified: validate green at 0.3.0, 12/12 tests. Non-vacuous — restoring only
the README pin to v0.2.0 fails the new assertion.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
---------
Co-authored-by: rokt <[email protected]>
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>


The problem
Every manifest and both code adapters hardcode
https://mcp.nullshot.ai/mcp, andscripts/validate.mjsasserts it ascanonicalUrl. I checked every adapter for an override first —install-opencode.shhasNULLSHOT_PLUGIN_SOURCE/_REFfor the plugin source, but nothing anywhere overrides the MCP URL.So the plugin can only talk to production.
Nullshot runs separate production, test, preview and local gateways, each with its own accounts, jams and grants. Installing this plugin while working against any of the others points a write-scoped agent at production and gives no sign of it: the tools connect, the jams list, and none of it is the environment the user believes they're in. That's how it surfaced — debugging a jam on
test.nullshot.aiand finding the plugin could not reach it.The change
NULLSHOT_MCP_URLselects the gateway. Production stays the default, so an existing install is unaffected..mcp.json→${NULLSHOT_MCP_URL:-https://mcp.nullshot.ai/mcp}process.env.NULLSHOT_MCP_URLin the adapterThe
${VAR:-default}form is documented for an HTTP server'surlin.mcp.json, with a near-identical example. I did not find equivalent support I could verify for Gemini extensions, Kimi or Cursor manifests, so rather than guess I left those three literal and said so in the README instead of implying they work.The guard needed strengthening too
assert.ok(canonicalMcp.includes(canonicalUrl))is satisfied by the default substring alone —${NULLSHOT_MCP_URL:-https://mcp.nullshot.ai/mcp}containshttps://mcp.nullshot.ai/mcp. So validate passed before and after my change, and would have kept passing if someone later edited the override away, quietly restoring the original bug.validate.mjsnow also requires the override form in the three manifests and the variable name in the two code adapters.Verification
node scripts/validate.mjsclean ·node --test test/*.test.mjs8 pass, 0 fail (2 new).Non-vacuous — reverting the override in
.mcp.jsonand the OpenCode adapter:One new test exercises a real override end to end (fresh module import, since the adapter resolves its URL once at import time) and restores the previous env value in a
finally.Not included
The skills are also out of date — they instruct
update_jam_todofor task progress, which the gateway's own instructions now forbid in favour ofstart_jam_task/heartbeat_jam_task/complete_jam_task. That's a separate PR so this one stays reviewable.Note
Medium Risk
Write-scoped agents can now target non-production gateways when misconfigured, but the change fixes silent production writes for non-prod users; default behavior is unchanged.
Overview
MCP gateway selection is no longer hardcoded to production.
NULLSHOT_MCP_URLoverrides the defaulthttps://mcp.nullshot.ai/mcp; unset env keeps existing installs on production.Claude Code and Codex manifests (root and canonical
.mcp.json,.claude-plugin/plugin.json) use${NULLSHOT_MCP_URL:-…}expansion. OpenCode and Pi resolve the same variable in adapter code at load time. README and AGENTS.md document how to pick test/preview/local gateways and note that Cursor, Kimi, and Gemini still use static manifests (production-only).Validation and tests were tightened so
validate.mjsandtest/adapters.test.mjsrequire the overridable URL form in JSON manifests andNULLSHOT_MCP_URLin the JS/TS adapters—preventing a regression where the canonical URL substring alone would still pass checks after removing the override.Reviewed by Cursor Bugbot for commit 4d0604d. Bugbot is set up for automated code reviews on this repo. Configure here.