# Need OpenSearch MCP example

**URL:** <https://forum.opensearch.org/t/need-opensearch-mcp-example/27424>\
**Category:** Machine Learning\
**Created:** [November 3, 2025, 8:15pm UTC](https://forum.opensearch.org/t/need-opensearch-mcp-example/27424 "2025-11-03T20:15:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![asfoorial](https://avatars.discourse-cdn.com/v4/letter/a/3da27b/32.png) [@asfoorial](https://forum.opensearch.org/u/asfoorial)\
**Post date:** [November 3, 2025, 8:15pm UTC](https://forum.opensearch.org/t/need-opensearch-mcp-example/27424/1 "2025-11-03T20:15:48Z")

</div>

**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

---

<div class="post-metadata">

**Author:** ![asfoorial](https://avatars.discourse-cdn.com/v4/letter/a/3da27b/32.png) [@asfoorial](https://forum.opensearch.org/u/asfoorial)\
**Post date:** [November 5, 2025, 2:27pm UTC](https://forum.opensearch.org/t/need-opensearch-mcp-example/27424/2 "2025-11-05T14:27:15Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![nathhjo](https://avatars.discourse-cdn.com/v4/letter/n/ec9cab/32.png) [@nathhjo](https://forum.opensearch.org/u/nathhjo)\
**Post date:** [December 11, 2025, 11:07pm UTC](https://forum.opensearch.org/t/need-opensearch-mcp-example/27424/3 "2025-12-11T23:07:18Z")

</div>

Hi @asfoorial , the built-in OpenSearch MCP server currently supports only the tools from the predefined [tool list](https://docs.opensearch.org/latest/ml-commons-plugin/agents-tools/tools/index/). However, we also have a standalone OpenSearch MCP server that allows you to [add custom tools](https://github.com/opensearch-project/opensearch-mcp-server-py/blob/main/DEVELOPER_GUIDE.md#adding-custom-tools) .

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

- [ml-commons](https://github.com/opensearch-project/ml-commons) - for the built-in MCP server you’re using
- [opensearch-mcp-server-py](https://github.com/opensearch-project/opensearch-mcp-server-py) - for the standalone server with custom tool support

Documentation/blog related to OpenSearch MCP server:

- [https://opensearch.org/blog/introducing-mcp-in-opensearch/](https://opensearch.org/blog/introducing-mcp-in-opensearch/)
- [MCP server APIs - OpenSearch Documentation](https://docs.opensearch.org/latest/ml-commons-plugin/api/mcp-server-apis/index/)

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

---

<div class="post-metadata">

**Author:** ![asfoorial](https://avatars.discourse-cdn.com/v4/letter/a/3da27b/32.png) [@asfoorial](https://forum.opensearch.org/u/asfoorial)\
**Post date:** [December 16, 2025, 5:59am UTC](https://forum.opensearch.org/t/need-opensearch-mcp-example/27424/4 "2025-12-16T05:59:16Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex019/uploads/mauve_hedgehog/original/2X/3/33547ea01a5b12dcca2958411d3edd97ae2ea8c1.png) [@system](https://forum.opensearch.org/u/system)\
**Post date:** [February 14, 2026, 5:59am UTC](https://forum.opensearch.org/t/need-opensearch-mcp-example/27424/5 "2026-02-14T05:59:30Z")

</div>

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