Skip to content

ROB-1238 top level dict mcp_servers for list of remote mcp servers. - #453

Merged
RoiGlinik merged 3 commits into
ROB-1238-mcpfrom
feature/ROB-1238-parse-mcp
May 27, 2025
Merged

RoiGlinik merged 3 commits into
ROB-1238-mcpfrom
feature/ROB-1238-parse-mcp

Conversation

@RoiGlinik

@RoiGlinik RoiGlinik commented May 26, 2025 •

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • New Features
    • Enhanced support for additional toolset configurations, allowing unified handling of both standard toolsets and MCP servers.
  • Refactor
    • Improved internal logic for toolset selection and classification, resulting in more precise toolset handling.
  • Chores
    • Updated Helm chart templates and values to include configuration support for MCP servers.

@RoiGlinik
RoiGlinik requested a review from moshemorad May 26, 2025 16:28
@coderabbitai

coderabbitai Bot commented May 26, 2025 •

Copy link
Copy Markdown
Contributor
## Walkthrough

The changes update the way toolsets and MCP servers are parsed and merged in the configuration logic. The `parse_toolsets_file` function now combines entries from both "toolsets" and "mcp_servers," explicitly tagging MCP servers with a "type" field. Toolset instantiation now relies on this "type" field. The `Toolset` class gains an optional `type` attribute.

## Changes

| File(s)                                           | Change Summary                                                                                                              |
|--------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------|
| holmes/config.py                                 | Modified toolsets parsing to merge "toolsets" and "mcp_servers", tagging MCP servers with "type". Updated merging logic to instantiate toolsets based on the "type" field. |
| holmes/core/tools.py                             | Added enum `ToolsetType` and optional `type` attribute to the `Toolset` class.                                               |
| helm/holmes/templates/toolset-config.yaml, helm/holmes/values.yaml | Added `mcp_servers` key to Helm values and ConfigMap template to support MCP server configuration alongside toolsets.       |

## Sequence Diagram(s)

