-
Notifications
You must be signed in to change notification settings - Fork 63
feat: XtraMCP Integration #11
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
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 dynamic tool loading system for XtraMCP integration, replacing the previous manual tool registration approach. The new system automatically initializes MCP sessions, fetches available tools, and creates dynamic tool instances that reuse session IDs for efficient execution.
Key changes:
- Implemented
XtraMCPLoaderto dynamically discover and register tools from XtraMCP backend - Created
DynamicToolto handle generic tool execution with session reuse - Added MCP initialization utilities and corresponding tests
- Modified AIClient to use dynamic tool loading instead of static registration
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 14 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/services/toolkit/tools/xtramcp/tool.go | Implements DynamicTool with session ID reuse for executing MCP tools |
| internal/services/toolkit/tools/xtramcp/loader.go | Implements XtraMCPLoader for MCP session initialization and dynamic tool discovery |
| internal/services/toolkit/tools/xtragpt/util_test.go | Adds comprehensive tests for MCP initialization and notification workflows |
| internal/services/toolkit/tools/xtragpt/util.go | Provides utility functions for MCP protocol communication |
| internal/services/toolkit/tools/xtragpt/search_papers.go | Contains SearchPapersTool implementation (appears to be legacy code) |
| internal/services/toolkit/client/client.go | Updates AIClient to use XtraMCPLoader for dynamic tool registration |
| internal/api/gin.go | Changes CORS configuration to allow all origins |
| hack/values-dev.yaml | Adds development configuration for namespace and MongoDB settings |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Junyi-99
left a comment
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.
lgtm
Key Changes:
Previously, we experimented with registering
search_paperstool. It is tedious and not scalable to manually create separate files and extension for each tool. Here, we propose a dynamic loader that initializes connection with the XtraMCP and dynamically load tools exposed by XtraMCP.XtraMCPLoaderDynamicToolOverall Workflow
↓
↓
↓
↓
↓
See result below from the dynamic loading:
Issues