Repository navigation
MCP tool for retrieving code from Freva data analysis plugins - #49
Open
alex-fischer-97 wants to merge 48 commits into
Open
alex-fischer-97 wants to merge 48 commits into
alex-fischer-97 wants to merge 48 commits into
Conversation
… for searching and analyzing Freva plugins
update plugin code search functionality to include new file paths; improve context retrieval for Freva plugins.
improve file selection logic for user queries to search for additional code dependencies
…de context and clarify Python snippet generation process.
…de and improve context collection process.
…and adjust max relevant files for plugin code search Co-authored-by: Copilot <copilot@github.com>
enhance/refactor plugin code search functionality by Freva group (to allow for more than just ComDec); start with implementation of security check to allow only granted group members access to tool
… visibility, user_id + access level of current user + repo to determine if user has read rights for requested codebase
…gnatures; add user identification in GitLab access validation method via HTTP headers; cleanup + polishing methods
- add user access denial message and update project names reference; - refined system prompt for plugin_code_search tool in case of denied user access
… prompt library adjustments
- Updated the `plugin_code_search` function to auto-detect plugin and project names from user queries. - Improved the scope description for `plugin_code_search` to clarify its usage. - Added a new `available_plugins.md` file listing available Freva plugins and their functionalities.
…"available_plugins.md" with new project names + descriptions
- introduce dedicated plugin-code-search server for plugin_code_search MCP tool (Freva plugin code retrieval) - cleanup of web-search server - new docker container for this tool, populated docker-compose.dev.yml + .env.example accordingly
… for new plugin-code-search-server
added 4 commits
July 9, 2026 17:24
extend/adapt CI build steps with new plugin-code-search server
…s, increase benchmark runs and concurrency, and adjust evaluation metrics plotting
…ing in MCP manager with default_chatbot
…ompt instructions
…n_code_search tool
gekinci
reviewed
Oct 1, 2026
gekinci
reviewed
Oct 1, 2026
gekinci
reviewed
Oct 1, 2026
gekinci
reviewed
Oct 1, 2026
gekinci
reviewed
Oct 1, 2026
gekinci
reviewed
Oct 1, 2026
gekinci
reviewed
Oct 1, 2026
| out = "Unknown response." | ||
| web_sv = SVToolOutput(content=out, tool_name=tool_name, id=id) # type: ignore[arg-type] | ||
| web_msg = help_convert_sv_ccrm([web_sv]) | ||
| yield web_sv |
Collaborator
There was a problem hiding this comment.
The output of the generic tool is not streamed to the client, only to the model.
Suggested change
| yield web_sv |
Author
There was a problem hiding this comment.
For the evaluation script, I implemented this though to evaluate if the correct tool got called. In my tests with localhost, this did not result in the generic tool output being displayed in the chat interface.
gekinci
reviewed
Oct 1, 2026
gekinci
reviewed
Oct 1, 2026
gekinci
reviewed
Oct 1, 2026
gekinci
requested changes
Oct 1, 2026
gekinci
left a comment
Collaborator
There was a problem hiding this comment.
I would suggest to separate GPT-5 related changes to another PR.
For future PRs, it would also help to avoid unrelated or purely formatting changes, since keeping the diff focused makes the review process much easier.
…ng and update starting prompts
added 6 commits
October 6, 2026 16:20
- Refine plugin code search instructions in multiple prompt files for clarity and specificity
… and enhance file fetching logic
…t5_integration" branch)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request adds support for a new MCP server,
plugin-code-search-server, which enables automated and query-suited code context retrieval from GitLab repositories of Freva plugins for climate data analysis.The tools makes several calls to the used LLM via LiteLLM to automatically scan (given the repository tree list) and select those parts of the repo's source code (realized in 2 stages: first scrape the base, then their dependency files) – coming from the most fitting Freva plugin –, that seems most relevant to the user's query.
The extracted code is then analyzed in the following to guide the answer of the user w.r.t. data analysis for climate-related questions.
It is supposed to be called by LiteLLM when the user
configure it, or when code snippets from the plugin should be translated or
adapted into Python examples;
This PR also updates the documentation, environment, and Docker configurations to integrate this new service into the ClimateClaw stack. The most important changes are summarized below.
Plugin Code Search Server Integration
plugin_code_search(src/climateclaw/tools/plugin_code_search), withserver.pyfor the main code discovery and fetching logic; as well asavailable_plugins.mdwith names & descriptions of all relevant plugins.plugin-code-search-serverMCP service, including its Dockerfile (docker/plugin-code-search-server/Dockerfile) andpyproject.tomlconfig fileplugin-code-search-serverservice into bothdocker-compose.ymlanddocker-compose.dev.ymlwith appropriate health checks, environment variables, and volume mountsDocumentation Updates
README.mdto document the newplugin-code-search-server, its purpose, and how it fits into the MCP tool ecosystem, including updates to the architecture and quick start sections.Closes #115