```mermaid
sequenceDiagram
    participant Config
    participant YAMLFile
    participant Toolset
    participant RemoteMCPToolset

    Config->>YAMLFile: parse_toolsets_file()
    YAMLFile-->>Config: Returns toolsets + mcp_servers (with type="MCP")
    Config->>Config: merge_and_override_bultin_toolsets_with_toolsets_config()
    alt type == "MCP"
        Config->>RemoteMCPToolset: Instantiate RemoteMCPToolset
    else
        Config->>Toolset: Instantiate YAMLToolset
    end

Possibly related PRs

  • ROB-1290 parse mcp #428: Refines the logic in merge_and_override_bultin_toolsets_with_toolsets_config for MCP toolset instantiation, evolving the same functionality as this PR.

Suggested reviewers

  • moshemorad

<!-- walkthrough_end -->


---

<details>
<summary>📜 Recent review details</summary>

**Configuration used: CodeRabbit UI**
**Review profile: CHILL**
**Plan: Pro**


<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between 5e42f76fe19a9dfe7c29b3fe758c0f6a1b19cf4a and 8e0e11b32dac52c2c46bd2d3002b28b1ef846c73.

</details>

<details>
<summary>📒 Files selected for processing (2)</summary>

* `holmes/config.py` (3 hunks)
* `holmes/core/tools.py` (2 hunks)

</details>

<details>
<summary>🚧 Files skipped from review as they are similar to previous changes (2)</summary>

* holmes/core/tools.py
* holmes/config.py

</details>

<details>
<summary>⏰ Context from checks skipped due to timeout of 90000ms (7)</summary>

* GitHub Check: build (3.12)
* GitHub Check: build (3.11)
* GitHub Check: build (3.10)
* GitHub Check: build (3.12)
* GitHub Check: build (3.11)
* GitHub Check: build (3.10)
* GitHub Check: build (3.12)

</details>

</details>
<!-- internal state start -->


<!-- DwQgtGAEAqAWCWBnSTIEMB26CuAXA9mAOYCmGJATmriQCaQDG+Ats2bgFyQAOFk+AIwBWJBrngA3EsgEBPRvlqU0AgfFwA6NPEgQAfACgjoCEejqANiS4B1AJIAFSACUA8gCEwARgBMAZgAOSAJuSCspC0haeDFIZgZuAH1ESikKZAAzfD4LJFx+DMgKEmZ8GjiEyBSKNMQNAwA5bGYBSi4AFgBWPwMAVWquZ3x4AHFcjHgAayN9Y3AoMnp8QrQ8QlJyKhp6JlZ2Ll5+YVFxKRl5JiUqVXUtHVmTKDhUVEwcAmIyZW2FPYxOIpoADuVWazDQFHkcgUVxUak02l0YEMc1MBlg+AsbEQAHomBgMvAiBpuLIOAYAERUgwAYhpkAAgnZPptqHRQawIfJloxYJhSIgzLASChmNxsvlcoh8k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2nYLBPYAioCCcenIVzQgjNceEdwkSGEY7sZg6hEiJw9MUCQCYyYaR8lS+jjG/AkACAABi0wINAfgGAGYEAAdi8H4AAnAILwJn2gADZbMMFs1ptMGQBAZFs258zgQvDObEwx+YkBOgkHaD4DIxnbPUS8OZtA5naDUWMwwHwlm/Dxc6AEBgWn3NoGs1FhgGR2gLQeAFgIJAtMkC8NZvwPglQME6D4RLDA7MCFoNVvwOmfACB8AEKzlEAh2YYMZvwfn/MQF+FJ3AMnaBycTIpugiRFhiaAA=== -->

<!-- internal state end -->
<!-- finishing_touch_checkbox_start -->

<details open="true">
<summary>✨ Finishing Touches</summary>

- [ ] <!-- {"checkboxId": "7962f53c-55bc-4827-bfbf-6a18da830691"} --> 📝 Generate Docstrings

</details>

<!-- finishing_touch_checkbox_end -->
<!-- tips_start -->

---



<details>
<summary>🪧 Tips</summary>

### Chat

There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=robusta-dev/holmesgpt&utm_content=453):

- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
  - `I pushed a fix in commit <commit_id>, please review it.`
  - `Explain this complex logic.`
  - `Open a follow-up GitHub issue for this discussion.`
- Files and specific lines of code (under the "Files changed" tab): Tag `@coderabbitai` in a new review comment at the desired location with your query. Examples:
  - `@coderabbitai explain this code block.`
  -	`@coderabbitai modularize this function.`
- PR comments: Tag `@coderabbitai` in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
  - `@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.`
  - `@coderabbitai read src/utils.ts and explain its main purpose.`
  - `@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.`
  - `@coderabbitai help me debug CodeRabbit configuration file.`

### Support

Need help? Create a ticket on our [support page](https://www.coderabbit.ai/contact-us/support) for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

### CodeRabbit Commands (Invoked using PR comments)

- `@coderabbitai pause` to pause the reviews on a PR.
- `@coderabbitai resume` to resume the paused reviews.
- `@coderabbitai review` to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
- `@coderabbitai full review` to do a full review from scratch and review all the files again.
- `@coderabbitai summary` to regenerate the summary of the PR.
- `@coderabbitai generate docstrings` to [generate docstrings](https://docs.coderabbit.ai/finishing-touches/docstrings) for this PR.
- `@coderabbitai generate sequence diagram` to generate a sequence diagram of the changes in this PR.
- `@coderabbitai resolve` resolve all the CodeRabbit review comments.
- `@coderabbitai configuration` to show the current CodeRabbit configuration for the repository.
- `@coderabbitai help` to get help.

### Other keywords and placeholders

- Add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed.
- Add `@coderabbitai summary` to generate the high-level summary at a specific location in the PR description.
- Add `@coderabbitai` anywhere in the PR title to generate the title automatically.

### CodeRabbit Configuration File (`.coderabbit.yaml`)

- You can programmatically configure CodeRabbit by adding a `.coderabbit.yaml` file to the root of your repository.
- Please see the [configuration documentation](https://docs.coderabbit.ai/guides/configure-coderabbit) for more information.
- If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: `# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json`

### Documentation and Community

