CortexAST logo

CortexAST

Organization
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.

Publishercortex-works
Repositorycortex-ast
LanguageRust
Forks
4
Stars
9
Available tools
0
Transport typestdio
Categories
LicenseMIT
Links
  • Connect tools to AI workflows

    CortexAST exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    9 stars and 4 forks from the linked 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*

Installation

TypingMind
Prerequisites:

Node.js 18+

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

Use CortexAST MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once CortexAST is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add CortexAST as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the CortexAST MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "cortex-works-cortex-ast": {
      "command": "npx",
      "args": [
        "-y",
        "cortex-ast"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the CortexAST MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the CortexAST MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use CortexAST to help me with this task?
CortexAST
Sure. I read it.
Here is what I found using CortexAST.

Frequently asked questions

What is the CortexAST MCP server used for?

CortexAST is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use CortexAST MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use CortexAST with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use CortexAST MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With CortexAST connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect CortexAST MCP to TypingMind?

CortexAST runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does CortexAST MCP provide in TypingMind?

CortexAST exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use CortexAST MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If CortexAST requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