es-mcp-server 1.0.0 → 1.0.1

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 (2) hide show
  1. package/index.js +6 -1
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -331,9 +331,14 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
331
331
  };
332
332
 
333
333
  case "es_search":
334
+ // 自动包装 query 参数:如果没有外层 query 键,自动添加
335
+ let queryBody = args.query || { match_all: {} };
336
+ if (!queryBody.query) {
337
+ queryBody = { query: queryBody };
338
+ }
334
339
  const searchParams = {
335
340
  index: args.index,
336
- body: args.query || { query: { match_all: {} } },
341
+ body: queryBody,
337
342
  };
338
343
  if (args.size) {
339
344
  searchParams.size = args.size;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "es-mcp-server",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Elasticsearch MCP Server for Claude Code",
5
5
  "main": "index.js",
6
6
  "type": "module",