Integrations · Codex · Full tier

Codex MCP server for full codebase context.

Install repowise and run repowise init --codex in your repository. Codex gets an MCP server with 10 tools over the code graph, git history, decisions and code health, SessionStart and PostToolUse hooks, and a managed AGENTS.md section. Codex is one of two agents at repowise's Full tier. No API key is needed.

uv tool install repowise
cd your-repo && repowise init --codex

How do I give Codex full context of a large codebase?

Codex starts every task with AGENTS.md and whatever it reads through the shell. On a large repository that means rg, cat and a guess at what an edit reaches, repeated each session. AGENTS.md helps, but it holds only what someone wrote into it.

repowise indexes the repository once, on your machine and with no model calls: the import and call graph, git history (hotspots, co-change, owners, bug-fix history), architectural decisions and per-file health. Codex then asks for what it needs. get_context returns a triage card for a file, get_risk says what an edit reaches and which tests cover it, get_why returns the decision behind a pattern. The managed AGENTS.md section tells Codex which tool fits which question, and a SessionStart hook adds the standing decisions relevant to the session.

Is there a Codex MCP server for codebase context?

Yes. repowise mcp is a stdio MCP server, and repowise init --codex adds it to .codex/config.toml in your repository as [mcp_servers.repowise], with cwd set to the repository and a 20-second startup timeout. codex mcp list shows it. It serves the 10 repowise MCP tools, and repowise mcp --tools with a comma-separated list of tool names narrows the set for a small context window.

The server reads the local .repowise index. Nothing is uploaded, and no tool edits code.

Setup

Set up repowise for Codex

Four steps from a clean machine. Python 3.11 or later and git are the only requirements; the Codex CLI should already be installed and logged in.

  1. 01

    Install the repowise CLI

    Install with uv, pipx or pip. There is no npm package for the CLI.

    uv tool install repowise
  2. 02

    Index the repository and wire Codex

    From the repository root. --codex writes the project MCP config and hooks; --yes --no-prose skips the plan screen and makes no model calls. Interactive runs offer Codex setup when codex login status succeeds.

    repowise init --yes --no-prose --codex
  3. 03

    Check that Codex sees the server

    Then ask Codex for a tour of the codebase. It should call get_overview.

    codex mcp list
  4. 04

    Add the slash prompts and the distill hook

    Optional. Codex reads slash prompts only from ~/.codex/prompts/, so this step writes there: one repowise-*.md per command, invoked as /prompts:repowise-risk or /prompts:repowise-ask, plus the user-level hook that runs noisy commands through repowise distill.

    repowise agents add --target=codex

What it writes

The files repowise writes

Every file is merged, not overwritten: your own MCP servers, hooks and AGENTS.md text outside the managed markers stay as they are. repowise agents remove --target=codex takes all of it back out.

Files repowise writes
FileScopeWhat goes in it
.codex/config.tomlProject[mcp_servers.repowise] with command repowise, args ["mcp"], cwd and startup_timeout_sec = 20; also [features] hooks = true, without which Codex ignores hooks.json.
.codex/hooks.jsonProjectSessionStart (startup, resume, clear): tool guidance and standing decisions. PostToolUse on shell commands: flags git operations that leave the index behind. PostToolUse on apply_patch, Edit and Write: an edit reminder and a freshness check.
AGENTS.mdProjectA managed section: architecture, key modules, entry points, the files that need care by bug-fix history, code health and which repowise tool answers which question. Refreshed by repowise update.
~/.codex/prompts/repowise-*.mdUserSlash prompts such as /prompts:repowise-risk, /prompts:repowise-why and /prompts:repowise-health, rendered from the same source as the Claude Code plugin's commands.
Codex user hooksUserA rewrite hook that sends noisy test, build and git commands through repowise distill. Written by repowise agents add --target=codex.

MCP tools

The 10 MCP tools, and when the agent calls each

Codex reads the routing from AGENTS.md and the SessionStart hook, so it calls the tools without being asked. Exact identifiers still go to rg, which is faster.

