feat(mcp): pass YAML config path to createStore for model resolution
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
c8d49d26da
commit
ce0cd64409
@ -18,6 +18,7 @@ import { WebStandardStreamableHTTPServerTransport }
|
||||
from "@modelcontextprotocol/sdk/server/webStandardStreamableHttp.js";
|
||||
import { isInitializeRequest } from "@modelcontextprotocol/sdk/types.js";
|
||||
import { z } from "zod";
|
||||
import { existsSync } from "fs";
|
||||
import {
|
||||
createStore,
|
||||
extractSnippet,
|
||||
@ -28,6 +29,7 @@ import {
|
||||
type ExpandedQuery,
|
||||
type IndexStatus,
|
||||
} from "../index.js";
|
||||
import { getConfigPath } from "../collections.js";
|
||||
|
||||
// =============================================================================
|
||||
// Types for structured content
|
||||
@ -536,7 +538,11 @@ Intent-aware lex (C++ performance, not sports):
|
||||
// =============================================================================
|
||||
|
||||
export async function startMcpServer(): Promise<void> {
|
||||
const store = await createStore({ dbPath: getDefaultDbPath() });
|
||||
const configPath = getConfigPath();
|
||||
const store = await createStore({
|
||||
dbPath: getDefaultDbPath(),
|
||||
...(existsSync(configPath) ? { configPath } : {}),
|
||||
});
|
||||
const server = await createMcpServer(store);
|
||||
const transport = new StdioServerTransport();
|
||||
await server.connect(transport);
|
||||
@ -557,7 +563,11 @@ 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<HttpServerHandle> {
|
||||
const store = await createStore({ dbPath: getDefaultDbPath() });
|
||||
const configPath = getConfigPath();
|
||||
const store = await createStore({
|
||||
dbPath: getDefaultDbPath(),
|
||||
...(existsSync(configPath) ? { configPath } : {}),
|
||||
});
|
||||
|
||||
// Pre-fetch default collection names for REST endpoint
|
||||
const defaultCollectionNames = await store.getDefaultCollectionNames();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user