# glm-mcp

GLM (Zhipu / Z.ai) as a **cheap delegate** for any AI coding agent, exposed as an
[MCP](https://modelcontextprotocol.io) (Model Context Protocol) server over stdio.
This is the **standalone server** behind [`glm-mcp-claude`](https://www.npmjs.com/package/glm-mcp-claude)
and [`glm-mcp-copilot`](https://www.npmjs.com/package/glm-mcp-copilot) — usable by any MCP client
(Claude Desktop, Cursor, Windsurf, Glama, …).

## Quickstart (any MCP client)

```json
{
  "mcpServers": {
    "glm": {
      "command": "npx",
      "args": ["-y", "glm-mcp"],
      "env": { "GLM_API_KEY": "YOUR_ZAI_KEY" }
    }
  }
}
```

## Tools

- **`glm_agent`** — run GLM as a file-accessing coding agent (read/write/edit/run) on GLM tokens.
- **`glm_delegate`** — text-in/text-out subtask on GLM (no file access).
- **`glm_recommend`** — free advisory: GLM vs Opus, which model, and why.
- **`glm_status`** — free status: peak window, model picks, usage ledger, config health.

## Config

The server boots and answers MCP introspection **without** an API key, but every GLM call needs
`GLM_API_KEY` (your Z.ai / Zhipu GLM Coding Plan key — https://z.ai). See [`.env.example`](./.env.example)
for all tuning knobs (model picks, peak window, token cap, cost bias, …).

## Full docs

Repo + installers + design notes: **https://github.com/djerok/glm-mcp**

## License

MIT © [djerok](https://github.com/djerok)
