Skip to content

glm-mcp-copilot v1.3.0 — PreToolUse hook (full parity)

Latest

Choose a tag to compare

@djerok djerok released this 02 Jul 15:22

Full parity with the Claude Code edition. Copilot (VS Code) has agent hooks too — including a PreToolUse event — so this release adds the third and final primitive: an auto-routing hook.

New — PreToolUse auto-routing hook

  • glm_router_hook.mjs — the Copilot analog of the Claude glm_subagent_router hook. Before the default model does work itself, it injects advisory context nudging delegation to glm_agent (~10× cheaper), then lets the tool run.
  • Non-blocking — always returns permissionDecision: "allow"; it only advises, never denies.
  • VS Code ignores hook matchers, so the hook fires on every tool call and filters by tool_name internally — it skips glm_* and read-only tools and advises at most once per session (so it never spams you on every edit).
  • Installed to .github/hooks/glm.hooks.json per-project, or ~/.copilot/hooks/glm.hooks.json with --global.

The Copilot edition now has all three primitives

  1. glm_* MCP tools in agent mode (same server as the Claude edition)
  2. GLM custom agent (subagent) locked to the glm tools
  3. PreToolUse auto-routing hook (this release)

Remaining differences: VS Code hooks ignore the matcher (handled by internal filtering); hooks are a VS Code preview feature (enable in Copilot settings if hidden); and there's no separate glm-code full-GLM launcher. Everything downstream is the same server.

Install / upgrade

```bash
npx glm-mcp-copilot --key YOUR_ZAI_KEY # this workspace
npx glm-mcp-copilot --global --key YOUR_ZAI_KEY # all workspaces (server + subagent + hook + policy)
```

npm: https://www.npmjs.com/package/glm-mcp-copilot