Skip to content

Commit 96c843d

Browse files
committed
Remove enable_retrieval flag — always attempt vtk-index on startup
Retrieval is silently skipped on ImportError (vtk-index not installed) or any other init failure, so a separate toggle adds no value. Also drop enable_cpp_scraping (no scraping tools remain).
1 parent 138455a commit 96c843d

5 files changed

Lines changed: 21 additions & 35 deletions

File tree

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@ Key environment variables:
4343
|---|---|---|
4444
| `VTK_MCP_VTK_VERSION` | `9.3.0` | VTK version to fetch artifacts for |
4545
| `VTK_MCP_KNOWLEDGE_ARTIFACT_PATH` | _(auto)_ | Local JSONL path; skips auto-download |
46-
| `VTK_MCP_ENABLE_RETRIEVAL` | `false` | Enable vtk-index semantic search |
47-
| `VTK_MCP_QDRANT_URL` | _(auto)_ | Qdrant URL; if unset uses embedded storage |
46+
| `VTK_MCP_QDRANT_URL` | _(auto)_ | Qdrant server URL; if unset uses embedded storage from ghcr.io |
4847
| `VTK_MCP_ENABLE_VALIDATION` | `true` | Enable vtk-validate code validation |
4948
| `VTK_MCP_TRANSPORT` | `stdio` | `stdio` or `http` |
5049

deploy.Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ ENV VTK_MCP_TRANSPORT=http
4141
ENV VTK_MCP_HTTP_HOST=0.0.0.0
4242
ENV VTK_MCP_HTTP_PORT=8000
4343
ENV VTK_MCP_ENABLE_VALIDATION=true
44-
ENV VTK_MCP_ENABLE_RETRIEVAL=true
4544

4645
EXPOSE 8000
4746

src/vtk_mcp/composition.py

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -43,29 +43,25 @@ def __init__(self, settings: Settings) -> None:
4343
self.api_index.vtk_version,
4444
)
4545

46-
# Layer 2: retrieval (optional)
46+
# Layer 2: retrieval — always attempted; stays None if vtk-index not installed
4747
self.retriever = None
48-
if settings.enable_retrieval:
49-
try:
50-
from vtk_index import Retriever
51-
52-
if settings.qdrant_url:
53-
# Connect to a running Qdrant server
54-
self.retriever = Retriever(
55-
qdrant_url=settings.qdrant_url,
56-
vtk_version=self.api_index.vtk_version,
57-
)
58-
logger.info("Retriever connected to %s", settings.qdrant_url)
59-
else:
60-
# Download pre-built embedded storage (no server required)
61-
logger.info(
62-
"Downloading embedded Qdrant storage for VTK %s",
63-
self.api_index.vtk_version,
64-
)
65-
self.retriever = Retriever.from_artifact(self.api_index.vtk_version)
66-
logger.info("Retriever ready (embedded storage)")
67-
except Exception as exc:
68-
logger.warning("Retrieval disabled: %s", exc)
48+
try:
49+
from vtk_index import Retriever
50+
51+
if settings.qdrant_url:
52+
self.retriever = Retriever(
53+
qdrant_url=settings.qdrant_url,
54+
vtk_version=self.api_index.vtk_version,
55+
)
56+
logger.info("Retriever connected to %s", settings.qdrant_url)
57+
else:
58+
logger.info("Downloading embedded Qdrant storage for VTK %s", self.api_index.vtk_version)
59+
self.retriever = Retriever.from_artifact(self.api_index.vtk_version)
60+
logger.info("Retriever ready (embedded storage)")
61+
except ImportError:
62+
logger.info("vtk-index not installed — vector search unavailable")
63+
except Exception as exc:
64+
logger.warning("Retriever init failed: %s", exc)
6965

7066
# Layer 3: validation (optional — library call, no subprocess)
7167
self.validate = None

src/vtk_mcp/config.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,8 @@ class Settings(BaseSettings):
1616
knowledge_artifact_path: Optional[Path] = None
1717
vtk_version: str = "9.3.0"
1818

19-
# Layer 2 — retrieval
20-
# When enable_retrieval is True and vtk_version is set, uses Retriever.from_artifact()
21-
# which downloads pre-built embedded Qdrant storage (no server required).
22-
# Set qdrant_url to a real Qdrant instance to use a server instead.
23-
enable_retrieval: bool = False
19+
# Layer 2 — retrieval (always attempted; silently disabled if vtk-index not installed)
20+
# Set qdrant_url to a running Qdrant server; if unset, uses embedded storage from ghcr.io.
2421
qdrant_url: Optional[str] = None
2522

2623
# Layer 3 — validation
@@ -31,9 +28,5 @@ class Settings(BaseSettings):
3128
http_host: str = "0.0.0.0"
3229
http_port: int = 8000
3330

34-
# C++ docs scraping
35-
enable_cpp_scraping: bool = True
36-
vtk_docs_base_url: str = "https://vtk.org/doc/nightly/html/"
37-
3831
class Config:
3932
env_prefix = "VTK_MCP_"

tests/test_tools.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ def ctx():
5454

5555
settings = Settings(
5656
knowledge_artifact_path=None,
57-
enable_retrieval=False,
5857
enable_validation=True,
5958
)
6059

0 commit comments

Comments
 (0)