astra-mcp
Provides local code intelligence for AI agents, enabling indexing of repositories into a structural graph and searchable code-chunk index, with tools for semantic search, finding callers, and hybrid context retrieval.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@astra-mcpsearch my codebase for rate limiting implementation"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Astra is a local code intelligence service for AI agents. It parses repository files into a structural NetworkX graph and a searchable local code-chunk index, with AST-level enrichment for valid Python files. The same engine is available through the astra CLI and the official MCP Python SDK.
Architecture
The constellation mark represents the relationships Astra discovers across a codebase. Its pipeline has four stages: discover files without executing them, build the structural graph, index code chunks, and retrieve semantic matches with graph expansion.
Component | Role | Output |
AST and text parser | Reads Python declarations, docstrings, symbols, and calls; indexes other readable project files as file-level chunks. | Code chunks and references |
Structural graph | Builds directed NetworkX relationships between modules, declarations, and callers. |
|
Vector index | Stores searchable chunks locally, with optional Sentence Transformers and Chroma acceleration. |
|
Dual interfaces | Makes the same engine available to terminal users and MCP hosts. |
|
The MCP surface exposes four tools: astra_index_repo, astra_semantic_search, astra_get_callers, and astra_hybrid_context.
Related MCP server: Axon
Install
Python 3.10+ is required. Choose one of these installation paths.
Install directly from GitHub
This is the simplest option for using Astra. It installs the astra and astra-mcp commands without placing a checkout in your current folder:
python -m pip install "git+https://github.com/nimelkot/astra.git"For an isolated command-line installation, use pipx:
pipx install "git+https://github.com/nimelkot/astra.git"Clone for development
Use this option when you want to edit Astra or run its tests. Run the editable install from the cloned repository root, the directory containing pyproject.toml:
git clone https://github.com/nimelkot/astra.git
cd astra
Get-ChildItem pyproject.toml
python -m venv .venv
.venv\Scripts\Activate.ps1
python -m pip install -e ".[dev]"If Get-ChildItem pyproject.toml cannot find the file, you are not in the Astra repository root yet. The folder you want to analyze can be anywhere; it does not need to be inside the Astra checkout.
Quick start
Index a project first. Replace the example path with the folder you want Astra to analyze:
astra index C:\Users\YourName\Downloads\my-projectThe command recursively scans nested folders for files without importing or executing them. Valid Python files receive AST-level declarations and call relationships; other readable source, configuration, markup, and documentation files receive searchable file-level chunks. Binary files, unsupported encodings, files larger than 2 MB, and generated or dependency directories such as .git, .venv, node_modules, and .astra_vectors are skipped.
For a complete support matrix, see docs/supported-file-types.md.
my-project/
├── .astra_graph.json # structural modules, declarations, and call relationships
└── .astra_vectors/ # local searchable code chunksRun astra index again after the source code changes. Indexing replaces the previous graph and chunk index for that target directory.
CLI
Semantic search
Search by a concept, behavior, symbol name, or docstring text:
astra search "authentication token validation" --path C:\Users\YourName\Downloads\my-project --limit 8The result table shows the match score, declaration kind, file path, symbol, and source lines. Search results are empty when no indexed chunk shares terms with the query.
Structural callers
Find functions that call a target function:
astra query callers calculate_total --path C:\Users\YourName\Downloads\my-projectThe callers query uses the saved AST graph and reports matching caller nodes as JSON. The current CLI structural query type is callers.
Search behavior
The default index is deterministic and works offline using local lexical matching. To enable Sentence Transformers and Chroma vector retrieval, set this before indexing and searching:
$env:ASTRA_ENABLE_EMBEDDINGS = "1"
astra index C:\Users\YourName\Downloads\my-project
astra search "rate limiting and retries" --path C:\Users\YourName\Downloads\my-projectThe first embedding-enabled run may download the all-MiniLM-L6-v2 model. If model access or the vector store is unavailable, Astra falls back to the local search implementation.
Visualize an index
After indexing, generate a local HTML report for the target folder:
astra visualize C:\Users\YourName\Downloads\my-projectThis writes .astra_visualization.html into the target folder. Open that file in a browser to inspect two views:
Structural graph: interactive modules, classes, functions, methods, and definition/call edges from
.astra_graph.json.Vector chunks: searchable file and symbol cards from
.astra_vectors/chunks.json, with expandable source previews.
You can choose a different output path:
astra visualize C:\Users\YourName\Downloads\my-project --output C:\Users\YourName\Desktop\astra-report.htmlThe report uses the Vis Network browser library from its CDN for the structural canvas. The vector view and generated data remain local; an internet connection is only needed to load the interactive graph library when opening the report.
Visualization examples
The structural graph view renders connected modules, declarations, and relationships across the indexed project:
The vector chunks view provides searchable cards with file paths, symbols, line ranges, and expandable source previews:
MCP
Astra also exposes its engine as an official MCP server over stdio. Configure your MCP host to run astra-mcp; the server must be installed in the environment used by that host.
The four native tools are:
Tool | Purpose |
| Index a local repository. |
| Search indexed code chunks. |
| Find callers through the structural graph. |
| Combine semantic matches with graph expansion. |
| Generate a local HTML graph report and return its file path and URL. |
The repository includes .vscode/mcp.json for VS Code MCP clients. For other hosts, register the server in the host's configuration:
[mcp_servers.astra]
command = "astra-mcp"
args = []If the host cannot find commands from your shell, use the absolute executable path: .venv\Scripts\astra-mcp.exe on Windows or .venv/bin/astra-mcp on macOS/Linux. The server communicates over stdio, so do not redirect its stdout.
Development
pytest
ruff check .Astra never imports or executes files it indexes. Parsing failures are skipped and reported only through the resulting counts, which keeps indexing useful for partially broken working trees.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceProvides semantic code search and retrieval capabilities for AI agents, enabling them to query codebases using natural language with automatic learning, hybrid search, and intelligent chunking of functions and classes.429ISC
- AlicenseNot gradedqualityCmaintenanceA graph-powered code intelligence engine that indexes codebases into a structural knowledge graph to provide AI agents with deep context on function calls, types, and execution flows. It offers local, zero-dependency tools for hybrid search, impact analysis, and dead code detection across Python, JavaScript, and TypeScript projects.730MIT

Semantic Code Search MCPofficial
FlicenseNot gradedqualityDmaintenanceProvides AI coding agents with structured access to indexed codebases via semantic search, symbol analysis, and file reading tools.12- FlicenseNot gradedqualityDmaintenanceEnables AI agents to semantically search and navigate code repositories using natural language, with support for multiple repos, incremental indexing, and no local install needed.
Related MCP Connectors
Code intelligence for coding agents: semantic, AST, graph, and full-text search. 279+ languages.
Give your AI agent a persistent map of your project's structure, dependencies, and bugs.
Codebase intelligence for agents: 152 structured artifacts across 21 programs, one call.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/nimelkot/astra'
If you have feedback or need assistance with the MCP directory API, please join our Discord server