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 MCPIndex the Flask repo and find the main application class."
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
A powerful, hosted Model Context Protocol (MCP) server that gives LLMs (like Claude, Cursor, and Windsurf) the ability to understand, navigate, and query any public GitHub repository.
CodeAgent clones the repository, indexes it using tree-sitter, and exposes a suite of code-intelligence tools via Server-Sent Events (SSE).
🌟 Vision & What It Is
The Problem: LLMs are great at writing code, but they struggle to explore large, unseen codebases. You can't just paste a 10,000-line repository into a chat window.
The Solution: CodeAgent acts as the "eyes and hands" of the LLM.
The user tells the LLM: "Index this GitHub repo"
The LLM calls our
index_github_repotool.CodeAgent clones the repo to disk, parses every file into an Abstract Syntax Tree (AST) using tree-sitter, and stores all functions, classes, and imports in a PostgreSQL database.
The LLM can now use tools like
search_symbols,find_callers, andread_codeto navigate the codebase precisely, fetching only the exact lines of code it needs.
Related MCP server: @lex-tools/codebase-context-dumper
🏗 Architecture
Here is exactly how CodeAgent works under the hood:
graph TD
subgraph Client [MCP Client]
LLM[Claude Desktop / Cursor / Web]
end
subgraph CodeAgent [CodeAgent Server]
FastMCP[FastMCP SSE Server]
SessionMgr[Session Manager]
Indexer[Tree-Sitter Indexer]
Tools[Code Intelligence Tools]
end
subgraph Storage [Storage Layer]
DB[(PostgreSQL)]
Disk[(Local Disk /tmp)]
end
LLM <-->|1. SSE Transport| FastMCP
FastMCP -->|2. Route Request| SessionMgr
FastMCP -->|4. Execute Tool| Tools
SessionMgr -->|3a. Git Clone| Disk
SessionMgr -->|3b. Trigger Indexing| Indexer
Indexer -->|Parse AST| Disk
Indexer -->|Store Symbols & Imports| DB
Tools -->|Query Metadata| DB
Tools -->|Read File Slices| DiskComponents
FastMCP (SSE): The transport layer. Listens for HTTP requests and maintains a streaming connection with the LLM.
Session Manager: Manages multi-tenant workspaces. Clones repos to
/tmp/codeagent_sessions/{id}and cleans them up after 24 hours.Tree-Sitter Indexer: Scans the codebase, understands the language syntax (Python, JS, TS, etc.), and extracts symbols.
Postgres: Stores relational metadata (
symbols,imports) for lightning-fast querying across massive codebases.
🛠 Available MCP Tools
CodeAgent equips the LLM with these exact capabilities:
Tool | Description |
| Clones and indexes a public repo. Returns a unique |
| Finds functions/classes by partial name using |
| Lists all symbols filtered by kind (e.g., all |
| Greps the codebase for places where a function is called. |
| Reads exact source code lines directly from disk. |
| Lists all imports recorded for a specific file. |
| Checks if a repository session is ready for querying. |
🚀 Quick Start (Using the Hosted Version)
Want to try it immediately? Add our public hosted endpoint to your MCP client!
Using Claude Desktop
Open Claude Desktop.
Go to Settings (Gear Icon) → Integrations (or Connectors).
Click Add Integration.
Enter the Server URL:
https://codeagent-mcp.onrender.com/sseClick Connect.
Note: Claude Web (Chrome/Safari) does not support MCP yet. You must use the Claude Desktop macOS/Windows app.
Using Cursor
Go to Cursor Settings → Features → MCP.
Click Add New MCP Server.
Choose SSE as the transport.
Enter URL:
https://codeagent-mcp.onrender.com/sse
Example Prompt:
"Index this repo: https://github.com/pallets/flask. Then tell me what the main application class looks like."
💻 Self-Hosting & Deployment
CodeAgent is fully open-source and easy to host yourself.
Prerequisites
Python 3.11+
PostgreSQL database (e.g., Neon free tier)
Git installed on the system
1. Local Development Setup
# Clone the repository
git clone https://github.com/YOUR_USERNAME/CodeAgent-MCP.git
cd CodeAgent-MCP
# Create virtual environment and install
python3 -m venv .venv
source .venv/bin/activate
pip install -e .
# Configure environment
cp .env.example .env
# Edit .env and set your DATABASE_URLRun the server locally:
python -m code_server.server
# Server will start at http://0.0.0.0:8000/sse2. Deploy to Railway or Render (Free Tier)
Push your code to GitHub.
Create a new service from your GitHub repo.
Set the
DATABASE_URLenvironment variable to your Postgres connection string.Deploy! The platforms will automatically detect the
Dockerfileand expose port8000.
🤝 Instructions for Contributors
We love contributions! If you want to make CodeAgent smarter, faster, or add support for more languages, here is how you can help:
How to Contribute
Fork the repo and create your branch from
main.Set up locally using the Local Development Setup instructions above.
Make your changes. Ensure your code is well-commented and clean.
Test your changes by running the server locally and connecting your own Claude Desktop to
http://localhost:8000/sse.Issue a Pull Request.
Areas to Improve (Ideas for PRs)
Add Language Support: Currently, we parse Python, JS, and TS. Help us add Go, Rust, Java, or C++ by updating the
indexer.pytree-sitter grammars!Smarter Chunking: Improve how
read_codereturns large files so the LLM context window doesn't get flooded.Vector Search: Introduce
pgvectorto allow semantic searching (e.g., "Find the authentication logic") instead of just exact symbol matching.File Tree Tool: Add a tool that returns the directory structure of the cloned repository.
Development Guidelines
All DB-touching functions live in
code_server/tools.pyand must accept asession_id.Tool wrappers for FastMCP live in
code_server/server.py.We use
asyncpgfor database pooling. Never use blocking synchronous calls in the async event loop.Use the
lifespanhook inserver.pyfor any startup/shutdown logic to avoidevent loop is closederrors.
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
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
- 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/saumyajain03/mcpCodeAgent'
If you have feedback or need assistance with the MCP directory API, please join our Discord server