Skip to content

Add MCP Server Implementation #65

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

07rjain
Copy link

@07rjain 07rjain commented Jun 8, 2025

🚀 Add Model Context Protocol (MCP) Server Implementation

This PR adds a complete MCP server implementation that converts the existing LangGraph research agent into a standardised Model Context Protocol server, enabling integration with Claude Desktop and other MCP-compatible clients.

✨ Features

  • 🧠 Gemini 2.5 Flash Integration: Uses gemini-2.5-flash-preview-05-20 model
  • ⚡ Tiered Effort Levels:
    • Low: 10 searches max
    • Medium: 100 searches max
    • High: 1000 searches max
  • 🔧 MCP Protocol Compliance: Full implementation with tools and resources
  • 🎯 Claude Desktop Ready: Pre-configured for easy integration
  • 📚 Comprehensive Documentation: Complete setup and usage guides
  • 🧪 Testing Suite: Unit, integration, and performance tests
  • 🏗️ Production Ready: Industry best practices and error handling

🛠️ Technical Implementation

  • FastMCP Framework: Async architecture with proper error handling
  • Citation Tracking: Maintains research quality with source attribution
  • Session Management: Stateful research sessions with progress tracking
  • Resource Provider: Exposes research documentation via MCP resources
  • Type Safety: Full type hints and validation

📁 Structure

mcp-server/
├── server.py # Main MCP server implementation (859 lines)
├── test_server.py # Comprehensive test suite (386 lines)
├── requirements.txt # Production dependencies
├── README.md # Setup and usage documentation
├── CONTRIBUTING.md # Contribution guidelines
├── CHANGELOG.md # Version history
├── SECURITY.md # Security policy
├── PROJECT_STATUS.md # Current status and roadmap
└── .github/ # GitHub templates and workflows

🚀 Quick Start

  1. Install dependencies: pip install -r mcp-server/requirements.txt
  2. Set environment: export GEMINI_API_KEY="your-key"
  3. Run server: python mcp-server/server.py
  4. Configure Claude Desktop with provided config

🔗 Integration Benefits

  • Seamless Claude Desktop Integration: Use the research agent directly within Claude
  • Standardized Interface: MCP protocol ensures compatibility with future tools
  • Maintained Compatibility: Full research capabilities from original LangGraph implementation
  • Enhanced Usability: Tiered effort levels for different research depths

📊 Testing & Quality

  • ✅ Unit tests for all core functions
  • ✅ Integration tests for MCP protocol compliance
  • ✅ Performance tests for effort level constraints
  • ✅ Error handling and edge case coverage

This implementation transforms the existing LangGraph research agent into a production-ready MCP server, while maintaining all research capabilities and introducing a professional, open-source project structure.

Copy link

google-cla bot commented Jun 8, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant