A powerful, multi-agent CLI tool that orchestrates AI agents to interact with Linear, GitHub, and Supabase through Model Context Protocol (MCP) servers with an integration layer powered by Composio.
CodePilot is a Rust-based terminal application that provides an intelligent interface for managing project workflows across multiple platforms. It uses specialized AI agents to understand user queries and execute appropriate actions through MCP servers.
- Language: Rust
- Async Runtime: Tokio
- UI Framework: Ratatui + Crossterm
- AI Framework: swarms-rs
- HTTP Client: Reqwest
- Serialization: Serde + Serde JSON
- Error Handling: Anyhow
- Configuration: dotenv
- Date/Time: Chrono
- Multi-Agent Architecture: Specialized agents for Linear, GitHub, and Supabase
- Dynamic Tool Discovery: Tools fetched from MCP servers at runtime
- Intelligent Query Routing: Automatic agent selection based on query content
- Interactive Terminal UI: Modern interface with real-time status updates
- Robust Error Handling: Graceful fallbacks and helpful error messages
- Type Safety: Rust's type system ensures reliability
- Async Operations: Concurrent operations with Tokio runtime
- Rust 1.70+ and Cargo
- API keys for:
- OpenAI (for AI processing)
- Linear (for project management)
- GitHub (for repository operations)
- Supabase (for database operations)
# Clone the repository
git clone https://github.com/rohittcodes/codepilot.git
cd codepilot
# Build the project
cargo build --release
# Run the application
cargo run
Create a .env
file in the project root with your API keys:
OPENAI_API_KEY=your_openai_api_key
OPENAI_BASE_URL=https://api.openai.com/v1
LINEAR_API_KEY=your_linear_api_key
GITHUB_TOKEN=your_github_token
SUPABASE_URL=your_supabase_url
SUPABASE_KEY=your_supabase_anon_key
cargo run
The application will start an interactive terminal UI where you can:
- Enter queries in natural language
- View real-time status of operations
- See formatted responses from different services
- Navigate through results using keyboard shortcuts
- Linear: "Create a new issue in the backend project"
- GitHub: "List all open pull requests in the main repository"
- Supabase: "Show me the latest user registrations"
codepilot/
├── src/
│ ├── main.rs # Application entry point
│ ├── lib.rs # Library exports
│ ├── cli/ # CLI application logic
│ ├── agents/ # AI agent implementations
│ │ ├── linear.rs # Linear project management agent
│ │ ├── github.rs # GitHub repository agent
│ │ └── supabase.rs # Supabase database agent
│ ├── clients/ # MCP client implementations
│ │ ├── linear.rs # Linear MCP client
│ │ ├── github.rs # GitHub MCP client
│ │ └── supabase.rs # Supabase MCP client
│ ├── config/ # Configuration management
│ ├── orchestrator.rs # Multi-agent orchestration
│ └── formatter.rs # Response formatting
├── Cargo.toml # Rust dependencies
├── ARCHITECTURE.md # Detailed architecture docs
└── README.md # This file
- User enters a natural language query
- The query is routed to the appropriate agent based on content analysis
- The selected agent processes the query using OpenAI's GPT-4 Turbo
- Agents discover available tools from MCP servers
- Tools are scored for relevance to the current query
- The most relevant tool is selected for execution
- Selected tools are executed through MCP clients
- MCP servers communicate with external APIs
- Results are formatted and displayed to the user
- Responses are formatted for optimal readability
- Status updates are shown in real-time
- Error handling provides graceful fallbacks
# Development build
cargo build
# Run with logging
RUST_LOG=debug cargo run
# Run all tests
cargo test
# Run specific test
cargo test test_name
# Format code
cargo fmt
# Lint code
cargo clippy
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
For issues and questions, please refer to the project's issue tracker or documentation.