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.
Files changed (49) hide show
  1. package/README.md +72 -71
  2. package/build/server.d.ts +9 -6
  3. package/build/server.d.ts.map +1 -1
  4. package/build/server.js +282 -164
  5. package/build/server.js.map +1 -1
  6. package/build/tools/get-account-summary.d.ts +31 -0
  7. package/build/tools/get-account-summary.d.ts.map +1 -0
  8. package/build/tools/get-account-summary.js +173 -0
  9. package/build/tools/get-account-summary.js.map +1 -0
  10. package/build/tools/get-dashboard-summary.d.ts +53 -0
  11. package/build/tools/get-dashboard-summary.d.ts.map +1 -0
  12. package/build/tools/get-dashboard-summary.js +275 -0
  13. package/build/tools/get-dashboard-summary.js.map +1 -0
  14. package/build/tools/get-group-summary.d.ts +49 -0
  15. package/build/tools/get-group-summary.d.ts.map +1 -0
  16. package/build/tools/get-group-summary.js +320 -0
  17. package/build/tools/get-group-summary.js.map +1 -0
  18. package/build/tools/get-index-fields.d.ts +27 -0
  19. package/build/tools/get-index-fields.d.ts.map +1 -0
  20. package/build/tools/get-index-fields.js +157 -0
  21. package/build/tools/get-index-fields.js.map +1 -0
  22. package/build/tools/get-platform-breakdown.d.ts +41 -0
  23. package/build/tools/get-platform-breakdown.d.ts.map +1 -0
  24. package/build/tools/get-platform-breakdown.js +270 -0
  25. package/build/tools/get-platform-breakdown.js.map +1 -0
  26. package/build/tools/get-rating-distribution.d.ts +49 -0
  27. package/build/tools/get-rating-distribution.d.ts.map +1 -0
  28. package/build/tools/get-rating-distribution.js +275 -0
  29. package/build/tools/get-rating-distribution.js.map +1 -0
  30. package/build/tools/get-visit-trends.d.ts +38 -0
  31. package/build/tools/get-visit-trends.d.ts.map +1 -0
  32. package/build/tools/get-visit-trends.js +261 -0
  33. package/build/tools/get-visit-trends.js.map +1 -0
  34. package/build/tools/index.d.ts +18 -12
  35. package/build/tools/index.d.ts.map +1 -1
  36. package/build/tools/index.js +19 -13
  37. package/build/tools/index.js.map +1 -1
  38. package/build/tools/period-summary.d.ts +36 -0
  39. package/build/tools/period-summary.d.ts.map +1 -0
  40. package/build/tools/period-summary.js +209 -0
  41. package/build/tools/period-summary.js.map +1 -0
  42. package/build/tools/search-elasticsearch.d.ts.map +1 -1
  43. package/build/tools/search-elasticsearch.js +9 -1
  44. package/build/tools/search-elasticsearch.js.map +1 -1
  45. package/build/tools/top-change.d.ts +33 -0
  46. package/build/tools/top-change.d.ts.map +1 -0
  47. package/build/tools/top-change.js +214 -0
  48. package/build/tools/top-change.js.map +1 -0
  49. package/package.json +2 -2
package/README.md CHANGED
@@ -1,29 +1,28 @@
1
- # Elasticsearch MCP
1
+ # Elasticsearch MCP (VSee Fork)
2
2
 
3
- > **Model Context Protocol server for Elasticsearch integration with comprehensive security and performance features**
3
+ > **Modified MCP server with hardcoded schemas matching VSee's Elasticsearch indexes. Specialized analytics tools optimized for stats-* indices.**
4
4
 
5
- [![npm version](https://badge.fury.io/js/elasticsearch-mcp.svg)](https://www.npmjs.com/package/elasticsearch-mcp)
5
+ [![npm version](https://badge.fury.io/js/elasticsearch-mcp-vsee.svg)](https://www.npmjs.com/package/elasticsearch-mcp-vsee)
6
6
  [![TypeScript](https://img.shields.io/badge/TypeScript-007ACC?logo=typescript&logoColor=white)](https://www.typescriptlang.org/)
7
7
  [![Elasticsearch](https://img.shields.io/badge/Elasticsearch-005571?logo=elasticsearch&logoColor=white)](https://www.elastic.co/)
8
8
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
9
9
 
10
- **elasticsearch-mcp** is a Model Context Protocol (MCP) server that provides standardized, secure tools for interacting with Elasticsearch clusters. Built with TypeScript and optimized for Elastic Cloud environments, it offers comprehensive data management capabilities with enterprise-grade security features.
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**: Streaming for large datasets, connection pooling, health monitoring
17
- - **🛠️ Comprehensive Tools**: 7 essential tools covering all major Elasticsearch operations
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
- | `fetch_indices` | List and filter Elasticsearch indices | Index management, monitoring |
75
- | `search_elasticsearch` | Advanced search with aggregations | Data analysis, querying |
76
- | `create_index` | Create indices with mappings/settings | Schema management |
77
- | `insert_data` | Insert documents with validation | Data ingestion |
78
- | `update_document` | Update documents with scripts | Data modification |
79
- | `delete_document` | Delete by ID or query | Data cleanup |
80
- | `export_to_csv` | Stream data to CSV files | Reporting, data export |
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
- ### Export Large Dataset
118
+ ### Get Account Summary
117
119
 
118
120
  ```json
119
121
  {
120
- "tool": "export_to_csv",
122
+ "tool": "get_account_summary",
121
123
  "arguments": {
122
- "index": "user-analytics",
123
- "query": {
124
- "bool": {
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
- ### Create Index with Schema
131
+ ### Get Top Accounts by Growth
140
132
 
141
133
  ```json
142
134
  {
143
- "tool": "create_index",
135
+ "tool": "top_change",
144
136
  "arguments": {
145
- "name": "product-catalog",
146
- "mappings": {
147
- "properties": {
148
- "name": { "type": "text", "analyzer": "standard" },
149
- "price": { "type": "float" },
150
- "category": { "type": "keyword" },
151
- "created_at": { "type": "date" },
152
- "tags": { "type": "keyword" },
153
- "description": { "type": "text" }
154
- }
155
- },
156
- "settings": {
157
- "number_of_shards": 1,
158
- "number_of_replicas": 1,
159
- "analysis": {
160
- "analyzer": {
161
- "product_analyzer": {
162
- "type": "standard",
163
- "stopwords": "_english_"
164
- }
165
- }
166
- }
167
- },
168
- "aliases": ["products", "catalog"]
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
- │ • create
245
- │ • insert
246
- │ • update
247
- │ • delete
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
- - **Large Exports**: 10K+ documents/second with streaming
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
- - **Streaming**: Memory-efficient processing of large datasets
263
- - **Compression**: Reduces export file sizes by 70%+
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.1.0** - Initial release with 7 core tools
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 exportToCSVTool;
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;
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAkBA,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,gBAAgB,CAAmB;IAC3C,OAAO,CAAC,eAAe,CAAkB;IACzC,OAAO,CAAC,cAAc,CAAiB;IACvC,OAAO,CAAC,kBAAkB,CAAqB;IAC/C,OAAO,CAAC,kBAAkB,CAAqB;IAC/C,OAAO,CAAC,uBAAuB,CAA0B;IACzD,OAAO,CAAC,eAAe,CAAkB;;IAiCzC,OAAO,CAAC,aAAa;IAkVrB,OAAO,CAAC,qBAAqB;IAoCvB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAmB7B;AAED,eAAe,gBAAgB,CAAC"}
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"}