@lojban/semantic-search-mcp 1.0.14 → 1.0.16

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lojban/semantic-search-mcp",
3
- "version": "1.0.14",
3
+ "version": "1.0.16",
4
4
  "description": "Local-first MCP server for semantic search using transformers.js and SQLite",
5
5
  "type": "module",
6
6
  "scripts": {
package/src/index.ts CHANGED
@@ -6,16 +6,17 @@ import {
6
6
  ListToolsRequestSchema,
7
7
  } from '@modelcontextprotocol/sdk/types.js';
8
8
  import path from 'path';
9
+ import os from 'os';
9
10
  import { getEmbedding, getBatchEmbeddings } from './embeddings.js';
10
11
  import { createVectorStorage, type SearchResult } from './storage.js';
11
12
  import { normalizePath } from './path-util.js';
12
13
  import { listFilesInDirectories, readFileWithMetadata } from './scanner.js';
13
14
  import { getSampuVlasteDir } from './download-sampu-vlaste.js';
14
15
 
15
- // Data dir: use env, or project cwd so each workspace has its own index when run via npx from Cursor
16
+ // Data dir: use env, or $HOME/.semantic-search/data so the same index is used across MCP version upgrades (npx cwd can change per version)
16
17
  const dataDir =
17
18
  process.env.SEMANTIC_SEARCH_DATA_DIR ||
18
- path.join(process.cwd(), '.semantic-search', 'data');
19
+ path.join(os.homedir(), '.semantic-search', 'data');
19
20
  const DB_PATH = path.join(dataDir, 'vectors.db');
20
21
 
21
22
  // Background indexing state (progress for get_index_stats)
package/src/storage.ts CHANGED
@@ -128,11 +128,11 @@ export class VectorStorage {
128
128
  l.file_path,
129
129
  l.line_number,
130
130
  l.content,
131
- vec_distance_cosine(v.embedding, ?1) AS distance
131
+ vec_distance_cosine(v.embedding, ?) AS distance
132
132
  FROM vec_lines v
133
133
  INNER JOIN lines l ON v.line_id = l.id
134
134
  ORDER BY distance
135
- LIMIT ?2
135
+ LIMIT ?
136
136
  `);
137
137
  const rows = stmt.all([queryEmbedding.buffer, limit]) as Array<{
138
138
  file_path: string;