diff --git a/src/mcp.ts b/src/mcp.ts index ccef26e4..311a27b1 100644 --- a/src/mcp.ts +++ b/src/mcp.ts @@ -22,6 +22,7 @@ import { addLineNumbers, structuredSearch, DEFAULT_MULTI_GET_MAX_BYTES, + enableProductionMode, } from "./store.js"; import type { Store, StructuredSubSearch } from "./store.js"; import { getCollection, getGlobalContext, getDefaultCollectionNames } from "./collections.js"; @@ -542,6 +543,7 @@ Intent-aware lex (C++ performance, not sports): // ============================================================================= export async function startMcpServer(): Promise { + enableProductionMode(); const store = createStore(); const server = createMcpServer(store); const transport = new StdioServerTransport(); @@ -563,6 +565,7 @@ export type HttpServerHandle = { * Binds to localhost only. Returns a handle for shutdown and port discovery. */ export async function startMcpHttpServer(port: number, options?: { quiet?: boolean }): Promise { + enableProductionMode(); const store = createStore(); // Session map: each client gets its own McpServer + Transport pair (MCP spec requirement). diff --git a/src/store.ts b/src/store.ts index 4c7f8a0f..ed7ebae9 100644 --- a/src/store.ts +++ b/src/store.ts @@ -43,7 +43,7 @@ import { // Configuration // ============================================================================= -const HOME = process.env.HOME || "/tmp"; +const HOME = process.env.HOME || process.env.USERPROFILE || "/tmp"; export const DEFAULT_EMBED_MODEL = "embeddinggemma"; export const DEFAULT_RERANK_MODEL = "ExpedientFalcon/qwen3-reranker:0.6b-q8_0"; export const DEFAULT_QUERY_MODEL = "Qwen/Qwen3-1.7B";