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
- Very specific: line 214
Adding New Tools: Update the tool matching logic in ConfigurationService.matchesTool()
- Very specific: line 216
UI Components: Follow the existing pattern in components/ui/ for new components
- Very specific: line 218
API Endpoints: Add routes in src/routes/ and update the router in src/app.ts
- Very specific: line 220
Configuration Changes: Update both types (src/config/types.ts) and schemas (src/config/schema.ts)
- Very specific: line 233
Run with: just prod or pnpm prod
≈ “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.
Files
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:watchDevelopment 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 inspectCode Quality Commands
# Format code
just format
# or
pnpm format
# Check formatting
just format-check
# or
pnpm format:check
# Lint
just lint
# or
pnpm lintTesting 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 recordingsArchitecture Overview
Backend Architecture
The backend follows a modular architecture:
MCP Integration (
src/server.ts)- Implements the MCP server with
approval_prompttool - Handles polling mechanism for approval/denial
- Integrates with the audit service
- Implements the MCP server with
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
Audit Service (
src/audit/)- In-memory LRU cache with TTL support
- Event-driven architecture using EventEmitter
- Handles state transitions (NEEDS_REVIEW → APPROVED/DENIED)
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
- Type System (
src/config/types.ts)- ToolMatch discriminated union:
type ToolMatch = BuiltInToolMatch | MCPToolMatch; - Zod schemas for validation (
src/config/schema.ts)
- ToolMatch discriminated union:
Frontend Architecture
The React UI uses modern patterns:
Real-time Updates (
src/contexts/SSEContext.tsx)- Server-Sent Events integration
- Automatic reconnection with exponential backoff
- Global SSE state management
Page Structure
/dashboard- Main audit log view (src/AppFinal.tsx)/config- Configuration management (src/pages/Configuration.tsx)
Component Organization
components/config/- Rule management componentscomponents/ui/- Reusable UI primitivescomponents/layout/- Header/footer components
State Management
- Custom hooks for API calls (
src/hooks/) - React Context for SSE connection
- Local state for UI interactions
- Custom hooks for API calls (
- Styling
- Tailwind CSS with Blueprint-inspired theme
- Dark mode support
- CSS custom properties for theming
Key Integration Points
Tool Call Flow:
Claude Code → MCP approval_prompt → Audit Service → Express API → UIConfiguration Updates:
UI → REST API → ConfigurationService → File System → Hot Reload- 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
- Adding New Tools: Update the tool matching logic in
ConfigurationService.matchesTool() - UI Components: Follow the existing pattern in
components/ui/for new components - API Endpoints: Add routes in
src/routes/and update the router insrc/app.ts - Configuration Changes: Update both types (
src/config/types.ts) and schemas (src/config/schema.ts) - 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
- Build everything:
just build-all - The backend serves the UI from
/dist/ui - Run with:
just prodorpnpm prod - Docker support available via
docker-compose.yml
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
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.

