KosmoKrator

other

Elastic MCP Integration for OpenAI Agents SDK

Connect Elastic to OpenAI Agents SDK through the local KosmoKrator MCP gateway with scoped tools, credentials, and write policy.

7 functions 5 read 2 write Username and password auth

Connect Elastic to OpenAI Agents SDK

Attach KosmoKrator integration tools to OpenAI Agents SDK workflows through a local MCP gateway.

Start the KosmoKrator MCP gateway locally and point the OpenAI Agents SDK MCP tool at that process or wrapper. The gateway is local, scoped to this integration, and starts with --write=deny so OpenAI Agents can inspect read-capable tools without receiving write access by default.

Elastic MCP Config for OpenAI Agents SDK

Use headless JSON commands for CI-style execution and MCP for agent tool discovery.

{
  "mcpServers": {
    "kosmokrator-elastic": {
      "type": "stdio",
      "command": "kosmo",
      "args": [
        "mcp:serve",
        "--integration=elastic",
        "--write=deny"
      ]
    }
  }
}

Run the Gateway Manually

kosmokrator mcp:serve --integration=elastic --write=deny

Why Use KosmoKrator Here

Scoped tools

Expose only Elastic instead of a broad multi-service tool list.

Local credentials

Reuse credentials already configured for the KosmoKrator CLI and Lua runtime.

Write policy

Start read-only, then opt into ask or allow for trusted workspaces.

Elastic Tools Visible to OpenAI Agents

OpenAI Agents sees stable MCP tool names generated from the Elastic integration catalog.

MCP toolSource functionTypeDescription
integration__elastic__elastic_list_indices elastic.elastic_list_indices Read List all indices in the Elasticsearch cluster. Returns index names, health status, document counts, and sizes.
integration__elastic__elastic_get_index elastic.elastic_get_index Read Get detailed information about a specific Elasticsearch index, including mappings, settings, and aliases.
integration__elastic__elastic_create_index elastic.elastic_create_index Write Create a new Elasticsearch index with optional settings and mappings.
integration__elastic__elastic_search_documents elastic.elastic_search_documents Read Search for documents in an Elasticsearch index. Supports full query DSL including match, term, bool, and aggregation queries.
integration__elastic__elastic_index_document elastic.elastic_index_document Write Create or update a document in an Elasticsearch index. Provide an ID to update an existing document, or omit it to let Elasticsearch auto-generate one.
integration__elastic__elastic_get_document elastic.elastic_get_document Read Retrieve a single document from an Elasticsearch index by its ID.
integration__elastic__elastic_cluster_health elastic.elastic_cluster_health Read Get the health status of the Elasticsearch cluster, including status (green/yellow/red), number of nodes, and shard information.

Related Elastic Pages