- Visit our [Documentation](https://docs.coderabbit.ai) for detailed information on how to use CodeRabbit.
- Join our [Discord Community](http://discord.gg/coderabbit) to get help, request features, and share feedback.
- Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.

</details>

<!-- tips_end -->

@RoiGlinik RoiGlinik changed the title use top level dict mcp_servers for list of remote mcp servers. ROB-1238 top level dict mcp_servers for list of remote mcp servers. May 26, 2025
Comment thread holmes/core/tools.py Outdated
@RoiGlinik RoiGlinik changed the title ROB-1238 top level dict mcp_servers for list of remote mcp servers. WIP ROB-1238 top level dict mcp_servers for list of remote mcp servers. May 26, 2025

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
helm/holmes/templates/toolset-config.yaml (1)

1-2: Consider extending the conditional to cover mcp_servers.

Currently the ConfigMap is only rendered when .Values.toolsets is non-empty:

{{- if .Values.toolsets | not | empty }}

If you’d like the ConfigMap to also be created when mcp_servers is defined (even if toolsets is empty), you can change it to:

{{- if or (not (empty .Values.toolsets)) (not (empty .Values.mcp_servers)) }}

This ensures the map is generated whenever either block has data.

🧰 Tools
🪛 YAMLlint (1.37.1)

[error] 1-1: syntax error: expected the node content, but found '-'

(syntax)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3e800ba and 5e42f76.

📒 Files selected for processing (2)
  • helm/holmes/templates/toolset-config.yaml (1 hunks)
  • helm/holmes/values.yaml (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • helm/holmes/values.yaml
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: build (3.12)
🔇 Additional comments (1)
helm/holmes/templates/toolset-config.yaml (1)

10-10: Ensure mcp_servers Helm value is defined and documented.

The new mcp_servers entry will render null or error out if .Values.mcp_servers is missing from your chart’s values.yaml. Please confirm that:

  1. A top-level mcp_servers key exists in values.yaml (even if it’s just an empty list/dict).
  2. The chart README or comments are updated to describe the purpose and format of mcp_servers.

@RoiGlinik
RoiGlinik merged commit d0fd006 into ROB-1238-mcp May 27, 2025
@RoiGlinik
RoiGlinik deleted the feature/ROB-1238-parse-mcp branch May 27, 2025 07:46
@github-actions

Copy link
Copy Markdown
Contributor

Results of HolmesGPT evals

Test suite Test case Status
ask_holmes 01_how_many_pods ⚠️
ask_holmes 02_what_is_wrong_with_pod ✅
ask_holmes 02_what_is_wrong_with_pod_LOKI ✅
ask_holmes 03_what_is_the_command_to_port_forward ✅
ask_holmes 04_related_k8s_events ✅
ask_holmes 05_image_version ✅
ask_holmes 06_explain_issue ✅
ask_holmes 07_high_latency ✅
ask_holmes 07_high_latency_LOKI ✅
ask_holmes 08_sock_shop_frontend ✅
ask_holmes 09_crashpod ✅
ask_holmes 10_image_pull_backoff ✅
ask_holmes 11_init_containers ✅
ask_holmes 12_job_crashing ✅
ask_holmes 12_job_crashing_CORALOGIX ✅
ask_holmes 12_job_crashing_LOKI ✅
ask_holmes 13_pending_node_selector ✅
ask_holmes 14_pending_resources ✅
ask_holmes 15_failed_readiness_probe ✅
ask_holmes 16_failed_no_toolset_found ✅
ask_holmes 17_oom_kill ✅
ask_holmes 18_crash_looping_v2 ✅
ask_holmes 19_detect_missing_app_details ✅
ask_holmes 20_long_log_file_search ✅
ask_holmes 20_long_log_file_search_LOKI ✅
ask_holmes 21_job_fail_curl_no_svc_account ⚠️
ask_holmes 22_high_latency_dbi_down ⚠️
ask_holmes 23_app_error_in_current_logs ✅
ask_holmes 23_app_error_in_current_logs_LOKI ✅
ask_holmes 24_misconfigured_pvc ✅
ask_holmes 25_misconfigured_ingress_class ⚠️
ask_holmes 26_multi_container_logs ⚠️
ask_holmes 27_permissions_error_no_helm_tools ✅
ask_holmes 28_permissions_error_helm_tools_enabled ✅
ask_holmes 29_events_from_alert_manager ✅
ask_holmes 30_basic_promql_graph_cluster_memory ✅
ask_holmes 31_basic_promql_graph_pod_memory ✅
ask_holmes 32_basic_promql_graph_pod_cpu ❌
ask_holmes 33_http_latency_graph ✅
ask_holmes 34_memory_graph ✅
ask_holmes 35_tempo ✅
ask_holmes 36_argocd_find_resource ✅
ask_holmes 37_argocd_wrong_namespace ⚠️
ask_holmes 38_rabbitmq_split_head ✅
ask_holmes 39_failed_toolset ✅
ask_holmes 40_disabled_toolset ❌
ask_holmes 41_setup_argo ✅
investigate 01_oom_kill ✅
investigate 02_crashloop_backoff ✅
investigate 03_cpu_throttling ✅
investigate 04_image_pull_backoff ✅
investigate 05_crashpod ✅
investigate 05_crashpod_LOKI ✅
investigate 06_job_failure ✅
investigate 07_job_syntax_error ✅
investigate 08_memory_pressure ✅
investigate 09_high_latency ✅
investigate 10_kube_controller_manager_down ⚠️
investigate 11_KubeDeploymentReplicasMismatch ✅
investigate 12_KubePodCrashLooping ✅
investigate 13_KubePodNotReady ✅
investigate 14_Watchdog ✅
investigate 15_tempo ✅

Legend

  • ✅ the test was successful
  • ⚠️ the test failed but is known to be flakky or known to fail
  • ❌ the test failed and should be fixed before merging the PR

@pavangudiwada pavangudiwada changed the title WIP ROB-1238 top level dict mcp_servers for list of remote mcp servers. ROB-1238 top level dict mcp_servers for list of remote mcp servers. May 31, 2025
@coderabbitai coderabbitai Bot mentioned this pull request Jun 5, 2025
@coderabbitai coderabbitai Bot mentioned this pull request Oct 21, 2025
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.

2 participants