elasticsearch-mcp-server 2.0.14__py3-none-any.whl → 2.0.16__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.14.dist-info → elasticsearch_mcp_server-2.0.16.dist-info}/METADATA +21 -9
- {elasticsearch_mcp_server-2.0.14.dist-info → elasticsearch_mcp_server-2.0.16.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.14.dist-info → elasticsearch_mcp_server-2.0.16.dist-info}/WHEEL +0 -0
- {elasticsearch_mcp_server-2.0.14.dist-info → elasticsearch_mcp_server-2.0.16.dist-info}/entry_points.txt +0 -0
- {elasticsearch_mcp_server-2.0.14.dist-info → elasticsearch_mcp_server-2.0.16.dist-info}/licenses/LICENSE +0 -0
{elasticsearch_mcp_server-2.0.14.dist-info → elasticsearch_mcp_server-2.0.16.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.16
|
|
4
4
|
Summary: MCP Server for interacting with Elasticsearch and OpenSearch
|
|
5
5
|
License: Apache License
|
|
6
6
|
Version 2.0, January 2004
|
|
@@ -210,6 +210,7 @@ Requires-Dist: elasticsearch==8.17.2
|
|
|
210
210
|
Requires-Dist: fastmcp==2.8.0
|
|
211
211
|
Requires-Dist: mcp==1.9.2
|
|
212
212
|
Requires-Dist: opensearch-py==2.8.0
|
|
213
|
+
Requires-Dist: pydantic<2.12.0,>=2.11.0
|
|
213
214
|
Requires-Dist: python-dotenv==1.1.0
|
|
214
215
|
Requires-Dist: tomli-w==1.2.0
|
|
215
216
|
Requires-Dist: tomli==2.2.1
|
|
@@ -248,6 +249,9 @@ https://github.com/user-attachments/assets/f7409e31-fac4-4321-9c94-b0ff2ea7ff15
|
|
|
248
249
|
- `get_index`: Returns information (mappings, settings, aliases) about one or more indices.
|
|
249
250
|
- `create_index`: Create a new index.
|
|
250
251
|
- `delete_index`: Delete an index.
|
|
252
|
+
- `create_data_stream`: Create a new data stream (requires matching index template).
|
|
253
|
+
- `get_data_stream`: Get information about one or more data streams.
|
|
254
|
+
- `delete_data_stream`: Delete one or more data streams and their backing indices.
|
|
251
255
|
|
|
252
256
|
### Document Operations
|
|
253
257
|
|
|
@@ -372,7 +376,7 @@ Using `uv` requires cloning the repository locally and specifying the path to th
|
|
|
372
376
|
"command": "uv",
|
|
373
377
|
"args": [
|
|
374
378
|
"--directory",
|
|
375
|
-
"path/to/
|
|
379
|
+
"path/to/elasticsearch-mcp-server",
|
|
376
380
|
"run",
|
|
377
381
|
"elasticsearch-mcp-server"
|
|
378
382
|
],
|
|
@@ -392,7 +396,7 @@ Using `uv` requires cloning the repository locally and specifying the path to th
|
|
|
392
396
|
"command": "uv",
|
|
393
397
|
"args": [
|
|
394
398
|
"--directory",
|
|
395
|
-
"path/to/
|
|
399
|
+
"path/to/elasticsearch-mcp-server",
|
|
396
400
|
"run",
|
|
397
401
|
"elasticsearch-mcp-server"
|
|
398
402
|
],
|
|
@@ -411,7 +415,7 @@ Using `uv` requires cloning the repository locally and specifying the path to th
|
|
|
411
415
|
"command": "uv",
|
|
412
416
|
"args": [
|
|
413
417
|
"--directory",
|
|
414
|
-
"path/to/
|
|
418
|
+
"path/to/elasticsearch-mcp-server",
|
|
415
419
|
"run",
|
|
416
420
|
"opensearch-mcp-server"
|
|
417
421
|
],
|
|
@@ -489,11 +493,7 @@ uv run src/server.py elasticsearch-mcp-server --transport streamable-http --host
|
|
|
489
493
|
|
|
490
494
|
## Compatibility
|
|
491
495
|
|
|
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
|
-
```
|
|
496
|
+
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
497
|
|
|
498
498
|
| MCP Server | Elasticsearch |
|
|
499
499
|
| --- | --- |
|
|
@@ -502,6 +502,18 @@ uvx elasticsearch-mcp-server-es7
|
|
|
502
502
|
| elasticsearch-mcp-server-es9 | Elasticsearch 9.x |
|
|
503
503
|
| opensearch-mcp-server | OpenSearch 1.x, 2.x, 3.x |
|
|
504
504
|
|
|
505
|
+
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:
|
|
506
|
+
|
|
507
|
+
```bash
|
|
508
|
+
uvx elasticsearch-mcp-server-es7
|
|
509
|
+
```
|
|
510
|
+
|
|
511
|
+
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:
|
|
512
|
+
|
|
513
|
+
```bash
|
|
514
|
+
uv run src/server.py elasticsearch-mcp-server
|
|
515
|
+
```
|
|
516
|
+
|
|
505
517
|
## License
|
|
506
518
|
|
|
507
519
|
This project is licensed under the Apache License Version 2.0 - see the [LICENSE](LICENSE) file for details.
|
{elasticsearch_mcp_server-2.0.14.dist-info → elasticsearch_mcp_server-2.0.16.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=6KKZqs-riZy7B_ZI5UKDLJyHCTX9LRlwPfBN0xcfq_U,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.16.dist-info/METADATA,sha256=ov7ljqcgU2VQ7MyVbcwCnUIdBvFWvihiCroybqQ-naU,23254
|
|
24
|
+
elasticsearch_mcp_server-2.0.16.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
25
|
+
elasticsearch_mcp_server-2.0.16.dist-info/entry_points.txt,sha256=ImfJnUwMpQUBmu-1MeBG_P0dwamfXKQh82mBKW7tWNY,138
|
|
26
|
+
elasticsearch_mcp_server-2.0.16.dist-info/licenses/LICENSE,sha256=DBsjuP5FR51d9kaUdXlVBuBv3cQ_I_adq9gefYQ9FcY,11339
|
|
27
|
+
elasticsearch_mcp_server-2.0.16.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.16"
|
{elasticsearch_mcp_server-2.0.14.dist-info → elasticsearch_mcp_server-2.0.16.dist-info}/WHEEL
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|