Need OpenSearch MCP example

Hi all,

I am using OS 3.3.1 and I am trying to create an MCP tool that runs the following query against a specific index.

Query:

GET my_pdf_docs/_search
{
“query”: {
“query_string”: {
“default_field”: “*”,
“query”: “{llm_query_here}”
}
}
}

Can you please provide me with an example that registers such tool. I tried

To be more specific, I am trying to build an OpenSearch tool that performs RAG using neural search or DSL (with search template). The RAG should internally do reranking before returning the results. The tool is expected to be called by external framework such as langchain. The tool must not require an LLM.

I could not find any OpenSearch out-of-the-box tool that does reranking nor execute search template without requiring an LLM.

The QueryPlanningTool is good but it requires an LLM! The text generation step needs to be outside of OpenSearch.

Hi @asfoorial , the built-in OpenSearch MCP server currently supports only the tools from the predefined tool list. However, we also have a standalone OpenSearch MCP server that allows you to add custom tools .

Feel free to open a GitHub issue on either repo if you still need help:

Documentation/blog related to OpenSearch MCP server:

Hope this helps! Let me know if you have any questions :slight_smile:

Thanks for the response. Unfortunately, the standalone mcp server does not use the same authorization mechanism as the built-in mcp server, which makes it unusable in my case.

I will add git issue for expanding the built-in mcp to define custom tools based on query patterns or templates.

Thanks

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.