mcp-elasticsearch mcp
v1.0.0 · MCP Tool · search · registry.pascalai.org
Interact with Elasticsearch: index documents, search with full-text and DSL queries, manage indices and mappings.
elasticsearchelasticsearchfulltextindex
Input Parameters
| Parameter | Type | Description |
| hostoptional |
string |
Default: localhost. |
| portoptional |
integer |
Default: 9200. |
| api_keyoptional |
string |
|
| usernameoptional |
string |
|
| passwordoptional |
string |
|
| indexoptional |
string |
|
| operationrequired |
string |
One of: search, index, get, update, delete, create_index, delete_index, list_indices, mapping, bulk. |
| queryoptional |
object |
Elasticsearch query DSL. |
| documentoptional |
object |
|
| doc_idoptional |
string |
|
| bodyoptional |
object |
Full request body for advanced operations. |
| sizeoptional |
integer |
Default: 10. |
| from_optional |
integer |
Default: 0. |
Output Fields
| Field | Type | Description |
| operation |
string |
|
| hits |
array[object] |
|
| total |
integer |
|
| result |
string |
|
| _id |
string |
|
| indices |
array[string] |
|
Examples
Full-text search
// Input
{
"host": "localhost",
"port": 9200,
"index": "products",
"operation": "search",
"query": {
"match": {
"description": "wireless headphones"
}
},
"size": 5
}
// Output
{
"operation": "search",
"total": 12,
"hits": []
}
Index a document
// Input
{
"host": "localhost",
"port": 9200,
"index": "logs",
"operation": "index",
"document": {
"level": "ERROR",
"message": "Connection refused",
"timestamp": "2024-01-01T12:00:00Z"
}
}
// Output
{
"operation": "index",
"result": "created",
"_id": "abc123"
}
Install & Discovery
Install
ppm install mcp-elasticsearch
Get JSON Schema
GET /v1/packages/mcp-elasticsearch/1.0.0/schema
Discover by keyword
GET /v1/mcp/discover?q=elasticsearch
Discovery hint: Install with ppm install mcp-elasticsearch or invoke remotely via POST /v1/invoke/mcp-elasticsearch on the MCP Service.
PascalAI Usage
uses toolslib;
var Tool := LoadTool('mcp-elasticsearch');
var R := Tool.Call(JsonObj([]));
Writeln(R.ToJSON);