Skip to main content
All connectors
qbash Connectors / OpenSearch

OpenSearch MCP serverand Python AI tasks

qbash hosts a OpenSearch MCP server you can use in Claude, ChatGPT, Codex, Cursor, Grok Bot and Muse.

Developers use qbash Tasks to write cloud-hosted Python functions that pair OpenSearch with models such as Claude and GPT.

MCP server

Build a OpenSearch MCP server

Give ChatGPT, Claude and your other AI tools access to OpenSearch through one server. You pick which OpenSearch tools it shares, and you can add other connectors, memory folders and Tasks to the same server.

How to set it up

  1. Connect OpenSearch on the qbash Connectors page.
  2. Create an MCP server and add the OpenSearch tools you want to share.
  3. Paste the server URL into your client. It connects with OAuth or an access token.

Python AI task

Write a OpenSearch task in Python

A qbash Task is a hosted Python function that calls OpenSearch and AI models.

Summarize errors from the last day

Retrieve 20 recent error logs and ask an inline prompt to group repeated messages for review.

main.py
report = qbash.integrations.opensearch.search(
index="logs-*", size=20,
body={"query": {"bool": {"filter": [
{"range": {"@timestamp": {"gte": "now-1d"}}},
{"term": {"level.keyword": "ERROR"}},
]}}, "sort": [{"@timestamp": "desc"}],
"_source": ["@timestamp", "service", "message"]},
)
if isinstance(report, str):
qbash.output("Response exceeded the size limit. Narrow the query.")
else:
hits = report.get("hits", {}).get("hits", [])
if hits:
analysis = qbash.ai.run_prompt(
slug="opensearch-error-review",
variables={"logs": json.dumps([hit.get("_source", {}) for hit in hits])},
)
qbash.output(analysis)
else:
qbash.output("No errors matched the query.")
Sample search response
{
"took": 8,
"timed_out": false,
"_shards": {
"total": 1,
"successful": 1,
"failed": 0
},
"hits": {
"total": {
"value": 1,
"relation": "eq"
},
"hits": [
{
"_source": {
"@timestamp": "2026-09-30T09:00:00Z",
"service": "payments",
"message": "Upstream request timed out"
}
}
]
}
}

What the OpenSearch connector can do

  • Execute a search query against an OpenSearch index
  • List all indices in the OpenSearch cluster
  • Get the field mapping for an OpenSearch index
  • Count the documents in an OpenSearch index that match a query
  • Get the health of the OpenSearch cluster
See every OpenSearch method in the SDK Reference

qbash Tasks: AI applications in Python

A Task is a Python function that calls OpenSearch, your other connectors and models such as Claude, GPT, Gemini and Grok. qbash hosts and runs it.

AnthropicOpenAIGeminixAI

Run Tasks on a schedule or from your team's tools

OpenAIAnthropicGrokGmailSlackGitHub+ more
  • Deterministic where it counts Write the logic in Python and call a model only for the steps that need judgement, so the rest runs the same way every time.
  • Version controlled Every save is a revision you can compare and roll back.
  • Logged Each run records its inputs, output, errors and what started it.
  • Shared credentials Connections belong to your organization, so a Task keeps working when its author is away.

OpenSearch MCP questions

Does OpenSearch have an official MCP server?

Yes. The OpenSearch project publishes an open-source OpenSearch MCP Server, and OpenSearch 3.x can also expose one from the ML Commons plugin at /_plugins/_ml/mcp. qbash runs its own server for you, so the cluster only has to accept connections from qbash.

Can the OpenSearch MCP server change data?

No. Its five tools search, count and read cluster metadata. None of them indexes, updates or deletes a document.

Guides that use OpenSearch

Build a OpenSearch task

Write it in Python with AI steps, and qbash hosts it with versions and run logs.

Build a task

Build a OpenSearch MCP server

Pick the OpenSearch tools to share and connect ChatGPT, Claude or Grok Bot.

Build an MCP server