Skip to main content
Glama
ClydeLemot

Claude Code Directive MCP

by ClydeLemot

Claude Code Directive MCP

claude-code-directive-mcp is a local stdio MCP server that lets an agent temporarily add a global Codex AGENTS directive requiring Claude Code usage until a configured expiry date.

It is designed for temporary, opt-in delegation policy:

  • Adds one clearly marked block to the effective global Codex instruction file.

  • Uses Codex precedence: non-empty AGENTS.override.md, otherwise AGENTS.md.

  • Skips project-local .codex directories unless explicitly opted in.

  • Records a manifest and creates a user-level cleanup timer.

  • Removes only the exact marked block recorded in the manifest.

  • Adds guardrails for Claude context, Main Codex context, retries, parallelism, and rate limits.

  • Never asks for or stores secrets.

Install

git clone <repo-url>
cd claude-code-directive-mcp
npm install
npm run install:codex

Restart Codex after installation so the new MCP server is loaded.

The installer writes a user wrapper to:

~/.local/bin/codex-claude-code-directive-mcp

and registers this MCP server in:

${CODEX_HOME:-~/.codex}/config.toml

Related MCP server: codex-bridge

MCP Tools

claude_directive_enable

Enable or update the temporary directive.

Example arguments:

{
  "expiresAt": "2026-08-17T23:59:59",
  "timezone": "Europe/Berlin",
  "cleanupDelayMinutes": 5,
  "maxClaudePromptChars": 60000,
  "maxClaudeOutputChars": 20000,
  "maxClaudeRuntimeSeconds": 900,
  "maxClaudeRetries": 1,
  "mainContextReservePercent": 25,
  "maxClaudeCallsPerTask": 3,
  "maxParallelClaudeAgents": 2,
  "minSecondsBetweenClaudeCalls": 30
}

claude_directive_status

Reports discovered Codex homes, effective global instruction files, marker counts, scheduler state, manifest content, and optional Claude CLI status.

claude_directive_disable

Runs the idempotent cleanup and disables/removes the one-time user scheduler.

Cleanup

On Linux with a working user systemd, the MCP creates a user timer named:

codex-claude-code-directive-cleanup.timer

The timer executes:

${CODEX_HOME:-~/.codex}/maintenance/cleanup-temporary-claude-code-directive.py

The cleanup script uses the manifest to remove only the exact marked directive block. It is safe to run repeatedly.

Budget And Rate Guardrails

The directive generated by this MCP tells the main agent to:

  • keep a Main Codex context reserve,

  • cap Claude prompt and output size,

  • cap Claude runtime and retries,

  • limit per-task Claude calls and parallel Claude agents,

  • wait between separate Claude calls unless parallelism is justified,

  • stop fast retry loops on rate limits, context limits, timeouts, or overload.

The MCP writes these rules into the global instruction block; it does not have privileged access to live provider token counters.

Available Tools

3 tools
claude_directive_disableDisable Temporary Claude Code DirectiveB

Remove the active temporary Claude Code directive block using the manifest and disable the one-time cleanup scheduler.

ParametersJSON Schema
NameRequiredDescriptionDefault
dryRunNo

TDQS

B3.3/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It discloses two key behaviors (removal of directive block and disabling of cleanup scheduler), but does not elaborate on side effects, required permissions, or what happens to the directive manifest.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence that conveys core functionality without repetition or filler. Every word adds value.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has a boolean parameter and no output schema, the description is incomplete. It fails to explain the dryRun parameter, return values, or side effects. More detail is needed for safe and correct usage.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema has 0% description coverage, and the description does not mention the only parameter 'dryRun'. The agent is left to infer its meaning from the name alone, which is insufficient for correct invocation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Remove') and the resource ('active temporary Claude Code directive block'), and mentions additional behavior ('disable the one-time cleanup scheduler'). It effectively distinguishes from siblings 'claude_directive_enable' (opposite action) and 'claude_directive_status' (status check).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies when to use (when needing to disable a temporary directive), but does not explicitly state when to use compared to alternatives or provide exclusions. No guidance on prerequisites or context is given.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

