CodeAgent MCP
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., "@CodeAgent MCPHow does the file watching indexing system work?"
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.
CodeAgent MCP
An autonomous code-reasoning agent built on the Model Context Protocol (MCP). It parses your repository using tree-sitter, indexes all symbols into SQLite, and drives an agentic loop powered by Claude via OpenRouter to answer questions about your codebase.
Architecture
┌──────────────────────────────────────────────────┐
│ CLI (typer + rich) │
│ codeagent ask "what does Foo.bar() do?" │
└──────────────┬───────────────────────────────────┘
│
┌──────────────▼───────────────────────────────────┐
│ Agent Server (agent_server/) │
│ • Agentic loop — OpenRouter API (Claude) │
│ • Tool dispatch ↔ Code Server via MCP │
│ • Conversation history manager │
└──────────────┬───────────────────────────────────┘
│ MCP (stdio / SSE)
┌──────────────▼───────────────────────────────────┐
│ Code Server (code_server/) │
│ • FastMCP server │
│ • tree-sitter AST indexer → SQLite │
│ • Tools: search_symbols, find_callers, │
│ read_code, get_imports │
│ • watchdog file watcher (auto-reindex) │
└──────────────────────────────────────────────────┘Related MCP server: Code-Index-MCP
Setup Instructions
Clone the repository:
git clone <repo-url> && cd codeagentSet up virtual environment & install:
python3 -m venv .venv source .venv/bin/activate pip install -e .Configure environment variables:
cp .env.example .env # Open .env and set your OPENROUTER_API_KEYIndex the repository:
codeagent index .Ask questions:
codeagent ask "How is the AST indexed into SQLite?"
Example Queries
Find all functions:
codeagent ask "What functions are defined in this codebase?"Trace function execution flow:
codeagent ask "Which components call start_watcher()?"Explain architectural design:
codeagent ask "How does the file watching indexing system work?"
Environment Variables
Variable | Required | Description |
| ✅ | Your OpenRouter API key ( |
| optional | Default repo path (defaults to |
Tech Stack
Layer | Library |
LLM |
|
MCP |
|
Code parsing |
|
Database |
|
File watching |
|
CLI |
|
Testing |
|
Development
# Run all tests
pytest -v
# Run only indexer tests
pytest tests/test_indexer.py -v
# Index a repo manually (Python API)
python3 -c "
import asyncio
from code_server.indexer import index_repo
asyncio.run(index_repo('/path/to/repo'))
"Project Structure
codeagent/
├── code_server/
│ ├── indexer.py # tree-sitter AST → SQLite (Phase 1 ✅)
│ ├── tools.py # MCP tools: search_symbols, find_callers, read_code, get_imports
│ ├── server.py # FastMCP server
│ └── watcher.py # watchdog file watcher
├── agent_server/
│ ├── loop.py # agentic loop (OpenRouter + tool use)
│ └── history.py # conversation history manager
├── cli/
│ └── main.py # typer CLI
├── tests/
│ ├── test_indexer.py ✅ 6 passing
│ ├── test_tools.py
│ └── test_loop.py
├── .env.example
└── pyproject.tomlBuild Phases
Phase 0 — Project scaffold,
pyproject.toml, venv, package installsPhase 1 — AST indexer (
indexer.py)Phase 2 — Code tools (
tools.py)Phase 3 — FastMCP server (
server.py)Phase 4 — Conversation history manager (
history.py)Phase 5 — Core Agentic loop (
loop.py)Phase 6 — Rich CLI (
main.py)Phase 7 — Watchdog file watcher (
watcher.py)Phase 8 — Verification & Test suite (36/36 tests passing)
Phase 9 — Complete README documentation
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
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/AbhiGupta1310/CodeAgent-MCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server