Skip to main content
Glama
mcp-codex-allowlist

mcp-codex-allowlist

by jewzaam

mcp-codex-allowlist

Read-only MCP server that exposes Codex command execution rules so an agent can inspect the user's pre-approved command rules before acting.

Overview

The server reads direct *.rules files from the user Codex home and a project’s .codex/rules/ directory. It preserves each source file, its path, and scope. The combined tool returns global and project files in that order without deduplicating or interpreting rules.

The Python package source is in mcp_codex_allowlist/.

This is a view of the rule files, not effective policy. Codex also applies approval and sandbox settings, managed policy, and project trust. Project rules are only active when Codex trusts the project.

Related MCP server: workflow-guard-mcp

Installation

Requires Python 3.10+ and pipx.

git clone https://github.com/jewzaam/mcp-codex-allowlist.git
cd mcp-codex-allowlist
make install-pipx
codex mcp add allowlist -- mcp-codex-allowlist

For a non-default Codex home, pass it to the server process:

codex mcp add allowlist --env CODEX_HOME=/path/to/codex-home -- mcp-codex-allowlist

The default is ~/.codex.

Usage

Tool

Returns

get_global_exec_rules

User-level rules from $CODEX_HOME/rules/*.rules.

get_local_exec_rules

Project rules from <project>/.codex/rules/*.rules.

get_codex_exec_rules

Both scopes, with per-file scope and source path.

The two project tools accept an optional project_dir; if omitted, the server uses its current working directory. Each result's count fields count rule files, not individual rules. The files can contain allow, prompt, or forbidden decisions.

Development

make install-dev
make check

Available Tools

3 tools
get_codex_exec_rulesB

Read user and project rule files with their source scope and paths.

Files can contain allow, prompt, and forbidden rules. This tool does not compute effective policy from approval settings, sandbox settings, managed policy, or project trust.

Inputs: project_dir. Returns: object

get_global_exec_rulesA

Read user rules from $CODEX_HOME/rules/*.rules (default ~/.codex).

Inputs: no named parameters. Returns: object

get_local_exec_rulesB

Read rules from the project .codex/rules directory for trusted projects.

Inputs: project_dir. Returns: object

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 3 tools

    Disambiguation3/5

    get_global_exec_rules and get_local_exec_rules are distinct scopes, but get_codex_exec_rules is effectively a superset that reads both, so an agent can often just call the aggregate and the other two become redundant. Descriptions help clarify scope differences, but the boundary between 'both scoped reads' and 'combined read' invites miselection.

    Naming Consistency5/5

    All three follow the same snake_case get_<scope>_exec_rules pattern, with only the scope token varying (global/local/codex). Fully predictable.

    Tool Count4/5

    Three focused read tools are reasonable for an inspection-only rules surface, though the combined tool makes the set feel slightly redundant. Nothing extraneous, but arguably two tools would suffice.

    Completeness2/5

    The surface is read-only: no tools to add, modify, or remove allow/prompt/forbidden rules, and effective policy computation is explicitly disclaimed. For an allowlist server, the absence of any write or policy-resolution operation is a significant gap that will block manage-allowlist workflows.

    Maintenance

    ActivityMaintained
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Provides AI agents with queryable, version-controlled project rules and coding standards. Enables validation, rule-based guidance, and task summaries to keep AI work aligned with your project's conventions without repeating context.
      2
      MIT
    • A
      license
      A
      quality
      F
      maintenance
      Enables agentic coding clients to enforce portable policy guardrails by evaluating proposed shell, file write, git, and network actions and returning allow, deny, or ask decisions.
      2
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables autonomous coding agents to just-in-time retrieve scoped architecture contracts and task-specific P0/P1 rules before reading or writing files, record troubleshooting findings from test failures, revoke or downgrade stale short-term rules, propose long-term contract changes for human approval, and list active rules per project and task. Supports multi-project and multi-worktree workflows over MCP with SQLite-backed storage.
      1
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables MCP clients to read only explicitly allowlisted Linux project files and selected Codex conversation turns. It supports listing projects and files, reading UTF-8 files, bounded text search, and paged reading of authorized conversations.
      MIT