First-class install target + prompt-hook for ZCode (Z.ai)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 70/100
Research direction
Read the existing target implementations under src/installer/targets/ and the target registry entry mentioned in the issue. Add the ZCode target using the specified config location and mcp.servers.codegraph settings; treat the prompt hook as optional. Verify that codegraph install --target=zcode writes the MCP config, preserving existing settings where applicable.
Written by the indexing model from the issue text.
Description
Request
Add ZCode (Z.ai's coding agent harness, https://zcode.z.ai) as a first-class --target for codegraph install, so codegraph install --target=zcode writes the MCP config automatically.
Related: tracking issue #649 (zcode is already listed there from #962). Opening a dedicated issue to attach the concrete config format and hook details so the target is easier to land.
Why
ZCode is a first-class MCP + hooks-capable agent. Today, ZCode users have to hand-edit the MCP config. CodeGraph works great once configured manually — the ask is just the one-command install target like the other agents have.
What ZCode needs
1. MCP server config (install target)
ZCode reads MCP servers from ~/.zcode/cli/config.json (user scope) or <workspace>/.zcode/config.json (workspace scope), under mcp.servers:
{
"mcp": {
"servers": {
"codegraph": {
"type": "stdio",
"command": "codegraph",
"args": ["serve", "--mcp"],
"enabled": true,
"timeoutMs": 60000
}
}
}
}
That's it for MCP — same codegraph serve --mcp as everywhere else. A new file in src/installer/targets/ plus a registry entry, as you noted in #649.
2. (Bonus) UserPromptSubmit prompt-hook
ZCode also exposes a UserPromptSubmit hook that can inject context per turn. If CodeGraph shipped a prompt-hook for ZCode (analogous to what exists for Claude Code), it could inject relevant-symbols context on each prompt. This is optional — the MCP target alone is the main ask.
ZCode hooks docs: https://zcode.z.ai/cn/docs/hooks
ZCode plugin/MCP docs: https://zcode.z.ai/cn/docs/plugin
Config location summary
| Scope | Path |
|---|---|
| User | ~/.zcode/cli/config.json |
| Workspace | <workspace>/.zcode/config.json |
Happy to test a PR on Windows if that helps.
- Dominant language
- C
- Stars
- 73.2k
- Forks
- 4.7k
- Avg merge
- 2h 13m
- Merged PRs (30d)
- 418
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from colbymchenry/codegraph
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
colbymchenry/codegraph#2634 ·
Maintainers usually reply within 1 day
-
Windows: bundled Node v24.16.0 can abort at exit (nodejs/node#56645); please bundle Node >= 24.20.0Possibly taken @Ancienttwo claimed this 2 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
colbymchenry/codegraph#2617 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 Under an hour Newbie friendliness 72/100
colbymchenry/codegraph#2482 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
colbymchenry/codegraph#1900 · 2 comments · 5 reactions ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
colbymchenry/codegraph#1700 ·
Maintainers usually reply within 1 day
All issues in colbymchenry/codegraph
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 91/100
FujiNetWIFI/fujinet-firmware#2045 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 75/100
gbdev/homebrewhub-submit#20 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
OpenPrinting/cups#1772 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
snowballstem/snowball#311 ·