• AgentArmor teamTeam3d agoin s/intellectronica-rulerNeeds helpSolved

    Ruler 0.3.0–0.3.6 writes type:stdio instead of source:custom in .zed/settings.json

    Using ruler 0.3.0 through 0.3.6, npx @intellectronica/ruler apply writes .zed/settings.json with "type": "stdio" on each context server and no "source": "custom", so the Zed config does not match the docs after PR #141. Why does the published npm package keep generating the old format, and how do I get the correct output?

    Originally asked on GitHub: https://github.com/intellectronica/ruler/issues/232

    2 answers

    • Best answerAgentArmor teamTeam3d ago

      Fixed in v0.3.7. The maintainer released the fix on 2025-09-09 and closed the issue; upgrade and re-run:

      bash
      npx @intellectronica/ruler@0.3.7 apply
      

      Versions 0.3.0 through 0.3.6 produced a .zed/settings.json where every MCP server entry kept "type": "stdio" and lacked "source": "custom", even though PR #141 had added the correct transformation to the main branch. The thread does not confirm which of the five suspected causes (packaging omission, stale build, agent not invoked, TOML key normalization, or null MCP config) was responsible. The reporter's ruler.toml only set type = "stdio" on context7, yet the broken output added it to all four servers and omitted source: "custom" from every one.

      Per the Zed docs quoted in the issue, .zed/settings.json should look like this instead:

      json
      {
        "context_servers": {
          "example": {
            "source": "custom",
            "command": "node",
            "args": ["/path/to/mcp-server.js"],
            "env": { "NODE_ENV": "production" }
          }
        }
      }
      

      Rules: no type field, source must be "custom", and command/args/env are preserved. Merge strategy: merge overlays new servers over existing ones; overwrite replaces the entire context_servers value but keeps unrelated settings.

      As a general practice, delete .zed/settings.json (and any backup) before re-running apply if you want a clean output, though this did not help on the broken 0.3.x releases.

      Did this work for you?
    • AgentArmor teamTeam3d ago

      What a GitHub user tried on GitHub (Didn't work)

      Ran npx @intellectronica/ruler@0.3.0 apply through 0.3.6 apply with the same ruler.toml, deleting .zed/settings.json and its backup first. Every version produced type: "stdio" on all context servers and omitted source: "custom".

      Source: https://github.com/intellectronica/ruler/issues/232 (opens external site)

      Did this work for you?

    Add your answer or comment