Skip to content

Onboard MCP #3721

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

Merged
merged 10 commits into from
Apr 15, 2025
Merged

Onboard MCP #3721

merged 10 commits into from
Apr 15, 2025

Conversation

rithin-pullela-aws
Copy link
Contributor

@rithin-pullela-aws rithin-pullela-aws commented Apr 10, 2025

Description

We Onboard Model Context Protocol as an experimental feature with this PR.

  • CX can create a new kind of connector called an MCP Connector to provide connection details about an MCP server.
  • This MCP connector can be provided as an input to the agent.
  • The user can also provide tool filters to filter out tools in the MCP connector.

Related Issues

Resolves #3660

Check List

  • New functionality includes testing.
  • New functionality has been documented.
  • API changes companion pull request created.
  • Commits are signed per the DCO using --signoff.
  • Public documentation issue/PR created.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@rithin-pullela-aws rithin-pullela-aws had a problem deploying to ml-commons-cicd-env-require-approval April 10, 2025 01:03 — with GitHub Actions Failure
@rithin-pullela-aws rithin-pullela-aws had a problem deploying to ml-commons-cicd-env-require-approval April 10, 2025 01:03 — with GitHub Actions Failure
@rithin-pullela-aws rithin-pullela-aws had a problem deploying to ml-commons-cicd-env-require-approval April 10, 2025 01:03 — with GitHub Actions Error
@rithin-pullela-aws rithin-pullela-aws had a problem deploying to ml-commons-cicd-env-require-approval April 10, 2025 01:03 — with GitHub Actions Failure
@rithin-pullela-aws rithin-pullela-aws had a problem deploying to ml-commons-cicd-env-require-approval April 10, 2025 20:06 — with GitHub Actions Failure
@rithin-pullela-aws rithin-pullela-aws had a problem deploying to ml-commons-cicd-env-require-approval April 10, 2025 20:06 — with GitHub Actions Error
@rithin-pullela-aws rithin-pullela-aws had a problem deploying to ml-commons-cicd-env-require-approval April 10, 2025 20:06 — with GitHub Actions Error
@rithin-pullela-aws rithin-pullela-aws had a problem deploying to ml-commons-cicd-env-require-approval April 10, 2025 20:06 — with GitHub Actions Failure
@rithin-pullela-aws rithin-pullela-aws had a problem deploying to ml-commons-cicd-env-require-approval April 10, 2025 21:05 — with GitHub Actions Error
@rithin-pullela-aws rithin-pullela-aws had a problem deploying to ml-commons-cicd-env-require-approval April 10, 2025 21:05 — with GitHub Actions Error
@rithin-pullela-aws rithin-pullela-aws had a problem deploying to ml-commons-cicd-env-require-approval April 10, 2025 21:05 — with GitHub Actions Failure
@rithin-pullela-aws rithin-pullela-aws had a problem deploying to ml-commons-cicd-env-require-approval April 10, 2025 21:05 — with GitHub Actions Failure
@rithin-pullela-aws rithin-pullela-aws marked this pull request as ready for review April 10, 2025 21:37
ylwu-amzn
ylwu-amzn previously approved these changes Apr 15, 2025
Signed-off-by: rithin-pullela-aws <[email protected]>
Signed-off-by: rithin-pullela-aws <[email protected]>
Signed-off-by: rithin-pullela-aws <[email protected]>
Signed-off-by: rithin-pullela-aws <[email protected]>
Signed-off-by: rithin-pullela-aws <[email protected]>
Signed-off-by: rithin-pullela-aws <[email protected]>
Signed-off-by: rithin-pullela-aws <[email protected]>
Signed-off-by: rithin-pullela-aws <[email protected]>
@rithin-pullela-aws rithin-pullela-aws temporarily deployed to ml-commons-cicd-env-require-approval April 15, 2025 03:58 — with GitHub Actions Inactive
@rithin-pullela-aws rithin-pullela-aws temporarily deployed to ml-commons-cicd-env-require-approval April 15, 2025 03:58 — with GitHub Actions Inactive
@rithin-pullela-aws rithin-pullela-aws temporarily deployed to ml-commons-cicd-env-require-approval April 15, 2025 03:58 — with GitHub Actions Inactive
@rithin-pullela-aws rithin-pullela-aws temporarily deployed to ml-commons-cicd-env-require-approval April 15, 2025 03:58 — with GitHub Actions Inactive
Copy link

