-
Notifications
You must be signed in to change notification settings - Fork 18
feat: add OpenRAG MCP server v0 #729
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR introduces a new MCP (Model Context Protocol) server for OpenRAG that enables AI assistants like Claude Desktop and Cursor to interact with OpenRAG through chat, search, and document management tools. The implementation includes a modular tool registration system, comprehensive error handling, and configuration management via environment variables.
Key Changes:
- New
openrag-mcpPython package with MCP server implementation - Tool system for chat, search, and document management operations
- Configuration management with OpenRAG SDK integration
Reviewed changes
Copilot reviewed 12 out of 14 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| sdks/mcp/pyproject.toml | Package metadata and dependencies for the MCP server |
| sdks/mcp/README.md | Comprehensive documentation with setup instructions and usage examples |
| sdks/mcp/src/openrag_mcp/server.py | Main MCP server implementation with tool registration and dispatch |
| sdks/mcp/src/openrag_mcp/config.py | Configuration management and SDK client initialization |
| sdks/mcp/src/openrag_mcp/tools/registry.py | Tool registration and handler dispatch system |
| sdks/mcp/src/openrag_mcp/tools/chat.py | Chat tool with RAG-enhanced responses |
| sdks/mcp/src/openrag_mcp/tools/search.py | Semantic search tool with filtering support |
| sdks/mcp/src/openrag_mcp/tools/documents.py | Document ingestion and management tools |
| sdks/mcp/src/openrag_mcp/tools/init.py | Tool module initialization and registry exports |
| sdks/mcp/src/openrag_mcp/init.py | Package entry point |
| sdks/mcp/src/openrag_mcp/main.py | Module execution entry point |
| sdks/mcp/uv.lock | Dependency lock file for reproducible builds |
| pyproject.toml | Root project dependencies updated to include openrag-sdk |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -0,0 +1,80 @@ | |||
| """OpenRAG MCP Server - Main server setup and entry point.""" | |||
| #TODO: utilize the SDK directly so that any changes in parameters in SDK directky reflects the MCP | |||
Copilot
AI
Dec 26, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a TODO comment that should be addressed or tracked properly. If this is a known limitation, consider creating a GitHub issue and referencing it here, or implement the improvement before merging.
| #TODO: utilize the SDK directly so that any changes in parameters in SDK directky reflects the MCP | |
| # Note: The MCP server is currently configured explicitly rather than being driven | |
| # directly by the OpenRAG SDK, so changes to SDK parameters must be reflected here manually. |
| @@ -0,0 +1,80 @@ | |||
| """OpenRAG MCP Server - Main server setup and entry point.""" | |||
| #TODO: utilize the SDK directly so that any changes in parameters in SDK directky reflects the MCP | |||
Copilot
AI
Dec 26, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The typo "directky" should be corrected to "directly" in the TODO comment.
| #TODO: utilize the SDK directly so that any changes in parameters in SDK directky reflects the MCP | |
| #TODO: utilize the SDK directly so that any changes in parameters in SDK directly reflects the MCP |
| @@ -0,0 +1,34 @@ | |||
| [project] | |||
| name = "openrag-mcp" | |||
| version = "0.1.1" | |||
Copilot
AI
Dec 26, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The version "0.1.1" in pyproject.toml doesn't match the version "0.1.0" defined in init.py. Version numbers should be consistent across the package to avoid confusion and potential deployment issues.
| version = "0.1.1" | |
| version = "0.1.0" |
|
|
||
|
|
||
| def get_client(): | ||
| """Get an httpx async client configured for OpenRAG. | ||
|
|
||
| This is kept for backward compatibility with operations | ||
| not yet supported by the SDK (list_documents, ingest_url). | ||
| """ | ||
| import httpx | ||
|
|
||
| config = get_config() | ||
| return httpx.AsyncClient( | ||
| base_url=config.openrag_url, | ||
| headers=config.headers, | ||
| timeout=60.0, | ||
| ) |
Copilot
AI
Dec 26, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The get_client() function is defined but appears to never be used anywhere in the codebase based on the files shown. The docstring mentions it's for "backward compatibility" for operations like list_documents and ingest_url, but the documents.py implementation doesn't use it (it uses the chat endpoint for URL ingestion). If this function is genuinely unused, it should be removed to reduce code maintenance burden.
| def get_client(): | |
| """Get an httpx async client configured for OpenRAG. | |
| This is kept for backward compatibility with operations | |
| not yet supported by the SDK (list_documents, ingest_url). | |
| """ | |
| import httpx | |
| config = get_config() | |
| return httpx.AsyncClient( | |
| base_url=config.openrag_url, | |
| headers=config.headers, | |
| timeout=60.0, | |
| ) |
| | `openrag_list_documents` | List documents in the knowledge base | | ||
| | `openrag_delete_document` | Delete a document from the knowledge base | | ||
|
|
Copilot
AI
Dec 26, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The README references a tool named openrag_list_documents in the tools table (line 19), but this tool doesn't appear to be implemented in any of the tool files (chat.py, search.py, documents.py). This will cause confusion for users who expect to use this tool based on the documentation.
| | `openrag_list_documents` | List documents in the knowledge base | | |
| | `openrag_delete_document` | Delete a document from the knowledge base | | |
| | `openrag_delete_document` | Delete a document from the knowledge base | |
Introduces mcp.md and sequence.md to document OpenRAG MCP usage, configuration, features, and protocol flows. These files provide setup instructions, integration examples, and detailed sequence diagrams for all supported MCP tools and error handling.
This pull request introduces a new MCP (Model Context Protocol) server for OpenRAG, enabling AI assistants like Claude Desktop and Cursor to interact with OpenRAG via chat, search, and document management tools. It adds a new Python package (
openrag-mcp) with a modular structure, tool registration, configuration management, and comprehensive documentation. The changes include dependency updates, new source files for the MCP server, and detailed usage instructions.New MCP Server for OpenRAG
openrag-mcpthat exposes OpenRAG capabilities (chat, search, document management) via the MCP protocol, enabling integration with AI assistants. [1] [2] [3] [4] [5]Tooling and Extensibility
chattool handler with robust error handling and formatted responses, leveraging the OpenRAG SDK for backend operations.Configuration and SDK Integration
Documentation and Developer Experience
README.mdwith setup instructions, tool descriptions, configuration examples for Claude Desktop and Cursor, troubleshooting tips, and architecture diagrams to support both users and developers.Dependency Management
openrag-sdkand other requirements needed for the new MCP server functionality. [1] [2]