zcode-config-valid¶
ZCode .zcode/config.json hooks and MCP servers must match ZCode's schema
| Severity | error (auto) |
| Autofix | - |
| Since | v0.23.0 |
| Repo Types | zcode-project |
| Category | ZCode |
Why¶
ZCode reads project hooks and MCP servers from .zcode/config.json in every
directory from the session's working directory up to the git root. It
validates the file's hooks section against one strict schema, so a single
misplaced key makes ZCode discard the entire file: every project hook and
every MCP server in it. A typical mistake is an event written directly under
hooks instead of under hooks.events. An invalid MCP server is less
costly: ZCode skips that server and loads the rest.
Project hooks also need workspace trust before ZCode runs them. This rule checks only their shape.
Severity¶
All findings are errors.
The whole file is ignored:
- Invalid JSON, or a file that is not an object.
- A
hookskey other thanenabled,timeoutMs,maxOutputBytesandevents. - An event under
hooks.eventsthat ZCode does not run, or one that is not an array. - A matcher group or handler ZCode cannot read: an empty
matcher, nohooksarray, atypeother thancommandorprocess, a missingcommand, or a wrongly typed field. - An
mcpvalue that is not an object.
One MCP server, or all of them, is skipped:
mcp.serversthat is not an object (all servers).- A server with no
typeand neither acommandnor aurl, atypeother thanstdio,httporsse, a key that type does not accept, an emptycommandorurl, orenv,headersorargsof the wrong type.
How to fix¶
Nest events under hooks.events, and give each MCP server one transport's
keys:
{
"hooks": {
"events": {
"PostToolUse": [
{ "matcher": "Write|Edit", "hooks": [{ "type": "command", "command": "make fmt" }] }
]
}
},
"mcp": {
"servers": {
"docs": { "type": "http", "url": "https://docs.example.com/mcp" }
}
}
}
Configuration¶
Run skillsaw explain zcode-config-valid to see this documentation and the rule's effective configuration in your terminal.