elasticsearch-mcp-vsee 0.2.2 → 0.4.0
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.
- package/README.md +72 -71
- package/build/server.d.ts +9 -6
- package/build/server.d.ts.map +1 -1
- package/build/server.js +282 -164
- package/build/server.js.map +1 -1
- package/build/tools/get-account-summary.d.ts +31 -0
- package/build/tools/get-account-summary.d.ts.map +1 -0
- package/build/tools/get-account-summary.js +173 -0
- package/build/tools/get-account-summary.js.map +1 -0
- package/build/tools/get-dashboard-summary.d.ts +53 -0
- package/build/tools/get-dashboard-summary.d.ts.map +1 -0
- package/build/tools/get-dashboard-summary.js +275 -0
- package/build/tools/get-dashboard-summary.js.map +1 -0
- package/build/tools/get-group-summary.d.ts +49 -0
- package/build/tools/get-group-summary.d.ts.map +1 -0
- package/build/tools/get-group-summary.js +320 -0
- package/build/tools/get-group-summary.js.map +1 -0
- package/build/tools/get-index-fields.d.ts +27 -0
- package/build/tools/get-index-fields.d.ts.map +1 -0
- package/build/tools/get-index-fields.js +157 -0
- package/build/tools/get-index-fields.js.map +1 -0
- package/build/tools/get-platform-breakdown.d.ts +41 -0
- package/build/tools/get-platform-breakdown.d.ts.map +1 -0
- package/build/tools/get-platform-breakdown.js +270 -0
- package/build/tools/get-platform-breakdown.js.map +1 -0
- package/build/tools/get-rating-distribution.d.ts +49 -0
- package/build/tools/get-rating-distribution.d.ts.map +1 -0
- package/build/tools/get-rating-distribution.js +275 -0
- package/build/tools/get-rating-distribution.js.map +1 -0
- package/build/tools/get-visit-trends.d.ts +38 -0
- package/build/tools/get-visit-trends.d.ts.map +1 -0
- package/build/tools/get-visit-trends.js +261 -0
- package/build/tools/get-visit-trends.js.map +1 -0
- package/build/tools/index.d.ts +18 -12
- package/build/tools/index.d.ts.map +1 -1
- package/build/tools/index.js +19 -13
- package/build/tools/index.js.map +1 -1
- package/build/tools/period-summary.d.ts +36 -0
- package/build/tools/period-summary.d.ts.map +1 -0
- package/build/tools/period-summary.js +209 -0
- package/build/tools/period-summary.js.map +1 -0
- package/build/tools/search-elasticsearch.d.ts.map +1 -1
- package/build/tools/search-elasticsearch.js +9 -1
- package/build/tools/search-elasticsearch.js.map +1 -1
- package/build/tools/top-change.d.ts +33 -0
- package/build/tools/top-change.d.ts.map +1 -0
- package/build/tools/top-change.js +214 -0
- package/build/tools/top-change.js.map +1 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,29 +1,28 @@
|
|
|
1
|
-
# Elasticsearch MCP
|
|
1
|
+
# Elasticsearch MCP (VSee Fork)
|
|
2
2
|
|
|
3
|
-
> **
|
|
3
|
+
> **Modified MCP server with hardcoded schemas matching VSee's Elasticsearch indexes. Specialized analytics tools optimized for stats-* indices.**
|
|
4
4
|
|
|
5
|
-
[](https://www.npmjs.com/package/elasticsearch-mcp)
|
|
5
|
+
[](https://www.npmjs.com/package/elasticsearch-mcp-vsee)
|
|
6
6
|
[](https://www.typescriptlang.org/)
|
|
7
7
|
[](https://www.elastic.co/)
|
|
8
8
|
[](https://opensource.org/licenses/MIT)
|
|
9
9
|
|
|
10
|
-
**elasticsearch-mcp** is a Model Context Protocol (MCP) server that provides
|
|
10
|
+
**elasticsearch-mcp-vsee** is a modified Model Context Protocol (MCP) server that provides specialized analytics tools for Elasticsearch clusters, optimized for VSee's stats-* indices. This fork features hardcoded schemas and field names that match VSee's specific Elasticsearch index structure, enabling specialized tools for account/group analytics, visit trends, platform breakdowns, and rating distributions. Built with TypeScript and optimized for Elastic Cloud environments, it offers comprehensive analytics capabilities with enterprise-grade security features.
|
|
11
11
|
|
|
12
12
|
## 🚀 Features
|
|
13
13
|
|
|
14
14
|
- **🔐 Secure by Design**: Input validation, script sanitization, injection prevention
|
|
15
15
|
- **☁️ Elastic Cloud Ready**: Native support for cloud ID and API key authentication
|
|
16
|
-
- **⚡ High Performance**:
|
|
17
|
-
- **🛠️ Comprehensive Tools**:
|
|
16
|
+
- **⚡ High Performance**: Connection pooling, optimized query execution, efficient aggregations
|
|
17
|
+
- **🛠️ Comprehensive Tools**: 10 specialized tools for analytics, summaries, and data exploration
|
|
18
18
|
- **📊 Advanced Querying**: Full Elasticsearch DSL support with aggregations and highlighting
|
|
19
|
-
- **📁 Data Export**: Stream large datasets to CSV with compression support
|
|
20
19
|
- **🔍 Smart Validation**: Zod-based schemas with security-first validation
|
|
21
20
|
- **📝 Full TypeScript**: Complete type safety with strict null checks
|
|
22
21
|
|
|
23
22
|
## 📦 Installation
|
|
24
23
|
|
|
25
24
|
```bash
|
|
26
|
-
npm install elasticsearch-mcp
|
|
25
|
+
npm install elasticsearch-mcp-vsee
|
|
27
26
|
```
|
|
28
27
|
|
|
29
28
|
## 🏃♂️ Quick Start
|
|
@@ -36,7 +35,7 @@ export ELASTIC_CLOUD_ID="your-cloud-id"
|
|
|
36
35
|
export ELASTIC_API_KEY="your-api-key"
|
|
37
36
|
|
|
38
37
|
# Start the MCP server
|
|
39
|
-
npx elasticsearch-mcp
|
|
38
|
+
npx elasticsearch-mcp-vsee
|
|
40
39
|
```
|
|
41
40
|
|
|
42
41
|
### 2. Using with Claude Desktop
|
|
@@ -46,9 +45,9 @@ Add to your Claude Desktop MCP configuration:
|
|
|
46
45
|
```json
|
|
47
46
|
{
|
|
48
47
|
"mcpServers": {
|
|
49
|
-
"elasticsearch-mcp": {
|
|
48
|
+
"elasticsearch-mcp-vsee": {
|
|
50
49
|
"command": "npx",
|
|
51
|
-
"args": ["elasticsearch-mcp"],
|
|
50
|
+
"args": ["elasticsearch-mcp-vsee"],
|
|
52
51
|
"env": {
|
|
53
52
|
"ELASTIC_CLOUD_ID": "your-cloud-id",
|
|
54
53
|
"ELASTIC_API_KEY": "your-api-key"
|
|
@@ -61,7 +60,7 @@ Add to your Claude Desktop MCP configuration:
|
|
|
61
60
|
### 3. Using with any MCP Client
|
|
62
61
|
|
|
63
62
|
```typescript
|
|
64
|
-
import { ElasticMCPServer } from 'elasticsearch-mcp';
|
|
63
|
+
import { ElasticMCPServer } from 'elasticsearch-mcp-vsee';
|
|
65
64
|
|
|
66
65
|
const server = new ElasticMCPServer();
|
|
67
66
|
await server.start();
|
|
@@ -71,13 +70,16 @@ await server.start();
|
|
|
71
70
|
|
|
72
71
|
| Tool | Description | Use Cases |
|
|
73
72
|
|------|-------------|-----------|
|
|
74
|
-
| `
|
|
75
|
-
| `
|
|
76
|
-
| `
|
|
77
|
-
| `
|
|
78
|
-
| `
|
|
79
|
-
| `
|
|
80
|
-
| `
|
|
73
|
+
| `search_elasticsearch` | Advanced search with aggregations | Custom queries, data analysis |
|
|
74
|
+
| `get_index_fields` | Discover index fields and types | Schema exploration, field discovery |
|
|
75
|
+
| `top_change` | Find top accounts or groups with highest visit increase/decrease | Trend analysis, account/group monitoring |
|
|
76
|
+
| `period_summary` | Weekly/monthly/yearly summaries by subscription | Period-based reporting |
|
|
77
|
+
| `get_account_summary` | Comprehensive statistics for a specific account | Account analytics, performance review |
|
|
78
|
+
| `get_group_summary` | Group statistics with account breakdown | Group management, resource allocation |
|
|
79
|
+
| `get_platform_breakdown` | Platform or platform version breakdown (provider/patient, platform/version) | Platform adoption, device preferences, version analysis |
|
|
80
|
+
| `get_rating_distribution` | Rating histograms with statistics | Satisfaction analysis |
|
|
81
|
+
| `get_visit_trends` | Time series visit trends (daily/weekly/monthly) | Trend visualization |
|
|
82
|
+
| `get_dashboard_summary` | High-level dashboard metrics overview | Executive dashboards, KPIs |
|
|
81
83
|
|
|
82
84
|
## 📋 Tool Examples
|
|
83
85
|
|
|
@@ -113,59 +115,59 @@ await server.start();
|
|
|
113
115
|
}
|
|
114
116
|
```
|
|
115
117
|
|
|
116
|
-
###
|
|
118
|
+
### Get Account Summary
|
|
117
119
|
|
|
118
120
|
```json
|
|
119
121
|
{
|
|
120
|
-
"tool": "
|
|
122
|
+
"tool": "get_account_summary",
|
|
121
123
|
"arguments": {
|
|
122
|
-
"
|
|
123
|
-
"
|
|
124
|
-
|
|
125
|
-
"filter": [
|
|
126
|
-
{ "term": { "status": "active" } },
|
|
127
|
-
{ "range": { "last_login": { "gte": "2024-01-01" } } }
|
|
128
|
-
]
|
|
129
|
-
}
|
|
130
|
-
},
|
|
131
|
-
"fields": ["user_id", "email", "last_login", "country"],
|
|
132
|
-
"filename": "active_users_2024.csv",
|
|
133
|
-
"compress": true,
|
|
134
|
-
"maxRows": 100000
|
|
124
|
+
"account": "example-customer",
|
|
125
|
+
"startDate": "now-1y",
|
|
126
|
+
"endDate": "now"
|
|
135
127
|
}
|
|
136
128
|
}
|
|
137
129
|
```
|
|
138
130
|
|
|
139
|
-
###
|
|
131
|
+
### Get Top Accounts by Growth
|
|
140
132
|
|
|
141
133
|
```json
|
|
142
134
|
{
|
|
143
|
-
"tool": "
|
|
135
|
+
"tool": "top_change",
|
|
144
136
|
"arguments": {
|
|
145
|
-
"
|
|
146
|
-
"
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
137
|
+
"groupBy": "account",
|
|
138
|
+
"direction": "increase",
|
|
139
|
+
"topN": 10,
|
|
140
|
+
"currentPeriodDays": 30,
|
|
141
|
+
"previousPeriodDays": 30
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
### Get Platform Breakdown
|
|
147
|
+
|
|
148
|
+
```json
|
|
149
|
+
{
|
|
150
|
+
"tool": "get_platform_breakdown",
|
|
151
|
+
"arguments": {
|
|
152
|
+
"role": "provider",
|
|
153
|
+
"breakdownType": "version",
|
|
154
|
+
"topN": 10,
|
|
155
|
+
"startDate": "now-30d",
|
|
156
|
+
"endDate": "now"
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
### Get Visit Trends
|
|
162
|
+
|
|
163
|
+
```json
|
|
164
|
+
{
|
|
165
|
+
"tool": "get_visit_trends",
|
|
166
|
+
"arguments": {
|
|
167
|
+
"interval": "daily",
|
|
168
|
+
"startDate": "now-30d",
|
|
169
|
+
"endDate": "now",
|
|
170
|
+
"groupBy": "subscription"
|
|
169
171
|
}
|
|
170
172
|
}
|
|
171
173
|
```
|
|
@@ -239,13 +241,11 @@ REQUEST_TIMEOUT_MS=30000
|
|
|
239
241
|
┌─────────────┐
|
|
240
242
|
│ Tools │
|
|
241
243
|
│ │
|
|
242
|
-
│ • fetch │
|
|
243
244
|
│ • search │
|
|
244
|
-
│ •
|
|
245
|
-
│ •
|
|
246
|
-
│ •
|
|
247
|
-
│ •
|
|
248
|
-
│ • export │
|
|
245
|
+
│ • fields │
|
|
246
|
+
│ • summaries │
|
|
247
|
+
│ • trends │
|
|
248
|
+
│ • analytics │
|
|
249
249
|
└─────────────┘
|
|
250
250
|
```
|
|
251
251
|
|
|
@@ -253,14 +253,14 @@ REQUEST_TIMEOUT_MS=30000
|
|
|
253
253
|
|
|
254
254
|
### Benchmarks
|
|
255
255
|
- **Search**: <500ms average response time
|
|
256
|
-
- **
|
|
256
|
+
- **Aggregations**: Optimized for large-scale analytics
|
|
257
257
|
- **Memory Usage**: <100MB for typical operations
|
|
258
258
|
- **Concurrent Requests**: Up to 10 simultaneous operations
|
|
259
259
|
|
|
260
260
|
### Optimization Features
|
|
261
261
|
- **Connection Pooling**: Reuses Elasticsearch connections
|
|
262
|
-
- **
|
|
263
|
-
- **
|
|
262
|
+
- **Optimized Queries**: Efficient aggregation pipelines
|
|
263
|
+
- **Smart Caching**: Reduced redundant queries
|
|
264
264
|
- **Health Monitoring**: Automatic reconnection on failures
|
|
265
265
|
|
|
266
266
|
## 🔧 Development
|
|
@@ -359,12 +359,13 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
|
|
|
359
359
|
|
|
360
360
|
## 🏷️ Version History
|
|
361
361
|
|
|
362
|
-
- **v0.
|
|
362
|
+
- **v0.3.0** - Specialized analytics tools for stats-* indices (14 tools)
|
|
363
|
+
- **v0.1.0** - Initial release
|
|
363
364
|
- Full changelog: [CHANGELOG.md](CHANGELOG.md)
|
|
364
365
|
|
|
365
366
|
## 🔗 Links
|
|
366
367
|
|
|
367
|
-
- [npm Package](https://www.npmjs.com/package/elasticsearch-mcp)
|
|
368
|
+
- [npm Package](https://www.npmjs.com/package/elasticsearch-mcp-vsee)
|
|
368
369
|
- [GitHub Repository](https://github.com/RajwardhanShinde/elk-mcp)
|
|
369
370
|
- [Issue Tracker](https://github.com/RajwardhanShinde/elk-mcp/issues)
|
|
370
371
|
- [Elasticsearch Documentation](https://www.elastic.co/guide/)
|
package/build/server.d.ts
CHANGED
|
@@ -5,13 +5,16 @@ export declare class ElasticMCPServer {
|
|
|
5
5
|
private elasticsearch;
|
|
6
6
|
private errorHandler;
|
|
7
7
|
private isShuttingDown;
|
|
8
|
-
private fetchIndicesTool;
|
|
9
|
-
private createIndexTool;
|
|
10
|
-
private insertDataTool;
|
|
11
|
-
private updateDocumentTool;
|
|
12
|
-
private deleteDocumentTool;
|
|
13
8
|
private searchElasticsearchTool;
|
|
14
|
-
private
|
|
9
|
+
private getIndexFieldsTool;
|
|
10
|
+
private topChangeTool;
|
|
11
|
+
private periodSummaryTool;
|
|
12
|
+
private getAccountSummaryTool;
|
|
13
|
+
private getGroupSummaryTool;
|
|
14
|
+
private getPlatformBreakdownTool;
|
|
15
|
+
private getRatingDistributionTool;
|
|
16
|
+
private getVisitTrendsTool;
|
|
17
|
+
private getDashboardSummaryTool;
|
|
15
18
|
constructor();
|
|
16
19
|
private setupHandlers;
|
|
17
20
|
private setupGracefulShutdown;
|
package/build/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAqBA,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,MAAM,CAAe;IAC7B,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,aAAa,CAAuB;IAC5C,OAAO,CAAC,YAAY,CAAe;IACnC,OAAO,CAAC,cAAc,CAAS;IAG/B,OAAO,CAAC,uBAAuB,CAA0B;IACzD,OAAO,CAAC,kBAAkB,CAAqB;IAC/C,OAAO,CAAC,aAAa,CAAgB;IACrC,OAAO,CAAC,iBAAiB,CAAoB;IAC7C,OAAO,CAAC,qBAAqB,CAAwB;IACrD,OAAO,CAAC,mBAAmB,CAAsB;IACjD,OAAO,CAAC,wBAAwB,CAA2B;IAC3D,OAAO,CAAC,yBAAyB,CAA4B;IAC7D,OAAO,CAAC,kBAAkB,CAAqB;IAC/C,OAAO,CAAC,uBAAuB,CAA0B;;IAoCzD,OAAO,CAAC,aAAa;IAkcrB,OAAO,CAAC,qBAAqB;IAoCvB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAmB7B;AAED,eAAe,gBAAgB,CAAC"}
|