Logo vun CortexAST

CortexAST

Organisatioun
cortex-works

A powerful Model Context Protocol (MCP) server and Omni-AST engine. It empowers AI agents to seamlessly parse complex codebases, execute secure cross-project operations, and dynamically fetch token-optimized rules.

Editeurcortex-works
Repositorycortex-ast
SproochRust
Forks
4
Stären
9
Disponibel Tools
0
Transporttypstdio
Kategorien
LizenzMIT
Linken
  • Tools mat KI-Workflows verbannen

    CortexAST stellt MCP-Funktioune bereit, déi vu kompatibele KI-Clienten a KI-Agente kënne benotzt ginn.

  • 0 disponibel Tools

    Kuckt Iech déi opruffbar Aktiounen hei drënner un, mat Nimm a Beschreiwungen, wa se vum Server geliwwert ginn.

  • Konfiguratioun fir ze kopéieren

    Benotzt d'Installatiounsbeispiller, fir dëse Server an Ärem bevorzugte MCP-Client ze konfiguréieren.

  • Indicateure fir Open Source

    9 Stären an 4 Forks aus dem verlinkte Repository.

CortexAST 🧠⚡

The AI-Native Code Intelligence Backend for LLM Agents Pure Rust · MCP Server · Semantic Code Navigation · AST Time Machine · Self-Evolving Wasm Parsers

Rust License: MIT Version


What is CortexAST?

👁️ CortexAST is the "eyes" — read-only code intelligence. For write/execute capabilities, see the companion cortex-act project (the "hands").

CortexAST is a production-grade MCP (Model Context Protocol) server that gives AI coding agents (Claude, Gemini, GPT-4o, etc.) the ability to:

  • Navigate codebases semantically — find symbols, blast-radius analysis, cross-file propagation checklists
  • Evolve itself — download and hot-reload WebAssembly language parsers at runtime (Go, PHP, Ruby, Java, …)
  • Time-travel your codebase — Chronos snapshot system for pre/post-refactor AST-level comparison
  • Search local memory — hybrid semantic + keyword search over your codebase history

✋ To edit files, run commands, or patch configs, use cortex-act instead.


Feature Modules

1. 🔭 cortex_code_explorer

Codebase explorer. Use INSTEAD of ls/tree/find/cat. Two modes: map_overview (fast symbol map, near-zero tokens — run first on any repo) and deep_slice (token-budgeted XML with function bodies, vector-ranked by query). Use map_overview to orient; deep_slice to get code for editing.

2. 🎯 cortex_symbol_analyzer

AST symbol analysis. Use INSTEAD of grep/rg. Actions: read_source (extract exact source of a symbol from a file — do this before editing), find_usages (all call/type/field sites), find_implementations (structs implementing a trait), blast_radius (callers + callees — run before rename/delete), propagation_checklist (exhaustive update checklist for shared types).

3. ⏳ cortex_chronos

AST snapshot tool for safe refactors. Workflow: save_checkpoint (before edit) → edit → compare_checkpoint (verify). Use instead of git diff — AST-level, ignores formatting noise. Actions: save_checkpoint, list_checkpoints, compare_checkpoint, delete_checkpoint.

4. 🛠️ run_diagnostics

Run compiler diagnostics (cargo check / tsc / gcc). Call after any code edit to catch errors before proceeding. Returns file, line, code, message — structured for targeted fixes.

5. 🧠 cortex_memory_retriever

Search past agent decisions in global memory (semantic + keyword hybrid). Requires CortexSync. Call BEFORE any research or exploration — the answer may already be cached. Returns ranked entries: intent, decision, tags, files_touched.

6. 📋 cortex_get_rules

Fetch codebase AI rules for the current context. Requires CortexSync. Returns merged rules filtered by file_path (frontend/backend/db context). Call before starting any task in a new project.

7. ✨ cortex_remember

Save task outcome to permanent global memory. Requires CortexSync. Call at END of every task. intent+decision must be ≤200 chars each. For long artifacts write a file first and pass path via heavy_artifacts.

8. 🌍 cortex_list_network

List all AI-tracked codebases (Requires CortexSync network). Use to discover target_project IDs for cross-project operations.

9. 🌐 cortex_manage_ast_languages

Manage Wasm grammar parsers for non-core languages. Core (always active): rust, typescript, python. Call status to see active/available languages. Call add with languages[] to download and hot-reload parsers from GitHub tree-sitter releases. Available: go, php, cpp, c, c_sharp, java, ruby, dart.


Ecosystem Requirement: CortexSync 🧠

For full functionality, CortexSync (the "Brain") must be running in the background.