codecov bot commented Apr 15, 2025

Codecov Report

Attention: Patch coverage is 10.59730% with 464 lines in your changes missing coverage. Please review.

Project coverage is 77.96%. Comparing base (9ffe7ef) to head (cb7ecd2).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...g/opensearch/ml/common/connector/McpConnector.java 0.00% 213 Missing ⚠️
...nsearch/ml/engine/algorithms/agent/AgentUtils.java 13.76% 89 Missing and 5 partials ⚠️
...engine/algorithms/remote/McpConnectorExecutor.java 0.00% 61 Missing ⚠️
...ava/org/opensearch/ml/engine/tools/McpSseTool.java 0.00% 40 Missing ⚠️
...thms/agent/MLPlanExecuteAndReflectAgentRunner.java 0.00% 18 Missing ⚠️
...ava/org/opensearch/ml/common/agent/MLToolSpec.java 20.00% 11 Missing and 5 partials ⚠️
...on/transport/connector/MLCreateConnectorInput.java 45.83% 9 Missing and 4 partials ⚠️
.../action/register/TransportRegisterModelAction.java 0.00% 5 Missing ⚠️
.../ml/engine/algorithms/agent/MLChatAgentRunner.java 87.50% 2 Missing ⚠️
...orithms/agent/MLConversationalFlowAgentRunner.java 0.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #3721      +/-   ##
============================================
- Coverage     79.07%   77.96%   -1.11%     
- Complexity     7116     7126      +10     
============================================
  Files           623      626       +3     
  Lines         31605    32103     +498     
  Branches       3579     3654      +75     
============================================
+ Hits          24991    25029      +38     
- Misses         5073     5519     +446     
- Partials       1541     1555      +14     
Flag Coverage Δ
ml-commons 77.96% <10.59%> (-1.11%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@rithin-pullela-aws rithin-pullela-aws temporarily deployed to ml-commons-cicd-env-require-approval April 15, 2025 05:03 — with GitHub Actions Inactive
@rithin-pullela-aws rithin-pullela-aws temporarily deployed to ml-commons-cicd-env-require-approval April 15, 2025 05:03 — with GitHub Actions Inactive
@mingshl
Copy link
Collaborator

mingshl commented Apr 15, 2025

integ tests are passing but the code cov failed, would you address the code coverage?

codecov/patchFailing after 1s — 10.59% of diff hit (target 79.07%)

Copy link
Collaborator

@jngz-es jngz-es left a comment

Choose a reason for hiding this comment

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

Let's merge it at first to catch up the release deadline.

@mingshl
Copy link
Collaborator

mingshl commented Apr 15, 2025

let's add a feature flag for this PR

@rithin-pullela-aws
Copy link
Contributor Author

I will add feature flag for the MCP feature in another PR. Can we merge this one @mingshl

@mingshl mingshl merged commit b53a7e5 into opensearch-project:main Apr 15, 2025
11 of 13 checks passed
akolarkunnu pushed a commit to akolarkunnu/ml-commons that referenced this pull request Jun 6, 2025
* Onboard MCP

Signed-off-by: rithin-pullela-aws <[email protected]>

* Handle failing tests

Signed-off-by: rithin-pullela-aws <[email protected]>

* Fix empty resources issue

Signed-off-by: rithin-pullela-aws <[email protected]>

* Address Comments

Signed-off-by: rithin-pullela-aws <[email protected]>

* Add Authorization support via headers

Signed-off-by: rithin-pullela-aws <[email protected]>

* Add MCP tools to plan and execute agent

Signed-off-by: rithin-pullela-aws <[email protected]>

* Resolve failing test by using correct constant

Signed-off-by: rithin-pullela-aws <[email protected]>

* Address comments

Signed-off-by: rithin-pullela-aws <[email protected]>

* Address comments

Signed-off-by: rithin-pullela-aws <[email protected]>

* Apply spotless

Signed-off-by: rithin-pullela-aws <[email protected]>

---------

Signed-off-by: rithin-pullela-aws <[email protected]>
Signed-off-by: Abdul Muneer Kolarkunnu <[email protected]>
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.

[FEATURE] Support MCP protocol in ML connector
9 participants