elasticsearch-mcp-server 2.0.13__py3-none-any.whl → 2.0.15__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of elasticsearch-mcp-server might be problematic. Click here for more details.
- {elasticsearch_mcp_server-2.0.13.dist-info → elasticsearch_mcp_server-2.0.15.dist-info}/METADATA +20 -9
- {elasticsearch_mcp_server-2.0.13.dist-info → elasticsearch_mcp_server-2.0.15.dist-info}/RECORD +11 -9
- src/clients/base.py +3 -0
- src/clients/common/client.py +2 -1
- src/clients/common/data_stream.py +18 -0
- src/server.py +9 -1
- src/tools/data_stream.py +47 -0
- src/version.py +1 -1
- {elasticsearch_mcp_server-2.0.13.dist-info → elasticsearch_mcp_server-2.0.15.dist-info}/WHEEL +0 -0
- {elasticsearch_mcp_server-2.0.13.dist-info → elasticsearch_mcp_server-2.0.15.dist-info}/entry_points.txt +0 -0
- {elasticsearch_mcp_server-2.0.13.dist-info → elasticsearch_mcp_server-2.0.15.dist-info}/licenses/LICENSE +0 -0
{elasticsearch_mcp_server-2.0.13.dist-info → elasticsearch_mcp_server-2.0.15.dist-info}/METADATA
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: elasticsearch-mcp-server
|
|
3
|
-
Version: 2.0.
|
|
3
|
+
Version: 2.0.15
|
|
4
4
|
Summary: MCP Server for interacting with Elasticsearch and OpenSearch
|
|
5
5
|
License: Apache License
|
|
6
6
|
Version 2.0, January 2004
|
|
@@ -248,6 +248,9 @@ https://github.com/user-attachments/assets/f7409e31-fac4-4321-9c94-b0ff2ea7ff15
|
|
|
248
248
|
- `get_index`: Returns information (mappings, settings, aliases) about one or more indices.
|
|
249
249
|
- `create_index`: Create a new index.
|
|
250
250
|
- `delete_index`: Delete an index.
|
|
251
|
+
- `create_data_stream`: Create a new data stream (requires matching index template).
|
|
252
|
+
- `get_data_stream`: Get information about one or more data streams.
|
|
253
|
+
- `delete_data_stream`: Delete one or more data streams and their backing indices.
|
|
251
254
|
|
|
252
255
|
### Document Operations
|
|
253
256
|
|
|
@@ -372,7 +375,7 @@ Using `uv` requires cloning the repository locally and specifying the path to th
|
|
|
372
375
|
"command": "uv",
|
|
373
376
|
"args": [
|
|
374
377
|
"--directory",
|
|
375
|
-
"path/to/
|
|
378
|
+
"path/to/elasticsearch-mcp-server",
|
|
376
379
|
"run",
|
|
377
380
|
"elasticsearch-mcp-server"
|
|
378
381
|
],
|
|
@@ -392,7 +395,7 @@ Using `uv` requires cloning the repository locally and specifying the path to th
|
|
|
392
395
|
"command": "uv",
|
|
393
396
|
"args": [
|
|
394
397
|
"--directory",
|
|
395
|
-
"path/to/
|
|
398
|
+
"path/to/elasticsearch-mcp-server",
|
|
396
399
|
"run",
|
|
397
400
|
"elasticsearch-mcp-server"
|
|
398
401
|
],
|
|
@@ -411,7 +414,7 @@ Using `uv` requires cloning the repository locally and specifying the path to th
|
|
|
411
414
|
"command": "uv",
|
|
412
415
|
"args": [
|
|
413
416
|
"--directory",
|
|
414
|
-
"path/to/
|
|
417
|
+
"path/to/elasticsearch-mcp-server",
|
|
415
418
|
"run",
|
|
416
419
|
"opensearch-mcp-server"
|
|
417
420
|
],
|
|
@@ -489,11 +492,7 @@ uv run src/server.py elasticsearch-mcp-server --transport streamable-http --host
|
|
|
489
492
|
|
|
490
493
|
## Compatibility
|
|
491
494
|
|
|
492
|
-
The MCP server is compatible with Elasticsearch 7.x, 8.x, and 9.x. By default, it uses the Elasticsearch 8.x client (without a suffix).
|
|
493
|
-
|
|
494
|
-
```bash
|
|
495
|
-
uvx elasticsearch-mcp-server-es7
|
|
496
|
-
```
|
|
495
|
+
The MCP server is compatible with Elasticsearch 7.x, 8.x, and 9.x. By default, it uses the Elasticsearch 8.x client (without a suffix).
|
|
497
496
|
|
|
498
497
|
| MCP Server | Elasticsearch |
|
|
499
498
|
| --- | --- |
|
|
@@ -502,6 +501,18 @@ uvx elasticsearch-mcp-server-es7
|
|
|
502
501
|
| elasticsearch-mcp-server-es9 | Elasticsearch 9.x |
|
|
503
502
|
| opensearch-mcp-server | OpenSearch 1.x, 2.x, 3.x |
|
|
504
503
|
|
|
504
|
+
To use the Elasticsearch 7.x client, run the `elasticsearch-mcp-server-es7` variant. For Elasticsearch 9.x, use `elasticsearch-mcp-server-es9`. For example:
|
|
505
|
+
|
|
506
|
+
```bash
|
|
507
|
+
uvx elasticsearch-mcp-server-es7
|
|
508
|
+
```
|
|
509
|
+
|
|
510
|
+
If you want to run different Elasticsearch variants (e.g., 7.x or 9.x) locally, simply update the `elasticsearch` dependency version in `pyproject.toml`, then start the server with:
|
|
511
|
+
|
|
512
|
+
```bash
|
|
513
|
+
uv run src/server.py elasticsearch-mcp-server
|
|
514
|
+
```
|
|
515
|
+
|
|
505
516
|
## License
|
|
506
517
|
|
|
507
518
|
This project is licensed under the Apache License Version 2.0 - see the [LICENSE](LICENSE) file for details.
|
{elasticsearch_mcp_server-2.0.13.dist-info → elasticsearch_mcp_server-2.0.15.dist-info}/RECORD
RENAMED
|
@@ -1,25 +1,27 @@
|
|
|
1
1
|
src/__init__.py,sha256=aNKcThftSLh9IjOTA-UUpoRzIm4R0WwXKGAzykwecmU,211
|
|
2
|
-
src/server.py,sha256=
|
|
3
|
-
src/version.py,sha256=
|
|
2
|
+
src/server.py,sha256=VDp65H4uiscYlyzrCiRornKknVvj5EmHqAE3YkMWCcI,5342
|
|
3
|
+
src/version.py,sha256=zWBLe0KCgxwnzqR8oDNNIWmSnEBhv4C5BXau4NDLzKE,23
|
|
4
4
|
src/clients/__init__.py,sha256=MUKeCxvAFzzVfQr4x1seB7cRVLtWAk7pb1-5tLG0T8g,1299
|
|
5
|
-
src/clients/base.py,sha256=
|
|
5
|
+
src/clients/base.py,sha256=8HQ7YCOQXly_abbUpcMGOlz_-ShmJ4nF3yfa5SqT3cU,5535
|
|
6
6
|
src/clients/exceptions.py,sha256=NYF3KVw-9aAgCViin5OuBI6miMEPS5QsdHx6bcis1wc,2493
|
|
7
7
|
src/clients/common/__init__.py,sha256=VgvgxFpESn2wAuJmH0XM_Ej2izI7dxK7QJe9wG4fmW0,211
|
|
8
8
|
src/clients/common/alias.py,sha256=rB53TSld5x2vZyDNAwyEdnh1KWUXMSD7h5fSv_ubR2Q,759
|
|
9
|
-
src/clients/common/client.py,sha256=
|
|
9
|
+
src/clients/common/client.py,sha256=xXsCab5H3360lF4SXSVXiZY-F4XTAMljGIFl-PyNdG0,1119
|
|
10
10
|
src/clients/common/cluster.py,sha256=pd5BVpqqDU6Lck3K704eEdhgFgzt9NstotWQLyG9zFM,401
|
|
11
|
+
src/clients/common/data_stream.py,sha256=2zFCekGxF9f6kxFSRmb8qP8nzONf7IrLzb4vO0bHjfs,741
|
|
11
12
|
src/clients/common/document.py,sha256=ZzZiXDf_UhlN2FCmqW3drVjIZ07kGYP9yth_sgsJGPc,1623
|
|
12
13
|
src/clients/common/general.py,sha256=_1eS11Ha-JC1x1YoSu63zUWXKvYkwvN8RQOUM1fx39M,469
|
|
13
14
|
src/clients/common/index.py,sha256=vyH5iXlJe5JLcDK6fhCCEPN-tgGm6zP5ilwGPdWCXbY,776
|
|
14
15
|
src/tools/__init__.py,sha256=PGsXXpPubVnUbzXJG4keDhgjr0j6EnMNDs0aLqNIb4A,387
|
|
15
16
|
src/tools/alias.py,sha256=p9TD4gXkGRGWHTYfvCg7G2hj-Uch9jwDXJNUY1hSD0Y,1376
|
|
16
17
|
src/tools/cluster.py,sha256=XRAG-uxdfrieYX1ov_cBb66IYXaa8OoSWCUfXvNauy0,587
|
|
18
|
+
src/tools/data_stream.py,sha256=l9VItmvIkkffF2g3kLaRU-4VytzWteorB7vnpvovcdE,1825
|
|
17
19
|
src/tools/document.py,sha256=XZTVuk4di9VEwWMZN7jyDVnzoOiXkb4FBrXF44sVXTs,2052
|
|
18
20
|
src/tools/general.py,sha256=whj1spjIb8SS75h843X6c3RTsrZcSm-66KVLlY7OEh0,817
|
|
19
21
|
src/tools/index.py,sha256=7KNPtElTFelkjRSvdMqPBx9nx_9Uk01OnTMeVo7YeCs,1345
|
|
20
22
|
src/tools/register.py,sha256=wrG2P6-YPW77bTg1j_ELp8omWRYsJjFeOHUy_unHe6Y,1344
|
|
21
|
-
elasticsearch_mcp_server-2.0.
|
|
22
|
-
elasticsearch_mcp_server-2.0.
|
|
23
|
-
elasticsearch_mcp_server-2.0.
|
|
24
|
-
elasticsearch_mcp_server-2.0.
|
|
25
|
-
elasticsearch_mcp_server-2.0.
|
|
23
|
+
elasticsearch_mcp_server-2.0.15.dist-info/METADATA,sha256=OPP7wboFUfiRC_t3cnIoc0GXE5eW3-ELg3XmNmWVivk,23214
|
|
24
|
+
elasticsearch_mcp_server-2.0.15.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
25
|
+
elasticsearch_mcp_server-2.0.15.dist-info/entry_points.txt,sha256=ImfJnUwMpQUBmu-1MeBG_P0dwamfXKQh82mBKW7tWNY,138
|
|
26
|
+
elasticsearch_mcp_server-2.0.15.dist-info/licenses/LICENSE,sha256=DBsjuP5FR51d9kaUdXlVBuBv3cQ_I_adq9gefYQ9FcY,11339
|
|
27
|
+
elasticsearch_mcp_server-2.0.15.dist-info/RECORD,,
|
src/clients/base.py
CHANGED
|
@@ -91,6 +91,9 @@ class SearchClientBase(ABC):
|
|
|
91
91
|
# Check Elasticsearch package version to determine auth parameter name
|
|
92
92
|
try:
|
|
93
93
|
from elasticsearch import __version__ as es_version
|
|
94
|
+
# Convert version tuple to string format
|
|
95
|
+
version_str = '.'.join(map(str, es_version))
|
|
96
|
+
self.logger.info(f"Elasticsearch client version: {version_str}")
|
|
94
97
|
major_version = es_version[0]
|
|
95
98
|
if major_version >= 8:
|
|
96
99
|
# ES 8+ uses basic_auth
|
src/clients/common/client.py
CHANGED
|
@@ -2,11 +2,12 @@ from typing import Dict
|
|
|
2
2
|
|
|
3
3
|
from src.clients.common.alias import AliasClient
|
|
4
4
|
from src.clients.common.cluster import ClusterClient
|
|
5
|
+
from src.clients.common.data_stream import DataStreamClient
|
|
5
6
|
from src.clients.common.document import DocumentClient
|
|
6
7
|
from src.clients.common.general import GeneralClient
|
|
7
8
|
from src.clients.common.index import IndexClient
|
|
8
9
|
|
|
9
|
-
class SearchClient(IndexClient, DocumentClient, ClusterClient, AliasClient, GeneralClient):
|
|
10
|
+
class SearchClient(IndexClient, DocumentClient, ClusterClient, AliasClient, DataStreamClient, GeneralClient):
|
|
10
11
|
"""
|
|
11
12
|
Unified search client that combines all search functionality.
|
|
12
13
|
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
from typing import Dict, Optional
|
|
2
|
+
from src.clients.base import SearchClientBase
|
|
3
|
+
|
|
4
|
+
class DataStreamClient(SearchClientBase):
|
|
5
|
+
def create_data_stream(self, name: str) -> Dict:
|
|
6
|
+
"""Create a new data stream."""
|
|
7
|
+
return self.client.indices.create_data_stream(name=name)
|
|
8
|
+
|
|
9
|
+
def get_data_stream(self, name: Optional[str] = None) -> Dict:
|
|
10
|
+
"""Get information about one or more data streams."""
|
|
11
|
+
if name:
|
|
12
|
+
return self.client.indices.get_data_stream(name=name)
|
|
13
|
+
else:
|
|
14
|
+
return self.client.indices.get_data_stream()
|
|
15
|
+
|
|
16
|
+
def delete_data_stream(self, name: str) -> Dict:
|
|
17
|
+
"""Delete one or more data streams."""
|
|
18
|
+
return self.client.indices.delete_data_stream(name=name)
|
src/server.py
CHANGED
|
@@ -7,6 +7,7 @@ from fastmcp import FastMCP
|
|
|
7
7
|
from src.clients import create_search_client
|
|
8
8
|
from src.tools.alias import AliasTools
|
|
9
9
|
from src.tools.cluster import ClusterTools
|
|
10
|
+
from src.tools.data_stream import DataStreamTools
|
|
10
11
|
from src.tools.document import DocumentTools
|
|
11
12
|
from src.tools.general import GeneralTools
|
|
12
13
|
from src.tools.index import IndexTools
|
|
@@ -19,7 +20,13 @@ class SearchMCPServer:
|
|
|
19
20
|
self.engine_type = engine_type
|
|
20
21
|
self.name = f"{self.engine_type}-mcp-server"
|
|
21
22
|
self.mcp = FastMCP(self.name)
|
|
22
|
-
|
|
23
|
+
|
|
24
|
+
# Configure logging
|
|
25
|
+
logging.basicConfig(
|
|
26
|
+
level=logging.INFO,
|
|
27
|
+
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
|
|
28
|
+
)
|
|
29
|
+
self.logger = logging.getLogger(__name__)
|
|
23
30
|
self.logger.info(f"Initializing {self.name}, Version: {VERSION}")
|
|
24
31
|
|
|
25
32
|
# Create the corresponding search client
|
|
@@ -39,6 +46,7 @@ class SearchMCPServer:
|
|
|
39
46
|
DocumentTools,
|
|
40
47
|
ClusterTools,
|
|
41
48
|
AliasTools,
|
|
49
|
+
DataStreamTools,
|
|
42
50
|
GeneralTools,
|
|
43
51
|
]
|
|
44
52
|
# Register all tools
|
src/tools/data_stream.py
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
from typing import Dict, Optional
|
|
2
|
+
from fastmcp import FastMCP
|
|
3
|
+
|
|
4
|
+
class DataStreamTools:
|
|
5
|
+
def __init__(self, search_client):
|
|
6
|
+
self.search_client = search_client
|
|
7
|
+
|
|
8
|
+
def register_tools(self, mcp: FastMCP):
|
|
9
|
+
"""Register data stream tools with the MCP server."""
|
|
10
|
+
|
|
11
|
+
@mcp.tool()
|
|
12
|
+
def create_data_stream(name: str) -> Dict:
|
|
13
|
+
"""Create a new data stream.
|
|
14
|
+
|
|
15
|
+
This creates a new data stream with the specified name.
|
|
16
|
+
The data stream must have a matching index template before creation.
|
|
17
|
+
|
|
18
|
+
Args:
|
|
19
|
+
name: Name of the data stream to create
|
|
20
|
+
"""
|
|
21
|
+
return self.search_client.create_data_stream(name=name)
|
|
22
|
+
|
|
23
|
+
@mcp.tool()
|
|
24
|
+
def get_data_stream(name: Optional[str] = None) -> Dict:
|
|
25
|
+
"""Get information about one or more data streams.
|
|
26
|
+
|
|
27
|
+
Retrieves configuration, mappings, settings, and other information
|
|
28
|
+
about the specified data streams.
|
|
29
|
+
|
|
30
|
+
Args:
|
|
31
|
+
name: Name of the data stream(s) to retrieve.
|
|
32
|
+
Can be a comma-separated list or wildcard pattern.
|
|
33
|
+
If not provided, retrieves all data streams.
|
|
34
|
+
"""
|
|
35
|
+
return self.search_client.get_data_stream(name=name)
|
|
36
|
+
|
|
37
|
+
@mcp.tool()
|
|
38
|
+
def delete_data_stream(name: str) -> Dict:
|
|
39
|
+
"""Delete one or more data streams.
|
|
40
|
+
|
|
41
|
+
Permanently deletes the specified data streams and all their backing indices.
|
|
42
|
+
|
|
43
|
+
Args:
|
|
44
|
+
name: Name of the data stream(s) to delete.
|
|
45
|
+
Can be a comma-separated list or wildcard pattern.
|
|
46
|
+
"""
|
|
47
|
+
return self.search_client.delete_data_stream(name=name)
|
src/version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "2.0.
|
|
1
|
+
__version__ = "2.0.15"
|
{elasticsearch_mcp_server-2.0.13.dist-info → elasticsearch_mcp_server-2.0.15.dist-info}/WHEEL
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|