Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
- name: PrePluginPack
# The pluginpack-action runs `npx pluginpack diff/build` directly (not
# `npm run build`), so the repo's prebuild esbuild step never fires.
# sources/glean-vnext/dist/index.js is gitignored, so build it here or
# sources/local-mcp/dist/index.js is gitignored, so build it here or
# pluginpack's additionalFiles source read fails for every target.
run: npm run build:bundle

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Test

# Guard the source on every PR (and pushes to main): the transplanted
# glean-vnext server suite + typecheck, and a full build/validate of all
# local-mcp server suite + typecheck, and a full build/validate of all
# targets. publish.yml only runs on release, so without this nothing catches
# regressions before merge.
on:
Expand Down
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ node_modules/

# 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/
# local-mcp runtime MCP server bundle (regenerated by build:bundle / prebuild)
sources/local-mcp/dist/

# Claude Code runtime cache (glean-vnext skills cache written during local runs)
# Claude Code runtime cache (local-mcp skills cache written during local runs)
.claude/tmp/

# OS files
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
"type": "module",
"scripts": {
"build": "pluginpack build",
"build:bundle": "node sources/glean-vnext/build.mjs",
"build:bundle": "node sources/local-mcp/build.mjs",
"clean": "pluginpack clean",
"check:no-shell": "node scripts/check-no-shell-scripts.mjs",
"prune": "pluginpack prune",
"typecheck:bundle": "tsc --noEmit -p sources/glean-vnext/tsconfig.json",
"test:bundle": "vitest run --root sources/glean-vnext",
"typecheck:bundle": "tsc --noEmit -p sources/local-mcp/tsconfig.json",
"test:bundle": "vitest run --root sources/local-mcp",
"validate": "pluginpack validate --target claude --dir dist/claude && pluginpack validate --target cursor --dir dist/cursor && pluginpack validate --target codex --dir dist/codex",
"test": "npm run build && npm run validate",
"prebuild": "node scripts/sync-changelog.mjs && npm run build:bundle",
Expand Down
4 changes: 2 additions & 2 deletions pluginpack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default defineConfig({
},
plugins: {
glean: {
from: ["glean-lib", "shared", "claude", "glean-vnext"],
from: ["glean-lib", "shared", "claude", "local-mcp"],
components: ["skills", "agents", "hooks"],
displayName: "Glean",
description:
Expand Down Expand Up @@ -95,7 +95,7 @@ export default defineConfig({
},
plugins: {
glean: {
from: ["glean-lib", "codex", "codex-assets", "glean-vnext"],
from: ["glean-lib", "codex", "codex-assets", "local-mcp"],
components: ["skills", "assets"],
description:
"Official Glean plugin — search documents, Slack, and email; explore code across repos; find experts and stakeholders; prep for meetings and onboarding.",
Expand Down
12 changes: 6 additions & 6 deletions scripts/check-no-shell-scripts.mjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/usr/bin/env node
// CI guard: fail if any shell/bash script is added under the glean-vnext
// CI guard: fail if any shell/bash script is added under the local-mcp
// source tree.
//
// Why: the glean-vnext plugin ships and runs on end-user machines, including
// Why: the local-mcp plugin ships and runs on end-user machines, including
// Windows, where POSIX shell (.sh / bash) is not available. We already
// migrated the launcher from start.sh to start.mjs for exactly this reason.
// Every executable helper the plugin relies on must be cross-platform, so the
Expand All @@ -15,9 +15,9 @@ import fs from "node:fs";
import path from "node:path";
import { fileURLToPath } from "node:url";

// Scope: the glean-vnext plugin source. Broaden this list if the rule should
// Scope: the local-mcp plugin source. Broaden this list if the rule should
// cover other source trees too.
const SCAN_ROOTS = ["sources/glean-vnext"];
const SCAN_ROOTS = ["sources/local-mcp"];
// Never descend into generated/vendored trees.
const SKIP_DIRS = new Set(["node_modules", "dist", ".git"]);

Expand Down Expand Up @@ -69,11 +69,11 @@ if (offenders.length > 0) {
.sort()
.join("\n");
console.error(
`\n\u274c Shell/bash scripts are not allowed in the glean-vnext plugin source.\n\n` +
`\n\u274c Shell/bash scripts are not allowed in the local-mcp plugin source.\n\n` +
`Found ${offenders.length} shell script(s):\n${rel}\n\n` +
`The plugin runs on end-user machines including Windows, where POSIX shell\n` +
`is unavailable. Use a cross-platform Node.js script instead:\n\n` +
` - Write it as a .mjs file (see sources/glean-vnext/start.mjs).\n` +
` - Write it as a .mjs file (see sources/local-mcp/start.mjs).\n` +
` - Use Node built-ins (node:fs, node:path, node:child_process) instead of\n` +
` shell utilities, and avoid shell-only syntax.\n` +
` - Invoke it with "node <script>.mjs" so it works on Windows/macOS/Linux.\n`,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"mcpServers": {
"glean-local": {
"glean_plugin": {
"command": "node",
"args": ["${CLAUDE_PLUGIN_ROOT}/start.mjs"],
"env": {
Expand Down
4 changes: 2 additions & 2 deletions sources/glean-vnext/build.mjs → sources/local-mcp/build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ const nodeBuiltins = [
];

await build({
entryPoints: ["sources/glean-vnext/src/index.ts"],
outfile: "sources/glean-vnext/dist/index.js",
entryPoints: ["sources/local-mcp/src/index.ts"],
outfile: "sources/local-mcp/dist/index.js",
bundle: true,
platform: "node",
format: "esm",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ try {
const toolName = String(input.tool_name ?? "");
const bareName = toolName.split("__").pop() ?? "";
// Scope strictly to this plugin's run_tool — the tool name carries the glean
// plugin/server prefix (e.g. mcp__plugin_glean-vnext_glean__run_tool).
// plugin/server prefix (e.g. mcp__plugin_local-mcp_glean_plugin__run_tool).
if (!toolName.includes("glean") || bareName !== "run_tool") {
process.exit(0);
}
Expand All @@ -44,11 +44,16 @@ let env = {};
try {
const root = process.env.CLAUDE_PLUGIN_ROOT ?? ".";
const cfg = JSON.parse(fs.readFileSync(path.join(root, ".mcp.json"), "utf-8"));
// The server is named "glean-local" in the shipped .mcp.json (to avoid
// clashing with a user-connected remote "glean" server). Keep a fallback to
// the legacy "glean" key for backwards compatibility with older installs.
// The server is named "glean_plugin" in the shipped .mcp.json (namespaced
// under "glean" so it's recognizable alongside a user-connected remote
// Glean server, e.g. "glean_default"). Keep fallbacks to the prior names
// ("glean-local", then the original "glean") for backwards compatibility
// with older installs.
env =
cfg?.mcpServers?.["glean-local"]?.env ?? cfg?.mcpServers?.glean?.env ?? {};
cfg?.mcpServers?.["glean_plugin"]?.env ??
cfg?.mcpServers?.["glean-local"]?.env ??
cfg?.mcpServers?.glean?.env ??
{};
} catch {
// No readable config: do nothing.
}
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"description": "Glean runtime MCP server — a local stdio server (find_skills_and_tools, run_tool, setup), the glean_run skill, and an auto-approve hook. Folded into the glean emitted plugin so it coexists with the portable skills; 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 server.",
"description": "Glean runtime MCP server — a local stdio server (find_skills_and_tools, run_tool, setup), the glean_run skill, and an auto-approve hook. Folded into the glean emitted plugin so it coexists with the portable skills; a user may still connect a remote Glean MCP server separately. The local server is named glean_plugin to avoid clashing with a remote glean server.",
"additionalFiles": {
"dist/index.js": "dist/index.js",
"start.mjs": "start.mjs",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"mcpServers": {
"glean-local": {
"glean_plugin": {
"command": "node",
"args": ["./start.mjs"],
"cwd": ".",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ async function runHook(
const root = await fs.mkdtemp(path.join(os.tmpdir(), "approve-hook-"));
await fs.writeFile(
path.join(root, ".mcp.json"),
JSON.stringify({ mcpServers: { "glean-local": { env } } }),
JSON.stringify({ mcpServers: { "glean_plugin": { env } } }),
);
// Isolate the marker under a throwaway CLAUDE_PLUGIN_DATA so the hook never
// touches the developer's real ~/.glean during tests.
Expand Down Expand Up @@ -79,7 +79,7 @@ async function runHook(
}
}

const glean = (tool: string) => `mcp__plugin_glean-vnext_glean__${tool}`;
const glean = (tool: string) => `mcp__plugin_local-mcp_glean_plugin__${tool}`;
const hitlOn = { ENABLE_HITL: "true" };
const hitlOff = { ENABLE_HITL: "false" };
const bypass = { permission_mode: "bypassPermissions", session_id: "sess-1" };
Expand Down
File renamed without changes.