feat: fold glean-vnext runtime MCP server into the glean plugin - #3
Open
eshwar-sundar-glean wants to merge 9 commits into
Open
feat: fold glean-vnext runtime MCP server into the glean plugin#3eshwar-sundar-glean wants to merge 9 commits into
eshwar-sundar-glean wants to merge 9 commits into
Conversation
Add sources/glean-vnext/ as a source plugin and merge it into the existing
`glean` emitted plugin (from: array) for claude/cursor/codex. The shipped
`glean` plugin now coexists with the portable skills: it bundles a local
stdio MCP server (glean-local) exposing find_skills/run_tool/setup, the
glean_run skill, and an auto-approve PreToolUse hook. A user may still
connect a remote Glean MCP server separately; the local server is named
glean-local to avoid clashing with a remote glean.
Source plugin layout (sources/glean-vnext/):
- plugin.pluginpack.json: files map (dist/index.js, start.mjs, package.json)
- .mcp.json: base config (glean-local, \${CLAUDE_PLUGIN_ROOT}/start.mjs)
- targets/codex/.mcp.json: codex override (./start.mjs + cwd ".")
- src/ (15 TS files) + build.mjs: server source + esbuild bundler
- tests/ (14 vitest files): server unit tests
- skills/glean_run, hooks/, start.mjs, package.json (runtime)
Build wiring:
- build:bundle runs esbuild (src -> sources/glean-vnext/dist/index.js)
- prebuild now chains sync-changelog && build:bundle before pluginpack build
- test:bundle / typecheck:bundle run the server suite scoped to the source dir
- deps: @modelcontextprotocol/sdk, yaml (runtime); esbuild, tsx, typescript,
vitest, @types/node (dev); overrides pin hono/esbuild/vite for CVEs
config (pluginpack.config.ts):
- claude glean: from += glean-vnext, components += hooks
- cursor glean: from += glean-vnext, components += hooks
- codex glean: from += glean-vnext (no hooks; matches existing codex shape)
Hook: server env lookup now checks mcpServers["glean-local"] first, falls back
to the legacy "glean" key.
Tests: npm test (build+validate) green (69/65/56 managed files);
npm run test:bundle 189/189; typecheck clean.
Requires @gleanwork/pluginpack@^0.8.0 (per-target MCP override + plugin-root
files features). Until published, use npm link @gleanwork/pluginpack against
the pluginpack branch.
…es; needs 0.8.1+)
eshwar-sundar-glean
force-pushed
the
eshwar/glean-vnext-fold-into-glean
branch
from
July 27, 2026 11:00
0f08d41 to
8508c28
Compare
Relocated to a personal docs folder (Desktop/docs/pluginsUnification) alongside the pluginpack-dataflow companion doc; it is a handoff/testing artifact, not product content that belongs in the plugin source repo.
eshwar-sundar-glean
marked this pull request as ready for review
July 27, 2026 16:28
Match the pluginpack review rename (gleanwork/pluginpack#11): the plugin-root files map key is now `additionalFiles`. npm test green (69/65/56).
…tures) pluginpack 0.9.0 shipped the per-target MCP override + additionalFiles features (gleanwork/pluginpack#11). Bump the dep off ^0.7.0 so `npm ci` in publish.yml installs 0.9.0 and the pluginpack-action builds each target's payload WITH the vnext runtime files/MCP. Removes the local npm-link workaround entirely. npm test green against the published version (69/65/56).
The pluginpack-action runs `npx pluginpack diff/build` directly, not `npm run build`, so the repo prebuild (esbuild) never fires. Since sources/glean-vnext/dist/index.js is gitignored, add an explicit build:bundle step in the publish job or pluginpack's additionalFiles source read fails for every target. (The validate job already builds it via npm test.)
Author
Release CI verified end-to-end (build → per-target payload → sync PRs)Dispatched Workflow run: https://github.com/gleanwork/agent-plugins/actions/runs/30330444116
Payload verified in the emitted output
Both pluginpack 0.9.0 features exercised for real
Note: each sync PR also carries pending updates to the existing — sent via Glean Pi |
Drop glean-vnext from the cursor glean plugin's `from:` and remove the now-orphaned `hooks` component. Cursor ships only the portable skills; claude and codex still bundle the local runtime server + hooks + glean_run skill. npm test green (cursor 62, claude 65, codex 56).
| # Generated build output (published to the target repos by CI) | ||
| dist/ | ||
| # glean-vnext runtime MCP server bundle (regenerated by build:bundle / prebuild) | ||
| sources/glean-vnext/dist/ |
There was a problem hiding this comment.
references to vnext should go away now
mohit-gupta-glean
approved these changes
Jul 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Moves the glean-vnext runtime MCP server out of
glean-experimental-pluginsinto this repo as a source plugin (sources/glean-vnext/) and folds it into the existinggleanemitted plugin via thefrom:array for claude/cursor/codex. The shippedgleanplugin now coexists with the portable skills: it bundles a local stdio MCP server (glean-local) exposingfind_skills/run_tool/setup, theglean_runskill, and an auto-approve PreToolUse hook. Users may still connect a remote Glean MCP server; the local server is namedglean-localto avoid a name clash.Draft PRs
What changed
sources/glean-vnext/— new source plugin:plugin.pluginpack.json(additionalFilesmap),.mcp.json(base),targets/codex/.mcp.json(codex override),start.mjs, runtimepackage.json,src/(15 TS),build.mjs(esbuild),tests/(14 vitest),skills/glean_run,hooks/.pluginpack.config.ts—glean-vnextadded to eachgleanfrom:;hooksadded to claude/cursorcomponents.package.json—build:bundlechained intoprebuild;test:bundle/typecheck:bundle; server deps + esbuild/vitest/tsx/typescript; CVE overrides.mcpServers["glean-local"]first (fixes prod bug from rename).Tests
npm testgreen (69/65/56 managed files).npm run test:bundle189/189.typecheck:bundleclean.Requires pluginpack ^0.9.0
Depends on gleanwork/pluginpack#11 (
additionalFiles+ per-target.mcp.jsonoverride), published as0.9.0. This repo now depends on^0.9.0directly — nonpm linkneeded.Release CI verified end-to-end
Dispatched
publish.ymlon this branch in sync mode. All three matrix jobs passed (Install → Build server bundle → Resolve pinned pluginpack version (0.9.0) → Mint token → Sync), andgleanwork/pluginpack-actionopened one machine-ownedpluginpack/sync-<target>PR per output repo (never pushed to their default branches).Workflow run: https://github.com/gleanwork/agent-plugins/actions/runs/30330444116
hooks/.mcp.json,dist/index.js,start.mjs,package.json,skills/glean_run/, plushooks/.glean-vnextfrom itsfrom:and thehookscomponent).componentsconfig working as designed..mcp.json→args: ["./start.mjs"]+"cwd": "."; claude →args: ["${CLAUDE_PLUGIN_ROOT}/start.mjs"]. Local server namedglean-localin both.Testing doc
The manual test workflow (Claude/Cursor/Codex) is maintained as a separate handoff artifact outside this repo (not product content), alongside the pluginpack dataflow doc.
Sequence diagrams
Build time — vnext folded into the
gleanpluginsequenceDiagram participant Dev as developer participant PB as npm test participant Pre as prebuild<br/>build:bundle (esbuild) participant PP as pluginpack build participant Merge as glean = from[glean-lib, shared, <target>, glean-vnext] Dev->>PB: npm test PB->>Pre: esbuild src/ -> sources/glean-vnext/dist/index.js Pre-->>PB: bundle ready PB->>PP: pluginpack build (per target) PP->>Merge: merge source plugins into one glean plugin Note over Merge: skills: 18 portable + glean_run<br/>files: dist/index.js, start.mjs, package.json<br/>.mcp.json: glean-local (codex override = ./start.mjs + cwd)<br/>hooks: claude/cursor only Merge-->>PP: emitted glean plugin PP-->>Dev: dist/{claude 65, cursor 69, codex 56} + Validation passedRuntime — local server in the host (Claude/Cursor/Codex)
sequenceDiagram actor User participant Host as Host (Claude Code) participant Launch as start.mjs participant Srv as dist/index.js<br/>glean-local MCP server participant Hook as auto-approve hook participant Glean as Glean backend Host->>Launch: node ${CLAUDE_PLUGIN_ROOT}/start.mjs Launch->>Srv: import dist/index.js (stdio) Srv-->>Host: tools: find_skills, run_tool, setup (state: unconfigured) User->>Host: "set up Glean, email me@acme.com" Host->>Srv: setup({email}) Srv->>Glean: resolve Server URL -> OAuth (browser) -> fetch tool catalog Glean-->>Srv: tokens + remote tools Srv-->>Host: configured (dynamic tools > 0) User->>Host: "find a skill / run it" Host->>Srv: find_skills -> run_tool Host->>Hook: PreToolUse(run_tool) Note over Hook: ENABLE_HITL=true -> auto-approve<br/>(HITL elicitation is the single gate) Hook-->>Host: allow (no native prompt) Srv->>Glean: execute tool Glean-->>Host: result