agentleFS
toolprinttoolprint/cco-mcp/CLAUDE.md

cco-mcp

CLAUDE.md19 starsChanged 17 months agoMITView on GitHub

CCO-MCP (Claude Code Oversight - Model Context Protocol) is a comprehensive audit and approval system for Claude Code tool calls. It consists of: The backend follows a modular architecture: The React UI uses modern patterns:

The file

We split this CLAUDE.md into the rules it gives an agent

5 rules. About 0 are common, 0 are distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Adding New Tools: Update the tool matching logic in ConfigurationService.matchesTool()

    line 214
  2. Very specific:

    UI Components: Follow the existing pattern in components/ui/ for new components

    line 216
  3. Very specific:

    API Endpoints: Add routes in src/routes/ and update the router in src/app.ts

    line 218
  4. Very specific:

    Configuration Changes: Update both types (src/config/types.ts) and schemas (src/config/schema.ts)

    line 220
  5. Very specific:

    Run with: just prod or pnpm prod

    line 233

≈ “Common” is an estimate: at least 1 in 5 of the 29,248 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Project Overview

CCO-MCP (Claude Code Oversight - Model Context Protocol) is a comprehensive audit and approval system for Claude Code tool calls. It consists of:

  • A Node.js/TypeScript MCP server backend with Express REST API
  • A React/TypeScript web dashboard UI
  • Real-time updates via Server-Sent Events (SSE)
  • Rule-based approval configuration system

Development Commands

Build Commands

# Build everything (backend + UI)
just build-all
# or
pnpm build:all

# Build backend only
just build
# or
pnpm build

# Build UI only
just build-ui
# or
pnpm build:ui

# Watch mode for backend
just build-watch
# or
pnpm build:watch

Development Commands

# Run both backend and UI in development mode
just dev-all
# or
pnpm dev:all

# Run backend only
just dev
# or
pnpm dev

# Run UI only
just dev-ui
# or
pnpm dev:ui

# Inspect MCP server
just inspect
# or
pnpm inspect

Code Quality Commands

# Format code
just format
# or
pnpm format

# Check formatting
just format-check
# or
pnpm format:check

# Lint
just lint
# or
pnpm lint

Testing Commands

# Run tests (currently echoes no tests configured)
just test
# or
pnpm test

# E2E tests with recording options
just e2e-test          # Without recording
just e2e-test-browser  # Browser recording only
just e2e-test-terminal # Terminal recording only
just e2e-test-full     # Both recordings

Architecture Overview

Backend Architecture

The backend follows a modular architecture:

  1. MCP Integration (src/server.ts)

    • Implements the MCP server with approval_prompt tool
    • Handles polling mechanism for approval/denial
    • Integrates with the audit service
  2. Express API (src/app.ts)

    • REST endpoints for audit logs and configuration
    • SSE endpoint for real-time updates
    • Static file serving for UI in production
  3. Audit Service (src/audit/)

    • In-memory LRU cache with TTL support
    • Event-driven architecture using EventEmitter
    • Handles state transitions (NEEDS_REVIEW → APPROVED/DENIED)
  4. Configuration Service (src/services/ConfigurationService.ts)

    • Rule-based approval system with priority ordering
    • Supports built-in tools and MCP server tools
    • Hot-reload configuration with file watcher
    • Tool matching logic for both types:
      • Built-in: Direct tool name matching
      • MCP: Format mcp__serverName__toolName
  5. Type System (src/config/types.ts)
    • ToolMatch discriminated union:
      type ToolMatch = BuiltInToolMatch | MCPToolMatch;
    • Zod schemas for validation (src/config/schema.ts)

Frontend Architecture

The React UI uses modern patterns:

  1. Real-time Updates (src/contexts/SSEContext.tsx)

    • Server-Sent Events integration
    • Automatic reconnection with exponential backoff
    • Global SSE state management
  2. Page Structure

    • /dashboard - Main audit log view (src/AppFinal.tsx)
    • /config - Configuration management (src/pages/Configuration.tsx)
  3. Component Organization

    • components/config/ - Rule management components
    • components/ui/ - Reusable UI primitives
    • components/layout/ - Header/footer components
  4. State Management

    • Custom hooks for API calls (src/hooks/)
    • React Context for SSE connection
    • Local state for UI interactions
  5. Styling
    • Tailwind CSS with Blueprint-inspired theme
    • Dark mode support
    • CSS custom properties for theming

Key Integration Points

  1. Tool Call Flow:

    Claude Code → MCP approval_prompt → Audit Service → Express API → UI
  2. Configuration Updates:

    UI → REST API → ConfigurationService → File System → Hot Reload
  3. Real-time Updates:
    Audit Service Events → SSE Stream → React Context → UI Components

Configuration Format

The new ToolMatch format distinguishes between tool types:

// Built-in tool
{
  "tool": {
    "type": "builtin",
    "toolName": "Read"
  }
}

// MCP server tool
{
  "tool": {
    "type": "mcp",
    "serverName": "git",
    "toolName": "git_status" // Optional
  }
}

Development Tips

  1. Adding New Tools: Update the tool matching logic in ConfigurationService.matchesTool()
  2. UI Components: Follow the existing pattern in components/ui/ for new components
  3. API Endpoints: Add routes in src/routes/ and update the router in src/app.ts
  4. Configuration Changes: Update both types (src/config/types.ts) and schemas (src/config/schema.ts)
  5. Build Process: The backend build copies UI dist files automatically via tsup.config.ts

Environment Variables

  • PORT - Server port (default: 8660)
  • CCO_CONFIG_PATH - Configuration file path (default: ~/.cco-mcp/config.json)

Production Deployment

  1. Build everything: just build-all
  2. The backend serves the UI from /dist/ui
  3. Run with: just prod or pnpm prod
  4. Docker support available via docker-compose.yml

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.