Commit b10a96b
authored
Preapprove house MCP tools for Codex (#1512)
Fixes #1511.
## What changed
- Add `mcp_servers.<name>.default_tools_approval_mode = "approve"` to
generated Codex MCP soft defaults.
- Keep it soft, so user config can still override the server default or
a single tool.
- Add an eval assertion covering the generated entry.
## Validation
- `nix-instantiate --parse lib/util/mcp.nix`
- `nix-instantiate --parse tests/default.nix`
- `nix eval --raw --impure --expr 'let flake = builtins.getFlake
(toString ./.); in builtins.toJSON (flake.lib.mcp.toCodexEntries { index
= { transport = "stdio"; command = "/bin/ix-mcp"; args = [ "serve" ]; };
})'`
- `nix eval --raw --impure --expr 'let flake = builtins.getFlake
(toString ./.); tests = import ./tests { nixpkgs = flake.inputs.nixpkgs;
ix = flake.lib; paths = flake.lib.paths; }; in builtins.toJSON
tests.groups.mcp'`
- `nix build .#codex -L --no-link --print-out-paths`, then read the
generated launch spec and confirmed
`mcp_servers.index.default_tools_approval_mode` is present with value
`"approve"`.
Skipped full `nix build .#check`: it fails before reaching this change
because `repoPackages.nix-fast-build` is missing at
`lib/per-system.nix:245`.
(sent by an AI agent via Claude Code)
<!-- Macroscope's pull request summary starts here -->
<!-- Macroscope will only edit the content between these invisible
markers, and the markers themselves will not be visible in the GitHub
rendered markdown. -->
<!-- If you delete either of the start / end markers from your PR's
description, Macroscope will append its summary at the bottom of the
description. -->
> [!NOTE]
> ### Preapprove house MCP tools for Codex by setting
`default_tools_approval_mode` to `approve`
> - Updates `codexEntriesOne` in
[mcp.nix](https://github.com/indexable-inc/index/pull/1512/files#diff-30f208a31e39d4388eb8b510d8a6962b9cd1a5d7b074429d38190a855a620744)
to prepend a `mcp_servers.<name>.default_tools_approval_mode =
"approve"` entry for every MCP server (both stdio and http), so house
tools are trusted by default without requiring user confirmation.
> - Adds a test group in
[tests/default.nix](https://github.com/indexable-inc/index/pull/1512/files#diff-1cc580de297308d93d82f7b72446ae4b98832a8aae3378e9e134102519a0e33a)
that asserts the generated Codex entries include this approval mode
entry for a sample stdio server.
> - Behavioral Change: Codex will now auto-approve tool calls from house
MCP servers unless user config explicitly overrides
`default_tools_approval_mode`.
>
> <!-- Macroscope's review summary starts here -->
>
> <sup><a href="https://app.macroscope.com">Macroscope</a> summarized
3a030f8.</sup>
> <!-- Macroscope's review summary ends here -->
>
<!-- macroscope-ui-refresh -->
<!-- Macroscope's pull request summary ends here -->1 parent 6879a7f commit b10a96b
2 files changed
Lines changed: 50 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
46 | 48 | | |
47 | 49 | | |
48 | 50 | | |
| |||
52 | 54 | | |
53 | 55 | | |
54 | 56 | | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
65 | 61 | | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
72 | 74 | | |
73 | | - | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
74 | 84 | | |
75 | 85 | | |
76 | 86 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
141 | 151 | | |
142 | 152 | | |
143 | 153 | | |
| |||
2437 | 2447 | | |
2438 | 2448 | | |
2439 | 2449 | | |
| 2450 | + | |
| 2451 | + | |
| 2452 | + | |
| 2453 | + | |
| 2454 | + | |
| 2455 | + | |
| 2456 | + | |
| 2457 | + | |
| 2458 | + | |
| 2459 | + | |
| 2460 | + | |
| 2461 | + | |
2440 | 2462 | | |
2441 | 2463 | | |
2442 | 2464 | | |
| |||
0 commit comments