AOCI-CODE: A fully system map that can be versioned using Git, providing a local-first MCP code index service for agents.

AOCI-CODE: A fully system map that can be versioned using Git, providing a local-first MCP code index service for agents.

1 month ago
duguying
112 views
Source: GitHub

AOCI-CODE is a locally-focused MCP service + CLI written in Go, which maintains a persistent, Git-versionable index of the entire system within its repository. This allows agents like Claude Code, Codex, Cursor, and opencode to understand the complete system before taking action, by reading both the source code and the library structure without requiring an internet connection or storing credentials.

Related tags

#AOCI-CODE#MCP#代码索引#AI编程#Go

This document provides detailed instructions and information about the “AOCI-CODE” project, which appears to be a code intelligence and management tool. It outlines its technical stack, installation process, key commands, project status, and how to obtain it.

Here’s a breakdown of the key aspects:

Core Features & Technical Details:

  • Language: Go (using go.mod for versioning).
  • Distribution: Single CGO-free executable.
  • Agent Protocol: Uses stdio MCP, with exactly nine tools; shares the same governance kernel between CLI and MCP.
  • Index Files: UTF-8 plain text Cognition Volumes, diffable and versionable via Git.
  • Machine State: JSON/JSONL, SHA-256 hashes, Baseline, manifest, receipt, ledger, and recovery mechanisms.
  • Write Protection: Cross-process locks, CAS (Compare and Swap), temporary files in the same directory, platform-specific atomic operations, and fail-closed behavior.
  • Database: Core functionality doesn’t rely on a business database; optional PostgreSQL/MySQL/openGauss schema evidence can be used with pure Go drivers.

Security & Boundaries (“Border Security”):

  • Read-only Access to Source Code and Database Structure: The tool only reads the source code and database structure without accessing any business data.
  • Writes Restricted to Project Directory: Writes are limited to index files and state pages within the project directory, and user cache directories.
  • No Network Connectivity or Data Uploads: The system does not connect to the internet nor upload any data. It connects only to a declared database (using metadata), and uses a local loopback address for its internal state page.
  • No External Services: Does not require Neo4j, vector databases, persistent daemon processes, or AOCI cloud services.

Installation & Usage (“Quick Start”):

  1. Official Recommendation: The recommended approach is to have the Agent install and configure itself.
  2. Download & Verification: Download the latest release package (compatible with your OS and CPU architecture) from the GitHub repository (aoci-spec/aoci-code). Verify it using the provided instructions. If no compatible release exists, build from source.
  3. Installation Location: Place the aoci executable (or aoci.exe on Windows) at a stable absolute path.
  4. Initialization (aoci init): Run aoci init to initialize AOCI and integrate MCP for the current host. This step sets up the initial volumes layout (without business semantics).
  5. Scanning (aoci scan): Run aoci scan to establish a Baseline; subsequent changes within the defined Baseline will be tracked as Scope Changes.
  6. Agent Restart: After running aoci init and aoci scan, restart the agent so that the newly written MCP server takes effect.
  7. Index Building (aoci ui): Once the agent is restarted, use aoci ui to build the AOCI index for the project. The UI then provides a link to the panel.

Important Considerations:

  • .gitignore and .git/info/exclude: Files created by init (e.g., aoci.txt, aoci.meta.txt, aoci.code.txt, AGENTS.md) must not be added to your .gitignore or .git/info/exclude. Ignoring these files will prevent the AOCI index from being built because the scan command relies on Git content.
  • Agent Restart: Restarting the agent after running init is crucial because the MCP service written by init is not yet loaded when you execute init.
  • Building From Source: Building from source is straightforward:
git clone https://github.com/aoci-spec/aoci-code.git
cd aoci-code
mkdir -p build
make build
./build/aoci --version

Key Commands & Local Panel (“常用命令与本地面板”):

The aoci command provides several tools for managing the AOCI index and its associated metadata:

  • aoci init: Sets up the repository contract and initial volumes layout (without business semantics).
  • aoci scan: Establishes a Baseline; changes within that Baseline are tracked as Scope Changes.
  • aoci ui: Provides a local, read-only panel for displaying the index, source code, compression ratio, chunk plan, drift, running services, and recommended inputs. Can be launched in the background with aoci ui --detach --json.
  • aoci verify: Reports Missing/Orphan/Stale/Unbaselined facts.
  • aoci check: Runs aggregated governance gatekeeping (checks).
  • aoci index agent guide: Enters a deterministic host Agent workflow.
  • aoci capabilities: Shows the current binary’s supported capabilities.
  • aoci doctor: Diagnoses repository and host integration issues.
  • aoci database: Configures and validates PostgreSQL/MySQL/openGauss schema evidence.

aoci ui Panel Details:

The aoci ui panel is particularly noteworthy:

  • Local-Only Listening: It only listens on the localhost (all other bindings are rejected).
  • GET & HEAD Only: It responds only to GET and HEAD requests, does not use locks, update databases, or modify any repository content.
  • Detached Mode: Can be launched in the background with aoci ui --detach --json. The JSON output provides a link to the panel.

Project Status & Licensing (“项目状态与许可”):

  • Version: v0.1.0-rc17 (Release Candidate)
  • License: FSL-1.1-MIT, which is a Fair Source/source-available software license.
  • Repository Data: Go language, approximately 889 stars and 136 forks, created in August 2024. Main branch: main.
  • Supported Hosts: Codex, Claude Code, Cursor, OpenCode, etc., which support standard stdio MCP hosts; README explicitly states that AOCI-CODE integrates with MCP host, not model vendor APIs.

Obtaining & Learning (“获取与了解”):

GitHub CLI Example for Downloading:

The document includes an example of using the GitHub CLI (gh) to download a release package:

gh auth login
gh release download v0.1.0-rc17 --repo aoci-spec/aoci-code

This guide provides a comprehensive overview of AOCI-CODE, covering its technical architecture, installation instructions, key features, and security considerations. The emphasis on boundaries and local access makes it suitable for environments where network connectivity is restricted or highly controlled.

More News

Want to see more quality content?

Browse all news