maven-indexer-mcp 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/build/indexer.js +5 -1
  2. package/package.json +1 -1
package/build/indexer.js CHANGED
@@ -265,7 +265,11 @@ export class Indexer {
265
265
  // Use FTS for smart matching
266
266
  // If pattern has no spaces, we assume it's a prefix or exact match query
267
267
  // "String" -> match "String" in simple_name or class_name
268
- const query = `"${classNamePattern}"* OR ${classNamePattern}`;
268
+ const escapedPattern = classNamePattern.replace(/"/g, '""');
269
+ const safeQuery = classNamePattern.replace(/[^a-zA-Z0-9]/g, ' ').trim();
270
+ const query = safeQuery.length > 0
271
+ ? `"${escapedPattern}"* OR ${safeQuery}`
272
+ : `"${escapedPattern}"*`;
269
273
  try {
270
274
  const rows = db.prepare(`
271
275
  SELECT c.class_name, c.simple_name, a.id, a.group_id, a.artifact_id, a.version, a.abspath, a.has_source
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "maven-indexer-mcp",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "MCP server for indexing local Maven repository",
5
5
  "main": "build/index.js",
6
6
  "type": "module",