claude_directive_enableEnable Temporary Claude Code DirectiveB

Enable or update a global temporary Codex AGENTS directive that tells Codex to use Claude Code until a specific expiry, with context guardrails and scheduled cleanup.

ParametersJSON Schema
NameRequiredDescriptionDefault
dryRunNo
timezoneNoEurope/Berlin
expiresAtYesExpiry such as 2026-08-17, 2026-08-17T23:59:59, or 2026-08-17 23:59:59 Europe/Berlin.
maxClaudeRetriesNo
cleanupDelayMinutesNo
maxClaudeOutputCharsNo
maxClaudePromptCharsNo
allowProjectCodexHomeNo
maxClaudeCallsPerTaskNo
maxClaudeRuntimeSecondsNo
maxParallelClaudeAgentsNo
mainContextReservePercentNo
minSecondsBetweenClaudeCallsNo

TDQS

B3.2/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries full behavioral disclosure burden. It mentions 'context guardrails and scheduled cleanup' but does not detail specifics like effect on existing directives, destructiveness, authentication needs, or rate limits. The description is adequate but not transparent beyond the core function.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, 25-word sentence that is concise and front-loaded with the core action. It conveys essential information without verbosity, though it could be better structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (13 parameters, no output schema, no annotations), the description is too brief. It omits parameter meanings, return behavior, and detailed effect of the directive, making it incomplete for an agent to use correctly without additional context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Only 8% schema coverage (expiresAt has a description); the description does not explain any of the 13 parameters. Terms like 'context guardrails' and 'cleanup' hint at some parameters but add no concrete meaning. The description fails to compensate for low schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool enables or updates a global temporary directive for using Claude Code, specifying the action (enable/update), resource (directive), and key constraints (expiry, guardrails, cleanup). It distinguishes from sibling tools claude_directive_status (status check) and claude_directive_disable (disable).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description does not provide explicit guidance on when to use this tool versus its siblings (status, disable). It implies the tool is for enabling a temporary directive, but lacks when-not-to-use criteria or alternative scenarios.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

claude_directive_statusTemporary Claude Code Directive StatusC

Report discovered Codex homes, effective AGENTS files, current directive markers, scheduler state, context policy, and optional Claude CLI availability.

ParametersJSON Schema
NameRequiredDescriptionDefault
runClaudeTestNo
includeClaudeCheckNo

TDQS

C2.7/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It lists what is reported but does not disclose side effects or permissions. As a status tool, it is likely read-only, but that is not stated.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is one sentence front-loaded with the main purpose. It is efficient, but missing parameter information reduces usability.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema or annotations, the description should provide more context. It lists report topics but does not describe the output format or how parameters affect the result.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, and the description does not explain the two boolean parameters (runClaudeTest, includeClaudeCheck). No meaning is added beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool reports various statuses like Codex homes, AGENTS files, directive markers, etc. It distinguishes from sibling tools (enable/disable). However, it does not explicitly say 'status' is retrieved, but it's implied.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus the enable/disable siblings. Instructions for context or prerequisites are absent.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 3 tool updatesv0.1.0
    • First observedclaude_directive_disable
    • First observedclaude_directive_enable
    • First observedclaude_directive_status

TDQS

A3.5/5.0
Disambiguation5/5

Each tool has a clearly distinct function: enabling, checking status, or disabling the directive. No overlap in purposes.

Naming Consistency5/5

All tools follow a consistent `claude_directive_` prefix with verb_noun pattern (enable, status, disable), making them easily identifiable.

Tool Count5/5

Three tools is exactly right for managing a lifecycle (create/read/delete) of a single directive; compact and well-scoped.

Completeness5/5

The set covers the full lifecycle: enabling (create/update), checking status (read), and disabling (delete). No obvious gaps for the stated domain.

Maintenance

ActivitySlowing
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ClydeLemot/claude-code-directive-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server