AI Peer Review MCP Server
Enables local language models to request real-time peer review feedback from Google Gemini to improve response quality, accuracy, and completeness through AI collaboration.
README
AI Peer Review MCP Server
Enhance your local LLM responses with real-time peer review from Google Gemini
A Model Context Protocol (MCP) server that enables local language models to request peer review feedback from Google Gemini, dramatically improving response quality through AI collaboration.
🌟 Features
- Real-time peer review from Google Gemini for any local LLM response
- Manual trigger system - user controls when to request peer review
- Detailed feedback analysis - accuracy, completeness, clarity, and improvement suggestions
- Comprehensive logging - see exactly what feedback Gemini provides
- Privacy-conscious - only shares content when explicitly requested
- Free to use - leverages Google Gemini's free tier
- Easy integration - works with any MCP-compatible local LLM setup
🎯 Use Cases
- Fact-checking complex or technical responses
- Quality improvement for educational content
- Writing enhancement for creative tasks
- Technical validation for coding explanations
- Research assistance with multiple AI perspectives
📋 Prerequisites
- Python 3.8+ installed on your system
- LMStudio (or another MCP-compatible LLM client)
- Google AI Studio account (free) for Gemini API access
- Local LLM with tool calling support (e.g., Llama 3.1, Mistral, Qwen)
🚀 Quick Start
1. Get Google Gemini API Key
- Visit Google AI Studio
- Sign in with your Google account
- Click "Get API key" → "Create API key in new project"
- Copy your API key (starts with
AIza...)
2. Install the MCP Server
# Clone or create project directory
git clone https://github.com/your-repo/ai-peer-review-mcp # Replace with the actual repo URL
cd ai-peer-review-mcp
# Create a virtual environment (recommended)
python3 -m venv venv
source venv/bin/activate # On Windows use `venv\Scripts\activate`
# Install dependencies
pip install -r requirements.txt
# Create environment file
cp .env.example .env
# Now, edit the .env file and add your API key:
# GEMINI_API_KEY=your_actual_api_key_here
3. Review Server Files
requirements.txt:
requests
python-dotenv
server.py: (See full code in the repository)
4. Configure LMStudio or any other supported MCP Host (e.g Claude Desktop)
Add this configuration to your LMStudio MCP settings:
{
"mcpServers": {
"ai-peer-review": {
"command": "python",
"args": ["server.py"],
"cwd": "/path/to/your/ai-peer-review-mcp",
"env": {
"GEMINI_API_KEY": "your_actual_api_key_here"
}
}
}
}
Finding MCP Settings in LMStudio:
- Look for: Settings → MCP Servers
- Or: Tools & Integrations → MCP Configuration
- Or: Program button → Edit MCP JSON
5. Test the Setup
- Restart LMStudio after adding the MCP configuration
- Start a new chat in LMStudio
- Ask any question: "What is quantum computing?"
- Request peer review: "Use the ai_peer_review tool to check and improve your answer"
📚 Usage Examples
Basic Usage
User: What causes climate change?
LLM: [Provides initial response about greenhouse gases...]
User: Use AI Peer Review to verify and improve that answer
LLM: [Calls ai_peer_review tool, receives feedback, provides enhanced response]
Technical Questions
User: Explain how neural networks work
LLM: [Initial technical explanation...]
User: Can you use ai_peer_review to make sure the explanation is accurate?
LLM: [Enhanced response with better technical details and examples]
Creative Tasks
User: Write a short story about AI
LLM: [Initial creative writing...]
User: Use peer review to improve the story structure and clarity
LLM: [Improved story with better narrative flow and character development]
🔧 Configuration Options
Environment Variables
GEMINI_API_KEY- Your Google Gemini API key (required)
Customization
You can modify the peer review prompt in server.py to focus on specific aspects:
review_prompt = f"""PEER REVIEW REQUEST:
# Customize this section for your specific needs
# Examples:
# - Focus on technical accuracy for coding questions
# - Emphasize creativity for writing tasks
# - Prioritize safety for medical/legal topics
...
"""
📊 Monitoring and Logs
The server creates detailed logs in mcp-server.log:
# Watch logs in real-time
tail -f mcp-server.log
# View recent activity
cat mcp-server.log | tail -50
Log Information Includes:
- Tool calls from LMStudio
- Requests sent to Gemini
- Raw Gemini responses
- Parsed feedback
- Error details
🐛 Troubleshooting
Common Issues
"Tool not available"
- Verify MCP server configuration in LMStudio
- Ensure your local model supports tool calling
- Restart LMStudio after configuration changes
"GEMINI_API_KEY not found"
- Check your
.envfile exists and has the correct key - Verify API key is valid in Google AI Studio
- Ensure environment variable is properly set in LMStudio config
"Rate limit exceeded"
- Google Gemini free tier has generous limits
- Wait a moment and try again
- Check Google AI Studio quota usage
"Model not found"
- API model names change over time
- Update
GEMINI_API_URLin server.js if needed - Check Google's latest API documentation
Debug Mode
Run the server manually to see detailed output. Make sure your virtual environment is active.
export GEMINI_API_KEY=your_api_key_here
python server.py
🔒 Privacy and Security
- Data sharing only on request - content is only sent to Gemini when explicitly triggered
- No persistent storage - conversations are not stored or logged beyond current session
- API key security - keep your Gemini API key private and secure
- Local processing - MCP runs entirely on your machine
🚧 Limitations
- Requires tool-calling models - basic instruction-following models won't work
- Internet connection required - needs access to Google Gemini API
- Rate limits - subject to Google Gemini API quotas (free tier is generous)
- Language support - optimized for English, other languages may work but aren't tested
🛣️ Roadmap
- [ ] Multi-provider support - Add Groq, DeepSeek, and other AI APIs
- [ ] Smart routing - Automatic provider selection based on question type
- [ ] Confidence thresholds - Auto-trigger peer review for uncertain responses
- [ ] Custom review templates - Domain-specific review criteria
- [ ] Usage analytics - Track improvement metrics and API usage
- [ ] Batch processing - Review multiple responses at once
🤝 Contributing
We welcome contributions! Here's how to help:
Development Setup
git clone https://github.com/your-repo/ai-peer-review-mcp # Replace with your repo URL
cd ai-peer-review-mcp
# Create and activate virtual environment
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Set up your environment
cp .env.example .env
# --> Add your GEMINI_API_KEY to the .env file
echo "Development environment ready. Run with 'python server.py'"
Ways to Contribute
- 🐛 Bug reports - Open issues for any problems you encounter
- 💡 Feature requests - Suggest new capabilities or improvements
- 📖 Documentation - Improve setup guides, add examples
- 🔧 Code contributions - Submit pull requests for fixes or features
- 🧪 Testing - Try with different models and report compatibility
- 🌍 Localization - Help support more languages
Contribution Guidelines
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes with clear, descriptive commits
- Add tests if applicable
- Update documentation for any new features
- Submit a pull request with a clear description
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🙏 Acknowledgments
- Anthropic - For creating the Model Context Protocol standard
- Google - For providing the Gemini API
- LMStudio - For excellent MCP integration
- Community contributors - Everyone who helps improve this project
📞 Support
- Issues: GitHub Issues
- Discussions: GitHub Discussions
🌟 Star History
If this project helps you, please consider giving it a star on GitHub! ⭐
Made with ❤️ for the AI community
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。