βββββββ ββββββββββββ ββββββββββββ ββββββββ βββββββββββββ ββββββββββββ βββ ββββββββββ ββββββ βββ βββ βββ βββββββββ ββββββββββ βββ ββββββββββββββββββββ ββββββ βββ βββββββ βββββββββββ βββββ βββ**Autonomous AI Coding Assistant - Never Gives Up** [](https://www.python.org/downloads/) [](https://opensource.org/licenses/Apache-2.0) [](https://openrouter.ai) [](https://modelcontextprotocol.io/) [](http://makeapullrequest.com) **An AI agent that explores codebases, implements features, fixes bugs, and refactors code autonomously through natural language commands. Now with Model Context Protocol (MCP) for enhanced capabilities.** [Features](#-features) β’ [Quick Start](#-quick-start) β’ [MCP Integration](#-mcp-integration) β’ [Usage](#-usage) β’ [Examples](#-examples)
Unlike traditional coding assistants that just suggest code, CodeAgent is truly autonomous:
Implement β Test β Error? β Fix β Test β Success β
# Clone the repository
git clone https://github.com/mikeoller82/Gent.git
cd Gent
# Install with uv (recommended)
uv pip install -e .
# Or with pip
pip install -e .
# Install MCP dependencies
pip install mcp httpx
Create a .env file:
# Required
OPENROUTER_API_KEY=your-api-key-here
# Optional: Enable MCP servers (defaults to context7)
MCP_ENABLED_SERVERS=context7,playwright,markitdown
# Optional: Disable MCP entirely
# DISABLE_MCP=true
# Interactive mode
codeagent
# Single command
codeagent "list all Python files in this directory"
# Use MCP features
codeagent "How do I use Next.js 15 server actions? Use the latest docs."
CodeAgent integrates with the Model Context Protocol to provide enhanced capabilities beyond its core functionality.
| Server | Purpose | Status | Setup |
|---|---|---|---|
| context7 | Up-to-date library documentation | β Default | No setup needed |
| playwright | Browser automation & testing | βοΈ Optional | Installs on first use |
| markitdown | Convert documents to Markdown | βοΈ Optional | Installs on first use |
| filesystem | Enhanced file operations | βοΈ Optional | Installs on first use |
| github | GitHub API integration | βοΈ Optional | Requires API token |
| brave-search | Web search | βοΈ Optional | Requires API key |
Enable specific servers:
# In .env file
MCP_ENABLED_SERVERS=context7,playwright,markitdown
Disable MCP:
# In .env file
DISABLE_MCP=true
Get current documentation:
You: How do I use React 19 hooks? Use the latest documentation.
β mcp_context7_resolve_library_id
β mcp_context7_get_library_docs
β Returns current React 19 docs
Automate browser testing:
You: Test the login form on staging.myapp.com
β mcp_playwright_navigate
β mcp_playwright_fill
β mcp_playwright_click
β mcp_playwright_screenshot
β Automated test complete
Convert documents:
You: Convert this PDF to markdown: report.pdf
β mcp_markitdown_convert_to_markdown
β PDF converted to Markdown
$ codeagent
ββββββββββββββββββββββββββββββββββββββββββββββββββββ
β AI-Powered Coding Agent β
β Working Directory: /home/user/myproject β
ββββββββββββββββββββββββββββββββββββββββββββββββββββ
π MCP Servers: context7, playwright
You: fix the authentication bug
β get_files_info
β get_file_content
β get_file_content
π Modifying auth.py
β Successfully wrote to "auth.py"
β run_python_file
β Task Complete
You: exit
# Simple task
codeagent "add logging to all functions"
# Complex task with MCP
codeagent "refactor to use the latest Next.js 15 patterns"
# With verbose output
codeagent "implement rate limiting" --verbose
exit or quit - Exit the programclear - Clear the screen--verbose prefix - Enable detailed output for that request$ codeagent "Build a Next.js 15 app with server actions using latest best practices"
Starting task: Build a Next.js 15 app with server actions
β mcp_context7_resolve_library_id
β mcp_context7_get_library_docs
π Creating app/page.tsx
π Creating app/actions.ts
π Creating app/layout.tsx
β Task Complete
Built Next.js 15 app using current server actions patterns:
- App router with React Server Components
- Server actions for data mutations
- TypeScript with proper typing
- Latest Next.js 15 features
Modified files:
β’ app/page.tsx
β’ app/actions.ts
β’ app/layout.tsx
$ codeagent "find and fix the memory leak in the cache manager"
Starting task: find and fix the memory leak in the cache manager
β get_files_info
β get_file_content
β get_file_content
β get_file_content
π Modifying cache_manager.py
Changes:
--- cache_manager.py (before)
+++ cache_manager.py (after)
@@ -23,6 +23,7 @@
def set(self, key, value):
self.cache[key] = value
+ self._cleanup_old_entries()
β Successfully wrote to "cache_manager.py"
β run_python_file
β Task Complete
$ codeagent "Test the signup flow on staging.example.com"
Starting task: Test the signup flow
β mcp_playwright_navigate
β mcp_playwright_fill
β mcp_playwright_click
β mcp_playwright_wait_for
β mcp_playwright_screenshot
β Task Complete
Signup flow tested successfully:
- Navigated to staging.example.com/signup
- Filled email and password fields
- Clicked submit button
- Verified redirect to dashboard
- Screenshot saved: signup-test.png
All assertions passed β
$ codeagent "Convert the project requirements PDF to markdown"
Starting task: Convert requirements PDF
β get_files_info
β mcp_markitdown_convert_to_markdown
π Creating requirements.md
β Task Complete
Converted requirements.pdf to Markdown:
- Preserved document structure
- Extracted all sections
- Formatted tables correctly
- Maintained heading hierarchy
Output: requirements.md
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β User Input: "Use latest React patterns" β
ββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββ
β 1. EXPLORE β
β get_files_info() β
β get_file_content() β
ββββββββββββ¬ββββββββββββ
β
βΌ
ββββββββββββββββββββββββ
β 2. RESEARCH (NEW) β
β MCP: context7 β
β Get current docs β
ββββββββββββ¬ββββββββββββ
β
βΌ
ββββββββββββββββββββββββ
β 3. ANALYZE β
β Understand code β
β Identify updates β
ββββββββββββ¬ββββββββββββ
β
βΌ
ββββββββββββββββββββββββ
β 4. IMPLEMENT β
β write_file() β
β Show diffs β
ββββββββββββ¬ββββββββββββ
β
βΌ
ββββββββββββββββββββββββ
β 5. VERIFY β
β run_python_file() β
β MCP: playwright β
ββββββββββββ¬ββββββββββββ
β
Error?
βββ΄ββ
Yes No
β β
ββββββββββ βββββββββββ
β β
βΌ βΌ
ββββββββββββββββ βββββββββββββββββ
β 6. FIX β β 7. REPORT β
β Analyze β β Success! β
β Fix issue β βββββββββββββββββ
ββββββββ¬ββββββββ
β
ββββββββββββ
β
βΌ
Back to step 5
| Function | Purpose | Type |
|---|---|---|
get_files_info(directory) |
List directory contents | Native |
get_file_content(file_path) |
Read file contents | Native |
write_file(file_path, content) |
Create/modify files | Native |
run_python_file(file_path, args) |
Execute Python scripts | Native |
mcp_context7_get_library_docs |
Get current documentation | MCP |
mcp_playwright_navigate |
Navigate browser | MCP |
mcp_markitdown_convert |
Convert documents | MCP |
| Feature | CodeAgent | GitHub Copilot | ChatGPT | Cursor |
|---|---|---|---|---|
| Autonomous exploration | β | β | β | β οΈ |
| Self-verification | β | β | β | β |
| Persistent until complete | β | β | β | β |
| Live diff display | β | β | β | β |
| CLI interface | β | β | β | β |
| Multi-file changes | β | β οΈ | β | β |
| Error correction loop | β | β | β | β οΈ |
| Current documentation (MCP) | β | β | β | β οΈ |
| Browser automation (MCP) | β | β | β | β |
| Document processing (MCP) | β | β | β | β |
Edit .env to enable/disable servers:
# Enable multiple servers
MCP_ENABLED_SERVERS=context7,playwright,markitdown,filesystem
# Context7 only (default)
MCP_ENABLED_SERVERS=context7
# Disable MCP completely
DISABLE_MCP=true
Edit codeagent/main.py to customize the agentβs behavior:
system_prompt = """
Your custom instructions here...
"""
Adjust safety limits in process_request():
max_iterations = 100 # Default: 100
β
Operates only within the current working directory
β
Shows all changes with diffs before applying
β
Tracks all file modifications
β
Provides detailed summaries
β
Uses MCP servers safely (sandboxed)
β
Review changes before committing
β
Test in a separate branch first
β
Use version control (git)
β
Keep backups of important files
β
Start with --verbose mode to understand behavior
β
Review MCP server configurations before enabling
β Access files outside working directory
β Make unauthorized network requests
β Execute arbitrary system commands
β Modify system files
β Share data without permission
Contributions welcome! Hereβs how:
git checkout -b feature/amazing-featuregit commit -m 'Add amazing feature'git push origin feature/amazing-feature# Clone your fork
git clone https://github.com/mikeoller82/Gent.git
cd Gent
# Install in development mode
uv pip install -e ".[dev]"
# Install MCP dependencies
pip install mcp httpx
# Run tests
pytest
Issue: Agent keeps reading the same files
Solution: This is normal during exploration phase. Agent will eventually move to implementation.
Issue: Agent stops before completing
Solution: Check the error message. Often needs more context or has hit an edge case. Try rephrasing your request.
Issue: API errors
Solution: Verify your OPENROUTER_API_KEY is set correctly and has quota remaining.
Issue: βMCP SDK not installedβ
Solution: Run pip install mcp httpx
Issue: MCP servers not connecting
Solution: Ensure Node.js 18+ is installed. First run downloads dependencies automatically.
Issue: βUnknown serverβ error
Solution: Check server name spelling in MCP_ENABLED_SERVERS. Available: context7, playwright, markitdown, filesystem, github, brave-search
Issue: Playwright fails to start
Solution: First run downloads browser binaries (~300MB). Requires internet connection.
Issue: Want to disable MCP
Solution: Set DISABLE_MCP=true in .env file. All native functions continue to work.
Apache 2.0 License - see LICENSE file for details.