# rebel0789/codexpro architecture

> Architecture diagram of the GitHub repository rebel0789/codexpro, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-22). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rebel0789/codexpro
- Repository: https://github.com/rebel0789/codexpro

## Overview

CodexPro is a local MCP server that lets ChatGPT work within explicitly allowed repositories. The main loop routes tool requests through the server to bounded workspace operations: inspect and search code, make guarded changes, run checks, review likely impact, and preserve plans or context for handoff. Separate branches cover attachment import, image viewing, repository capabilities, and session handling. The source excerpts show several dispatches and analysis calls; other links are limited to README claims or source-index references, so uncertain call relationships are omitted.

Main entry points: [`src/server.ts`](https://github.com/rebel0789/codexpro/blob/main/src/server.ts) (MCP tool server), [`src/analysis/index.ts`](https://github.com/rebel0789/codexpro/blob/main/src/analysis/index.ts) (Workspace analysis), [`src/http.ts`](https://github.com/rebel0789/codexpro/blob/main/src/http.ts) (HTTP transport), [`src/searchOps.ts`](https://github.com/rebel0789/codexpro/blob/main/src/searchOps.ts) (Search tools)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["MCP entrypoints"]
  node_http["HTTP transport<br/>[http.ts]"]
  node_stdio["stdio transport<br/>[stdio.ts]"]
  node_server["MCP tool server<br/>[server.ts]"]
end

subgraph group_workspace["Workspace access"]
  node_workspace["Workspace registry<br/>[guard.ts]"]
  node_filesystem["File operations<br/>[fsOps.ts]"]
  node_search["Search tools<br/>[searchOps.ts]"]
  node_bash["Command tools<br/>[bashOps.ts]"]
  node_git["Git operations<br/>[gitOps.ts]"]
  node_images["Image viewing<br/>[imageOps.ts]"]
  node_attachments["Attachment import<br/>[importOps.ts]"]
end

subgraph group_intelligence["Repository intelligence"]
  node_analysis["Workspace analysis<br/>[index.ts]"]
  node_inventory["File inventory<br/>[inventory.ts]"]
  node_symbolizer["Symbol extraction<br/>[extract.ts]"]
  node_classification["Language classification<br/>[classify.ts]"]
  node_impact["Change impact<br/>[impact.ts]"]
end

subgraph group_workflow["Agent workflows"]
  node_capabilities["Capability inventory<br/>[capabilitiesOps.ts]"]
  node_context["Context and plans<br/>[proContext.ts]"]
  node_sessions["Agent sessions<br/>[codexSessions.ts]"]
end

subgraph group_safety["Policy and state"]
  node_configuration["Runtime configuration<br/>[config.ts]"]
  node_profile[("Saved profiles<br/>[profileStore.ts]")]
  node_redaction["Secret redaction<br/>[redact.ts]"]
end

node_chatgpt(("ChatGPT"))

node_chatgpt -->|"sends tool requests"| node_http
node_http -->|"routes MCP requests"| node_server
node_stdio -.->|"serves MCP"| node_server
node_server -->|"selects workspaces"| node_workspace
node_server -->|"dispatches file tools"| node_filesystem
node_server -->|"dispatches search"| node_search
node_server -->|"dispatches commands"| node_bash
node_server -->|"dispatches git tools"| node_git
node_server -->|"views images"| node_images
node_server -->|"imports files"| node_attachments
node_server -->|"reviews changes"| node_analysis
node_server -->|"inspects capabilities"| node_capabilities
node_server -->|"builds workspace summary"| node_context
node_server -->|"manages sessions"| node_sessions
node_analysis -->|"inventories files"| node_inventory
node_analysis -->|"extracts symbols"| node_symbolizer
node_analysis -->|"classifies projects"| node_classification
node_impact -->|"inspects workspace"| node_analysis
node_search -->|"runs structured search"| node_analysis
node_context -->|"reads and writes context"| node_filesystem
node_http -->|"loads settings"| node_configuration
node_http -->|"uses saved profiles"| node_profile
node_search -->|"uses search limits"| node_configuration
node_filesystem -->|"redacts file results"| node_redaction
node_context -->|"redacts context"| node_redaction

click node_http "https://github.com/rebel0789/codexpro/blob/main/src/http.ts"
click node_stdio "https://github.com/rebel0789/codexpro/blob/main/src/stdio.ts"
click node_server "https://github.com/rebel0789/codexpro/blob/main/src/server.ts"
click node_workspace "https://github.com/rebel0789/codexpro/blob/main/src/guard.ts"
click node_filesystem "https://github.com/rebel0789/codexpro/blob/main/src/fsOps.ts"
click node_search "https://github.com/rebel0789/codexpro/blob/main/src/searchOps.ts"
click node_bash "https://github.com/rebel0789/codexpro/blob/main/src/bashOps.ts"
click node_git "https://github.com/rebel0789/codexpro/blob/main/src/gitOps.ts"
click node_images "https://github.com/rebel0789/codexpro/blob/main/src/imageOps.ts"
click node_attachments "https://github.com/rebel0789/codexpro/blob/main/src/importOps.ts"
click node_analysis "https://github.com/rebel0789/codexpro/blob/main/src/analysis/index.ts"
click node_inventory "https://github.com/rebel0789/codexpro/blob/main/src/analysis/inventory.ts"
click node_symbolizer "https://github.com/rebel0789/codexpro/blob/main/src/analysis/extract.ts"
click node_classification "https://github.com/rebel0789/codexpro/blob/main/src/analysis/classify.ts"
click node_impact "https://github.com/rebel0789/codexpro/blob/main/src/analysis/impact.ts"
click node_capabilities "https://github.com/rebel0789/codexpro/blob/main/src/capabilitiesOps.ts"
click node_context "https://github.com/rebel0789/codexpro/blob/main/src/proContext.ts"
click node_sessions "https://github.com/rebel0789/codexpro/blob/main/src/codexSessions.ts"
click node_configuration "https://github.com/rebel0789/codexpro/blob/main/src/config.ts"
click node_profile "https://github.com/rebel0789/codexpro/blob/main/src/profileStore.ts"
click node_redaction "https://github.com/rebel0789/codexpro/blob/main/src/redact.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_http,node_stdio,node_server toneBlue
class node_workspace,node_filesystem,node_search,node_bash,node_git,node_images,node_attachments toneAmber
class node_analysis,node_inventory,node_symbolizer,node_classification,node_impact toneMint
class node_capabilities,node_context,node_sessions toneRose
class node_configuration,node_profile,node_redaction,node_chatgpt toneIndigo
```

## Components

### MCP entrypoints

- [HTTP transport](https://github.com/rebel0789/codexpro/blob/main/src/http.ts): `src/http.ts`
- [stdio transport](https://github.com/rebel0789/codexpro/blob/main/src/stdio.ts): `src/stdio.ts`
- [MCP tool server](https://github.com/rebel0789/codexpro/blob/main/src/server.ts): `src/server.ts`

### Workspace access

- [Workspace registry](https://github.com/rebel0789/codexpro/blob/main/src/guard.ts): `src/guard.ts`
- [File operations](https://github.com/rebel0789/codexpro/blob/main/src/fsOps.ts): `src/fsOps.ts`
- [Search tools](https://github.com/rebel0789/codexpro/blob/main/src/searchOps.ts): `src/searchOps.ts`
- [Command tools](https://github.com/rebel0789/codexpro/blob/main/src/bashOps.ts): `src/bashOps.ts`
- [Git operations](https://github.com/rebel0789/codexpro/blob/main/src/gitOps.ts): `src/gitOps.ts`
- [Image viewing](https://github.com/rebel0789/codexpro/blob/main/src/imageOps.ts): `src/imageOps.ts`
- [Attachment import](https://github.com/rebel0789/codexpro/blob/main/src/importOps.ts): `src/importOps.ts`

### Repository intelligence

- [Workspace analysis](https://github.com/rebel0789/codexpro/blob/main/src/analysis/index.ts): `src/analysis/index.ts`
- [File inventory](https://github.com/rebel0789/codexpro/blob/main/src/analysis/inventory.ts): `src/analysis/inventory.ts`
- [Symbol extraction](https://github.com/rebel0789/codexpro/blob/main/src/analysis/extract.ts): `src/analysis/extract.ts`
- [Language classification](https://github.com/rebel0789/codexpro/blob/main/src/analysis/classify.ts): `src/analysis/classify.ts`
- [Change impact](https://github.com/rebel0789/codexpro/blob/main/src/analysis/impact.ts): `src/analysis/impact.ts`

### Agent workflows

- [Capability inventory](https://github.com/rebel0789/codexpro/blob/main/src/capabilitiesOps.ts): `src/capabilitiesOps.ts`
- [Context and plans](https://github.com/rebel0789/codexpro/blob/main/src/proContext.ts): `src/proContext.ts`
- [Agent sessions](https://github.com/rebel0789/codexpro/blob/main/src/codexSessions.ts): `src/codexSessions.ts`

### Policy and state

- [Runtime configuration](https://github.com/rebel0789/codexpro/blob/main/src/config.ts): `src/config.ts`
- [Saved profiles](https://github.com/rebel0789/codexpro/blob/main/src/profileStore.ts): `src/profileStore.ts`
- [Secret redaction](https://github.com/rebel0789/codexpro/blob/main/src/redact.ts): `src/redact.ts`

### Other components

- **ChatGPT**

## Connections

- ChatGPT → HTTP transport: sends tool requests (evidence: `README.md`)
- HTTP transport → MCP tool server: routes MCP requests (evidence: `src/http.ts`)
- stdio transport → MCP tool server: serves MCP
- MCP tool server → Workspace registry: selects workspaces (evidence: `src/server.ts`)
- MCP tool server → File operations: dispatches file tools (evidence: `src/server.ts`)
- MCP tool server → Search tools: dispatches search (evidence: `src/server.ts`)
- MCP tool server → Command tools: dispatches commands (evidence: `src/server.ts`)
- MCP tool server → Git operations: dispatches git tools (evidence: `src/server.ts`)
- MCP tool server → Image viewing: views images (evidence: `src/server.ts`)
- MCP tool server → Attachment import: imports files (evidence: `src/server.ts`)
- MCP tool server → Workspace analysis: reviews changes (evidence: `src/server.ts`)
- MCP tool server → Capability inventory: inspects capabilities (evidence: `src/server.ts`)
- MCP tool server → Context and plans: builds workspace summary (evidence: `src/server.ts`)
- MCP tool server → Agent sessions: manages sessions (evidence: `src/server.ts`)
- Workspace analysis → File inventory: inventories files (evidence: `src/analysis/index.ts`)
- Workspace analysis → Symbol extraction: extracts symbols (evidence: `src/analysis/index.ts`)
- Workspace analysis → Language classification: classifies projects (evidence: `src/analysis/index.ts`)
- Change impact → Workspace analysis: inspects workspace (evidence: `src/analysis/impact.ts`)
- Search tools → Workspace analysis: runs structured search (evidence: `src/searchOps.ts`)
- Context and plans → File operations: reads and writes context (evidence: `src/proContext.ts`)
- HTTP transport → Runtime configuration: loads settings (evidence: `src/http.ts`)
- HTTP transport → Saved profiles: uses saved profiles (evidence: `src/http.ts`)
- Search tools → Runtime configuration: uses search limits (evidence: `src/searchOps.ts`)
- File operations → Secret redaction: redacts file results (evidence: `src/fsOps.ts`)
- Context and plans → Secret redaction: redacts context (evidence: `src/proContext.ts`)