MCP tools
ToolWhat it returnsWhen the agent calls it
get_answerOne-call cited Q&A over the documentation, with a calibrated confidence score.A how, where or why question, answered once with citations instead of a chain of greps.
get_contextA triage card for files, modules, or symbols: summary, signatures, hotspot bit, governing decisions.Before opening a file, or with include=["references"] before a rename, to get every caller.
get_symbolRaw source bytes for one indexed symbol with exact, verified line bounds.When it needs one function's exact lines instead of the whole file.
search_codebaseHybrid full-text and semantic search over the documentation, routed by query shape.To find a concept, a path or an identifier when it does not know the file name.
get_whyArchitectural decision archaeology: why the code is shaped this way, with lineage.Before changing an established pattern: the decision behind it, or git archaeology when none is recorded.
get_riskHotspot score, dependents, co-change partners, and PR-mode break/test directives.Before editing a file: what depends on it, how often it broke, which tests reach it.
get_change_riskPre-merge defect-risk score for a commit or diff range, computed from its shape alone.Before finishing a multi-file change, on base..HEAD or uncommitted work.
get_healthPer-file code-health scores across three pillars, plus ranked refactoring targets.On the files it touched, or to pick refactoring targets from the fix-first queue.
get_dead_codeUnreachable files, unused exports, and zombie packages, tiered by confidence.On a cleanup task: unreachable files, unused exports and zombie packages, by confidence tier.
get_overviewArchitecture map, module list, entry points, and tool recipes. First call on any repo.First call on a repository it has not seen: modules, entry points, layers and the riskiest files.

Comparison

What Codex already does, and what repowise adds

Codex already has good context machinery. AGENTS.md, shell search, hooks and review. repowise adds the repository's graph, history and decisions to each of them.

What it does well

AGENTS.md
Codex merges AGENTS.md files from the repository root down to the working directory. It is the right place for conventions, and repowise writes into it instead of beside it.
Shell search
Codex reads code with rg and cat. For an exact identifier that is the fastest tool there is, and repowise's own instructions say so.
Hooks, skills and plugins
Codex runs hooks.json when [features] hooks is on, loads skills, and installs plugins. repowise uses all three surfaces: MCP tools, hooks, a managed AGENTS.md, slash prompts, skills through the Codex plugin in the repowise repository, and opt-in transcript mining that turns sessions into proposed decisions. Plugin-bundled hooks need [features] plugin_hooks = true.
/review
Codex reviews a diff in the session. get_change_risk adds the repository's history to that review before you ask for it.

What repowise adds

The graph
Who imports a file and what a change reaches, resolved per language, so Codex sees the callers it did not open.
History
Hotspots, bug magnets, files that change together and owners, from git. A file bug-fixed four times this quarter reads differently.
Decisions
ADR-style records mined from ADRs, commits, PRs and WHY comments, returned by get_why with the files they govern.
Health and dead code
A 1.0 to 10.0 score per file from 59 deterministic detectors, and unreachable code by confidence tier.
Several repositories
One workspace server answers across repos and matches the API contracts between them.

Multi-repo

Context across several repositories

For several repositories, run repowise init . in the parent folder. It finds the git repos up to three levels down, indexes each one, links them through HTTP, gRPC, topic and OpenAPI contracts and cross-repo co-change history, and registers one MCP server that answers for all of them. The workspace server adds list_repos to the 10 MCP tools, and every tool takes a repo argument, or a target written as alias:path. --tools +name adds get_blast_radius, get_architecture and get_conformance for cross-repo impact.

On hosted repowise, one URL answers across a workspace: https://api.repowise.dev/mcp/w/{workspace_id}, with the same API key as the per-repo URL. That shape needs Pro, Teams or Admin.

Tokens

Token use on a large repository

On Codex, against a bare agent, repowise cut output tokens by 31.6% and reached an answer in 3.8 tool calls instead of 7.2 (n = 43 · p = <0.0001 · Codex (gpt-5.6-sol) · django/django at a single pinned commit · 2026-08). On Claude Code the same design cut output tokens by 15.9% (n = 15 · p = 0.035 · Claude Code (claude-sonnet-5) · django/django at a single pinned commit · 2026-08).

The saving comes from fewer reads: a triage card instead of a whole file, one symbol's lines instead of the module, one cited answer instead of a chain of searches.

repowise distill, measured with the CLI one command at a time: 89% fewer tokens on git log -50 and 61% on a pytest run with 11 failures, with all 11 failure lines kept.