ToolDependent on CortexSync?Why?
cortex_rememberYesPersists task outcomes to the global journal.
cortex_memory_retrieverYesPerforms semantic vector search over past decisions.
cortex_get_rulesYesFetches centralized rules from the synchronized rule engine.
cortex_list_networkYesReads the global network map of codebases.
cortex_code_explorerNoLocal AST analysis.
cortex_symbol_analyzerNoLocal AST analysis.

If cortex-sync is offline, these tools will strictly return a graceful warning without interrupting the agent's workflow.



Quick Start

Prerequisites

  • Rust 1.80+
  • Ollama or LM Studio running locally (optional, for Auto-Healer)

Build & Run

bash
git clone https://github.com/DevsHero/CortexAST
cd CortexAST
cargo build --release

# Run as MCP server (stdio)
./target/release/cortexast

MCP Config (~/.cursor/mcp.json or Claude Desktop)

json
{
  "mcpServers": {
    "cortexast": {
      "command": "/path/to/cortexast",
      "args": []
    }
  }
}


Usage Examples

Semantic Explorer — Bird's-eye view of a project

json
{
  "name": "cortex_code_explorer",
  "arguments": {
    "action": "map_overview",
    "target_dir": "."
  }
}

Symbol Search — Find all usages across the repo

json
{
  "name": "cortex_symbol_analyzer",
  "arguments": {
    "action": "find_usages",
    "symbol_name": "AuthService",
    "target_dir": "."
  }
}

Time Travel — Compare AST after refactor

json
{
  "name": "cortex_chronos",
  "arguments": {
    "action": "compare_checkpoint",
    "symbol_name": "login",
    "tag_a": "pre-refactor",
    "tag_b": "__live__"
  }
}

Self-Evolving Wasm Language Support

Always AvailableDownloadable on Demand
Rust, TypeScript/JS, PythonGo, PHP, Ruby, Java, C, C++, C#, Dart
bash
# Agent calls this automatically when it detects a new language:
cortex_manage_ast_languages { "action": "add", "languages": ["go", "dart"] }

Development

bash
# Run all unit tests
cargo test

# Check (no link)
cargo check

---

## Architecture

CortexAST (binary) └── src/ ├── server.rs # MCP stdio server — all tool schemas + handlers ├── inspector.rs # LanguageConfig, LanguageDriver, Symbol, run_query ├── grammar_manager.rs # Wasm download + hot-reload (GitHub releases) ├── vector_store.rs # model2vec embeddings + cache invalidation ├── chronos.rs # AST snapshot time machine (Chronos) ├── memory.rs # global_memory.jsonl journal client └── project_map.rs # Network map for multi-repo roaming



## License

MIT — See [LICENSE](./LICENSE)

---

*Built with ❤️ in Rust · Semantic precision for the AI age*

Installatioun

TypingMind
Viraussetzungen:

Node.js 18+

{
  "mcpServers": {
    "cortex-works-cortex-ast": {
      "command": "",
      "args": []
    }
  }
}

CortexAST MCP mat verschiddene KI-Modeller benotzen

TypingMind verbënnt MCP-Tools um Niveau vum Aarbechtsberäich. Soubal CortexAST verbonnen ass, kënnt Dir et mat verschiddene KI-Modeller an TypingMind benotzen, amplaz et fir all Modell separat anzeriichten. Dës MCP-Integratioun leeft lokal iwwer den TypingMind-MCP-Connector op Ärem Apparat.

Ariichtungsuleedung fir de lokale Connector ze benotzen

Benotzt dës Optioun, wann den MCP-Server Zougrëff op lokal Fichieren, Appen oder privat Ressourcen op Ärem Computer brauch.

1

D'MCP-Astellungen opmaachen

Gitt an TypingMind op „Astellungen“, „Erweidert Astellungen“, dann op „Model Context Protocol“ a wielt „Connector ariichten“.

  1. Maacht TypingMind an Ärem Browser op.
  2. Klickt op d'Astellungssymbol.
  3. Gitt op „Erweidert Astellungen“.
  4. Maacht d'Sektioun „Model Context Protocol“ op.
  5. Klickt op „Connector ariichten“ a wielt „Dësen Apparat“.
Ariichtungsbildschierm vum TypingMind-MCP-Connector mat „Dësen Apparat“ ausgewielt
2

De Connector-Befeel ausféieren

Wielt „Dësen Apparat“, kopéiert de Befeel aus TypingMind a féiert en am Terminal aus. Loosst de Prozess lafen, wärend Dir MCP benotzt.

  1. Kopéiert den Ariichtungsbefeel, deen TypingMind uweist.
  2. Maacht Terminal op macOS oder Windows Terminal op Windows op.
  3. Pescht de Befeel an a féiert en aus.
  4. Bestätegt d'Installatioun vum Package, wann den Terminal Iech freet, ob Dir weiderfuere wëllt.
  5. Loosst den Terminal an de Prozess doranner lafen, wärend Dir MCP-Tools benotzt.
