Skip to content

Commit 2a6e6b8

Browse files
author
Zhe Yu
committed
fix(cli): Remove all references to chromadb-related APIs.
1 parent d6dc9bf commit 2a6e6b8

1 file changed

Lines changed: 5 additions & 24 deletions

File tree

src/vectorcode/mcp_main.py

Lines changed: 5 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131

3232
from vectorcode.cli_utils import (
3333
Config,
34-
LockManager,
3534
SpecResolver,
3635
config_logging,
3736
expand_globs,
@@ -40,9 +39,6 @@
4039
get_project_config,
4140
load_config_file,
4241
)
43-
from vectorcode.common import (
44-
ClientManager,
45-
)
4642
from vectorcode.subcommands.prompt import prompt_by_categories
4743
from vectorcode.subcommands.query import (
4844
_prepare_formatted_result,
@@ -51,7 +47,6 @@
5147
)
5248

5349
logger = logging.getLogger(name=__name__)
54-
locks = LockManager()
5550

5651

5752
@dataclass
@@ -246,24 +241,11 @@ async def mcp_server():
246241
default_project_root = project_root
247242
default_config = await get_project_config(project_root)
248243
default_config.project_root = project_root
249-
async with ClientManager().get_client(default_config) as client:
250-
logger.info("Collection initialised for %s.", project_root)
251-
252-
if client is None:
253-
if mcp_config.ls_on_start: # pragma: nocover
254-
logger.warning(
255-
"Failed to initialise a chromadb client. Ignoring --ls-on-start flag."
256-
)
257-
else:
258-
if mcp_config.ls_on_start:
259-
logger.info(
260-
"Adding available collections to the server instructions."
261-
)
262-
default_instructions += (
263-
"\nYou have access to the following collections:\n"
264-
)
265-
for name in await list_collections():
266-
default_instructions += f"<collection>{name}</collection>"
244+
if mcp_config.ls_on_start:
245+
logger.info("Adding available collections to the server instructions.")
246+
default_instructions += "\nYou have access to the following collections:\n"
247+
for name in await list_collections():
248+
default_instructions += f"<collection>{name}</collection>"
267249

268250
mcp = FastMCP("VectorCode", instructions=default_instructions)
269251
mcp.add_tool(
@@ -316,7 +298,6 @@ async def run_server(): # pragma: nocover
316298
mcp = await mcp_server()
317299
await mcp.run_stdio_async()
318300
finally:
319-
await ClientManager().kill_servers()
320301
return 0
321302

322303

0 commit comments

Comments
 (0)