Code review

Review a change, then fix what the bot finds

Inside Codex, get_change_risk scores uncommitted work or a base..HEAD range against the repository's own commit history: defect risk, files that usually change with these but are missing, and the tests that reach the diff. /prompts:repowise-risk runs it as a slash prompt. That is the check to run before you ask Codex's /review, or before you push.

The repowise PR bot is a GitHub App. On a pull request it stays silent unless a signal fires: files that usually change together but are missing from the diff, tests that import the changed files, a health drop. Its verdict is the Repowise review check run. The optional AI review on Pro attaches a prompt for your agent to each finding, and the pull request page on repowise.dev has a Copy fix prompt for your agent button. On GitLab, Azure DevOps and Bitbucket there is no bot; indexing and the CI gates (patch coverage, doc drift, new secrets, change risk) still work.

To fix a finding, copy its prompt and paste it into Codex. The prompt names the files and the finding, so Codex starts from the evidence instead of re-reading the pull request.

Hosted

The remote MCP endpoint

Hosted repowise serves the same tools over Streamable HTTP at https://api.repowise.dev/mcp/{owner}/{repo}, with an API key from Settings, Coding agents (MCP). The per-repo URL works on every plan, Free included (10 answers a month on Free). Claude on the web and desktop connects with a custom connector and sign-in, and ChatGPT takes the same MCP address. Codex can use the hosted URL wherever its MCP config accepts a Streamable HTTP server with an Authorization header, and the local stdio server above is the default route.

Enterprise

Consistent agent context across an organization

  • The same context in every repository

    A workspace indexes many repositories into one MCP server, so every engineer's agent gets the same graph, history and decisions, whichever agent they use.

  • Self-hosted

    The CLI, the MCP server and the dashboard run on your machines. The analysis makes no model calls and needs no account.

  • Your own model keys

    Prose and answers use the provider you configure: Anthropic, OpenAI, Gemini, OpenRouter, DeepSeek, Kimi, Eden AI, any LiteLLM route, or Ollama. Agent CLIs (Claude Code, Codex, OpenCode, Copilot CLI) can be the writer instead.

  • Air-gapped

    repowise init --yes --no-prose needs no API key. Ollama covers prose and embeddings offline, and repowise grammars fetch stages the COBOL and Apex grammars before the network is cut.

  • Governance

    The commercial license adds SSO, RBAC, audit, on-prem and air-gapped support with an SLA, on top of the AGPL-3.0 core.

repowise for teams and enterprise · Enterprise docs

Questions

What people ask before they try it.

Does repowise write to my global ~/.codex/config.toml?

No. repowise init --codex writes the MCP server and hooks under the repository, in .codex/config.toml and .codex/hooks.json. Only repowise agents add --target=codex writes user-level files: the slash prompts in ~/.codex/prompts/ and the distill rewrite hook.

Can Codex write the repowise wiki instead of an API key?

Yes. The codex_cli provider runs codex exec in a read-only sandbox for each page: repowise init --provider codex_cli --codex --yes. Usage is billed to your Codex subscription and recorded as $0 by repowise. It runs 4 pages at a time by default; REPOWISE_CODEX_CLI_CONCURRENCY changes that. Semantic search still needs an embedder key or Ollama.

Do I need an API key for the MCP tools?

No. The graph, git history, health, dead code, change risk and decisions from ADRs and commits are computed without a model. get_answer answers from local retrieval when no provider is configured.

How does repowise keep AGENTS.md from clobbering my instructions?

Its section sits between managed markers. Text outside them is never touched. OpenCode and Hermes read the same file and share the same section, so removing one agent leaves it in place while another still uses it.

Does Codex know when the index is stale?

Every MCP response carries the indexed commit and a stale_warning when the index is behind HEAD, and a PostToolUse hook flags git operations that leave it behind. A post-commit hook from repowise init keeps it current.

How do I remove it?

repowise agents remove --target=codex removes .codex/config.toml entries, .codex/hooks.json entries, the slash prompts and the managed AGENTS.md section. repowise uninstall removes every agent at once.

Last reviewed: November 2026

Get started

Give your agent the repository.

Index a repository locally in one command, or index a public one free on repowise.dev and connect over a URL.