3

CortexAST als Server derbäisetzen

Wann de Connector-Status „Prett“ ass, klickt op „Serveren änneren“ a pescht d'MCP-Serverkonfiguratioun an.

  1. Waart, bis de Connector-Status „Prett“ weist.
  2. Klickt op „Serveren änneren“.
  3. Pescht d'MCP-Serverkonfiguratioun vu CortexAST an.
  4. Späichert d'Serverlëscht.
  5. Aktualiséiert, wann Dir kontrolléiere wëllt, ob de Connector nach ëmmer prett ass.
MCP-Astellunge vun TypingMind mat aktivem Server an dem Knäppchen „Serveren änneren“
{
  "mcpServers": {
    "cortex-works-cortex-ast": {
      "command": "npx",
      "args": [
        "-y",
        "cortex-ast"
      ]
    }
  }
}
4

D'Verbindung mat verschiddene Modeller benotzen

Späichert d'Serverlëscht, maacht „Plugins“ op an aktivéiert d'MCP-Tools vu CortexAST. Wielt dann e belibegen ënnerstëtzte KI-Modell an TypingMind a benotzt d'Tools am Chat oder weist se engem KI-Agent zou.

  1. Maacht d'Säit „Plugins“ an TypingMind op.
  2. Aktivéiert d'MCP-Tools vu CortexAST.
  3. Start e Chat a wielt de KI-Modell, deen Dir benotze wëllt.
  4. Benotzt d'MCP-Tools am Chat oder weist se engem KI-Agent zou.
  5. Wiesselt bei Bedarf op en anere KI-Modell, ouni MCP nei ze verbannen.
TypingMind-Chat mat aktivéierte MCP-Tools an engem ausgewielte KI-Modell
Hëlleft Dir mir bei dëser Aufgab mat CortexAST?
CortexAST
Jo. Ech hunn et gelies.
Dat hunn ech mat CortexAST fonnt.

Heefeg gestallte Froen

Fir wat gëtt de MCP-Server CortexAST benotzt?

CortexAST ass e MCP-Server, deen et kompatibele KI-Clienten erlaabt, sech mat externen Tools a Kontext ze verbannen. An TypingMind kënnt Dir dëse MCP-Server eemol derbäisetzen a seng Tools an Ärem KI-Aarbechtsberäich zur Verfügung stellen.

Kann ech CortexAST MCP mat méi KI-Modeller an TypingMind benotzen?

Jo. TypingMind verbënnt MCP-Tools um Niveau vum Aarbechtsberäich. Sou kënnt Dir CortexAST mat verschiddene KI-Modeller wéi Claude, ChatGPT, Gemini oder anere Modeller benotzen, déi Dir an TypingMind konfiguréiert hutt, ouni de MCP-Server fir all Modell separat anzeriichten.

Firwat CortexAST MCP mat TypingMind benotzen?

TypingMind ass eng vun de beschte Benotzeruewerfläche fir LLM-Chat, well et méi KI-Modeller, Prompts, Plugins, KI-Agenten, API-Schlësselen a MCP-Tools an engem Aarbechtsberäich zesummebréngt. Wann CortexAST verbonnen ass, kënnt Dir seng MCP-Tools mat Äre bevorzugte Modeller benotzen a gläichzäiteg Är Chataarbecht an TypingMind organiséieren.

Wéi verbannen ech CortexAST MCP mat TypingMind?

CortexAST leeft iwwer de lokale MCP-Connector vun TypingMind. Dat eegent sech am beschten, wann de MCP-Server Zougrëff op lokal Fichieren, Desktop-Apps, Kommandozeilen-Tools oder privat Ressourcen op Ärem Computer brauch.

Wéi eng Tools stellt CortexAST MCP an TypingMind zur Verfügung?

CortexAST stellt MCP-Funktiounen zur Verfügung, déi Dir op der Plugins-Säit vun TypingMind aktivéiere kënnt, fir se am Chat ze benotzen oder KI-Agenten zouzeweisen.

Muss ech meng API-Schlëssele mat TypingMind deelen, fir CortexAST MCP ze benotzen?

Nee. TypingMind setzt op lokal Veraarbechtung a léisst Iech d'Kontroll iwwer Är Modellubidder, API-Schlësselen, Prompts a MCP-Konfiguratioun. Wann CortexAST eng Authentifizéierung verlaangt, setzt déi néideg Headeren, OAuth-Astellungen oder lokal Konfiguratioun fir dee MCP-Server derbäi, wann Dir d'Verbindung erstallt.

Änlech MCP-Serveren

All weisen

Elo Ären eegene KI-Workspace ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