Skip to main content

require-valid-mcp-transport

Require Codex MCP servers to declare a usable STDIO command or streamable HTTP URL.

Rule catalog ID: R027

Targeted pattern scope

  • **/.codex/config.toml
  • standalone *.config.toml profiles where applicable

What this rule reports

  • MCP server {{serverName}} has an invalid HTTP URL: {{url}}.
  • MCP server {{serverName}} must be configured as a TOML table.
  • MCP server {{serverName}} must declare a non-empty command for STDIO or a URL for streamable HTTP.

Why this rule exists

Require Codex MCP servers to declare a usable STDIO command or streamable HTTP URL.

❌ Incorrect

A file in the targeted scope that produces any diagnostic listed above is incorrect for this rule.

✅ Correct

A file is correct when it uses the documented Codex structure and produces no diagnostic from this rule.

Behavior and migration notes

Included in:

  • codex.configs.recommended
  • codex.configs.strict
  • codex.configs.all

ESLint flat config example

The preset layers supply the correct Markdown, TOML, or JSON language configuration. Override the rule only in a later matching flat-config entry:

import codex from "@typpi/eslint-plugin-codex";

export default [
...codex.configs.recommended,
{
rules: { "codex/require-valid-mcp-transport": "error" },
},
];

Further reading