Skip to content
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

[RFC] Support MFCTool in skills plugin #539

Open
zane-neo opened this issue Mar 14, 2025 · 2 comments
Open

[RFC] Support MFCTool in skills plugin #539

zane-neo opened this issue Mar 14, 2025 · 2 comments
Labels
enhancement New feature or request untriaged

Comments

@zane-neo
Copy link
Collaborator

Problem Statement

With the recent surge in Large Language Models (LLMs) and AI agents, there's an increasing demand for AI systems to access the latest data from various sources, including databases and public APIs. The Model Context Protocol (MCP) has emerged as a universal, open standard for facilitating these connections. Skills is a centralized repo to accommodate various tools and it's a good opportunity to support MCP client in the repo to give user the capability to connect to their own MCP servers to perform different automated tasks. The proposal to convert OpenSearch APIs to tools are covered in this RFC: opensearch-project/OpenSearch#17577

Proposed Solutions

  1. Configure an agent that to perform a specific/general task:
POST /_plugins/_ml/agents/_register
{
  "name": "my MFC demo agent",
  "type": "flow",
  "description": "this is a simple demo agent that uses MFC client",
  "llm": {
    "model_id": "{your_model_id}",
    "parameters": {
      "max_iteration": 5,
      "stop_when_no_tool_found": true,
      "response_filter": "$.completion"
    }
  },
  "tools": [
    {
      "type": "MFCTool",
      "name": "MFCTool",
      "parameters": {
        "method": "index/_mapping",
        "request_body": ${parameters.params}
      }
    }
  ],
  "app_type": "my_app"
}

  1. Execute the agent to solve a complex task:
POST /_plugins/_ml/agents/{agent_id}
{
    "parameters": {
        "question": "Please help me create a new index in my cluster",
        "params": "{ \"mappings\": { \"properties\": { \"text\": { \"type\": \"text\" } } }, \"settings\": { \"index\": { \"number_of_replicas\": \"1\", \"number_of_shards\": \"2\" } }}"
    }
}
  1. During the agent running, the MFCTool get invoked and the params in the parameters get passed to corresponding MFC server and the task complete.

This tool is generic enough to support different MFC server interaction with different request body, and all the MFC protocol details will be handled by OpenSearch.

@zane-neo zane-neo added enhancement New feature or request untriaged labels Mar 14, 2025
@pyek-bot
Copy link

So, the proposal enables users to integrate their own MCP server, with OpenSearch acting as an intermediary between the LLM and the user's server. This setup allows users to define and utilize their own set of tools within the MCP framework. Is that correct?

@zane-neo
Copy link
Collaborator Author

So, the proposal enables users to integrate their own MCP server, with OpenSearch acting as an intermediary between the LLM and the user's server. This setup allows users to define and utilize their own set of tools within the MCP framework. Is that correct?

Yes, that's correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request untriaged
Projects
None yet
Development

No branches or pull requests

2 participants