AI Pair Programmer (Ruby)
AI-powered tools for code review, brainstorming, performance analysis, and security review in Ruby.
AI Pair Programmer MCP Server (Ruby)
A Ruby implementation of an AI Pair Programmer MCP (Model Context Protocol) server that provides AI-powered tools for code review, brainstorming, performance analysis, and security review.
Features
This server provides 5 AI-powered tools:
- pair - General collaboration and problem-solving
- review - Comprehensive code review with actionable feedback
- brainstorm - Creative ideation and solution exploration
- review_performance - Performance analysis and optimization suggestions
- review_security - Security-focused code review and vulnerability detection
Installation & Setup
Prerequisites
- Ruby 3.0+
- An OpenRouter API key
Automatic Installation
The server uses inline bundler for automatic gem installation. Required gems:
fast-mcp- Ruby MCP server frameworkruby_llm- Unified AI model interface
Configuration
- Set your OpenRouter API key:
export OPENROUTER_API_KEY="your_api_key_here"
Running the Server
ruby ./server.rb
The server will:
- Automatically install missing gems on first run
- Start with STDIO transport for MCP clients
- Log to STDERR which should be saved by your MCP Host.
If the MCP fails to start when lunching Claude Code it's probably due to timeout.
The bundler is installing dependecies. To fix that either set an envvar MCP_TIMEOUT=10000 (10s) or start the MCP server in the terminal first.
Configuration
Models
The server supports these AI models via OpenRouter:
- Gemini (default) -
google/gemini-2.5-pro-preview - O3 -
openai/o3 - Grok -
x-ai/grok-3-beta - DeepSeek -
deepseek/deepseek-r1-0528 - Opus -
anthropic/claude-opus-4
MCP Client Configuration
Claude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"AiPairProgrammer": {
"command": "ruby",
"args": ["/path/to/server.rb"]
}
}
}
Usage Examples
Once connected to an MCP client:
Code Review
Please review this Ruby code for best practices and potential issues:
def process_data(items)
items.map { |item| item.upcase }
end
Performance Analysis
Can you analyze this code for performance bottlenecks?
def find_duplicates(array)
duplicates = []
array.each do |item|
if array.count(item) > 1 && !duplicates.include?(item)
duplicates << item
end
end
duplicates
end
Security Review
Please check this authentication code for security vulnerabilities:
def authenticate(username, password)
user = User.find_by(username: username)
if user && user.password == password
session[:user_id] = user.id
true
else
false
end
end
Brainstorming
I need ideas for improving user onboarding in my Ruby on Rails app. The current flow has a 60% drop-off rate.
General Collaboration
I'm struggling with this algorithm problem. Can you help me think through it step by step?
Architecture
The server is built with:
- FastMcp - Ruby MCP server framework with STDIO transport
- RubyLLM - Unified interface to AI models via OpenRouter
- Inline Bundler - Automatic gem installation for easy deployment
License
MIT License
Prior work:
AI Assistant MCP Server by Eduard https://github.com/eduardm/ai_pairs_with_ai
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Test with
ruby test_server.rb - Submit a pull request
Related Servers
Scout Monitoring MCP
sponsorPut performance and error data directly in the hands of your AI assistant.
Alpha Vantage MCP Server
sponsorAccess financial market data: realtime & historical stock, ETF, options, forex, crypto, commodities, fundamentals, technical indicators, & more
MCP Server Manager for Claude
Install and manage Model Context Protocol (MCP) servers for Claude Desktop.
MCP JS Debugger
Debug JavaScript and TypeScript applications through the Chrome DevTools Protocol with full source map support.
Prometheus MCP
Expose Prometheus monitoring tools to an LLM for querying and analysis.
Elementor WordPress MCP Server
An MCP server for WordPress and Elementor, enabling AI assistants to manage content and build pages.
weibaohui/k8m
Provides multi-cluster Kubernetes management and operations using MCP, featuring a management interface, logging, and nearly 50 built-in tools covering common DevOps and development scenarios. Supports both standard and CRD resources.
Remote MCP Server on Cloudflare
A customizable remote MCP server for deployment on Cloudflare Workers, operating without authentication.
Aider MCP Server
An MCP server for offloading AI coding tasks to Aider, enhancing development efficiency and flexibility.
MCP SGF Server
Process SGF (Smart Game Format) files to extract game information and generate visual board diagrams.
DevHub
Manage and utilize website content within the DevHub CMS platform
Remote MCP Server (Authless)
An example of a remote MCP server deployable on Cloudflare Workers, featuring customizable tools and no authentication.