codex: add enableMcpIntegration option
Work with the shared mcp module for integration and transformation. Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
This commit is contained in:
parent
b1f916ba05
commit
6c8def1df8
6 changed files with 175 additions and 3 deletions
|
|
@ -6,6 +6,8 @@
|
|||
codex-custom-instructions = ./custom-instructions.nix;
|
||||
codex-custom-instructions-prefer-xdg-directories = ./custom-instructions-prefer-xdg-directories.nix;
|
||||
codex-empty-custom-instructions = ./empty-custom-instructions.nix;
|
||||
codex-mcp-integration = ./mcp-integration.nix;
|
||||
codex-mcp-integration-with-override = ./mcp-integration-with-override.nix;
|
||||
codex-skills-inline = ./skills-inline.nix;
|
||||
codex-skills-dir = ./skills-dir.nix;
|
||||
codex-skills-path-not-directory = ./skills-path-not-directory.nix;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,49 @@
|
|||
{
|
||||
programs.mcp = {
|
||||
enable = true;
|
||||
servers = {
|
||||
everything = {
|
||||
command = "npx";
|
||||
args = [
|
||||
"-y"
|
||||
"@modelcontextprotocol/server-everything"
|
||||
];
|
||||
};
|
||||
context7 = {
|
||||
url = "https://mcp.context7.com/mcp";
|
||||
headers = {
|
||||
CONTEXT7_API_KEY = "{env:CONTEXT7_API_KEY}";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
programs.codex = {
|
||||
enable = true;
|
||||
enableMcpIntegration = true;
|
||||
settings = {
|
||||
model = "gpt-5-codex";
|
||||
mcp_servers = {
|
||||
custom-server = {
|
||||
url = "http://localhost:3000/mcp";
|
||||
enabled = true;
|
||||
enabled_tools = [
|
||||
"open"
|
||||
"screenshot"
|
||||
];
|
||||
};
|
||||
everything = {
|
||||
command = "final-command";
|
||||
enabled = false;
|
||||
tool_timeout_sec = 45;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.codex/config.toml
|
||||
assertFileContent home-files/.codex/config.toml \
|
||||
${./mcp-integration-with-override.toml}
|
||||
'';
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
model = "gpt-5-codex"
|
||||
|
||||
[mcp_servers.context7]
|
||||
enabled = true
|
||||
url = "https://mcp.context7.com/mcp"
|
||||
|
||||
[mcp_servers.context7.http_headers]
|
||||
CONTEXT7_API_KEY = "{env:CONTEXT7_API_KEY}"
|
||||
|
||||
[mcp_servers.custom-server]
|
||||
enabled = true
|
||||
enabled_tools = ["open", "screenshot"]
|
||||
url = "http://localhost:3000/mcp"
|
||||
|
||||
[mcp_servers.everything]
|
||||
command = "final-command"
|
||||
enabled = false
|
||||
tool_timeout_sec = 45
|
||||
36
tests/modules/programs/codex/mcp-integration.nix
Normal file
36
tests/modules/programs/codex/mcp-integration.nix
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
{
|
||||
programs.mcp = {
|
||||
enable = true;
|
||||
servers = {
|
||||
everything = {
|
||||
command = "npx";
|
||||
args = [
|
||||
"-y"
|
||||
"@modelcontextprotocol/server-everything"
|
||||
];
|
||||
};
|
||||
context7 = {
|
||||
url = "https://mcp.context7.com/mcp";
|
||||
headers = {
|
||||
CONTEXT7_API_KEY = "{env:CONTEXT7_API_KEY}";
|
||||
};
|
||||
};
|
||||
disabled-server = {
|
||||
command = "echo";
|
||||
args = [ "test" ];
|
||||
disabled = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
programs.codex = {
|
||||
enable = true;
|
||||
enableMcpIntegration = true;
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.codex/config.toml
|
||||
assertFileContent home-files/.codex/config.toml \
|
||||
${./mcp-integration.toml}
|
||||
'';
|
||||
}
|
||||
16
tests/modules/programs/codex/mcp-integration.toml
Normal file
16
tests/modules/programs/codex/mcp-integration.toml
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
[mcp_servers.context7]
|
||||
enabled = true
|
||||
url = "https://mcp.context7.com/mcp"
|
||||
|
||||
[mcp_servers.context7.http_headers]
|
||||
CONTEXT7_API_KEY = "{env:CONTEXT7_API_KEY}"
|
||||
|
||||
[mcp_servers.disabled-server]
|
||||
args = ["test"]
|
||||
command = "echo"
|
||||
enabled = false
|
||||
|
||||
[mcp_servers.everything]
|
||||
args = ["-y", "@modelcontextprotocol/server-everything"]
|
||||
command = "npx"
|
||||
enabled = true
|
||||
Loading…
Add table
Add a link
Reference in a new issue