You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Feedback #1: Rebase required
"Large PRs need to be rebased onto current main before merging."
How addressed: The fork's main was force-reset to match jgravelle/jcodemunch-mcp:main at 971ae14. The
feat/dbt-sql-support branch (SQL language support) was cherry-picked cleanly onto upstream main as a separate branch.
This branch (feat-provider-context-encrichment) is also based on 971ae14.
---
Feedback #2: No opt-out path for context providers
"discover_providers() runs on every index_folder call... no way to disable this."
How addressed:
- src/jcodemunch_mcp/tools/index_folder.py — Added context_providers: bool = True parameter to index_folder(). When
False, or when JCODEMUNCH_CONTEXT_PROVIDERS=0 is set in the environment, provider discovery is skipped entirely — no
YAML parsing, no doc block scanning, no overhead. Renamed the internal variable from context_providers to
active_providers to avoid shadowing the new parameter.
- CONTEXT_PROVIDERS.md — Added a new "Disabling Context Providers" subsection documenting both the env var and
per-call parameter, including an MCP server config JSON example.
- README.md — Added JCODEMUNCH_CONTEXT_PROVIDERS row to the environment variables table.
- USER_GUIDE.md — Added bullet point for the env var in the Claude Desktop setup section.
---
Feedback #3: detect() sets instance state as a side effect
"If load() is called without detect(), it raises AttributeError."
How addressed:
- src/jcodemunch_mcp/parser/context/dbt.py — Initialized self._dbt_yml_path: Optional[Path] = None in __init__().
Added a guard at the top of load() that logs a warning and returns early if _dbt_yml_path is None.
---
Feedback #4: File context lookup by stem could false-match
"A file named schema.sql would match a dbt model named schema."
How addressed:
- src/jcodemunch_mcp/parser/context/dbt.py — Added _model_path_prefixes list, populated during load() with the
relative paths of the project's configured model-paths directories. Added _is_in_model_path() method.
get_file_context() now returns None immediately for files outside model directories, preventing false matches on files
like scripts/schema.sql or schema.sql at the project root.
- tests/test_dbt_provider.py — Added test_get_file_context_outside_model_path test verifying that files outside
models/ don't match even when the stem matches a model name (schema.sql, my_model.sql, scripts/my_model.sql), while
files inside models/ still match correctly. Updated test_get_file_context_by_stem to reflect the new path-scoped
behavior.
- CONTEXT_PROVIDERS.md — Added a "How It Matches Files" subsection to the dbt Provider docs explaining the stem + path
scoping strategy with examples. Updated the Terraform example's get_file_context comment to recommend path validation
before stem matching.
---
Feedback #5: bash.exe.stackdump in .gitignore
"Windows build artifact, not a project file."
How addressed:
- .gitignore — Removed the bash.exe.stackdump line.
---
Feedback #6: SQL_SPEC empty dicts
"Worth adding a pragma or docstring so future contributors don't try to fix it."
How addressed: Already addressed in the separate feat/dbt-sql-support branch. The SQL_SPEC in languages.py has a
multi-line comment explaining that the derekstride grammar has no named field accessors and pointing to
_parse_sql_symbols() in extractor.py where the actual extraction logic lives. No change needed on this branch.
---
Test results
- 481 passed, 4 skipped, 0 failures (one new test added)
Copy file name to clipboardExpand all lines: CONTEXT_PROVIDERS.md
+49-1Lines changed: 49 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -60,6 +60,17 @@ models:
60
60
61
61
Doc references (`{{ doc('name') }}`) are resolved automatically.
62
62
63
+
### How It Matches Files
64
+
65
+
The provider matches indexed files to dbt models by **file stem** (filename without extension), but only for files within the project's configured `model-paths` directories. This prevents false matches — for example, a `scripts/schema.sql` file will not be matched to a dbt model named `schema`, but `models/schema.sql` will.
66
+
67
+
```
68
+
models/fct_daily_revenue.sql ✓ matches model "fct_daily_revenue"
# Validate the file is within your tool's project directories
209
+
# before matching by stem, to avoid false positives
198
210
module =self._modules.get(Path(file_path).stem)
199
211
if module:
200
212
return FileContext(
@@ -260,6 +272,42 @@ Potential future providers for community contribution:
260
272
261
273
Context providers require no configuration — they activate automatically when their ecosystem is detected. Provider-specific optional dependencies (like `pyyaml` for dbt) should be installed separately.
262
274
275
+
### Disabling Context Providers
276
+
277
+
Context providers can be disabled globally via environment variable or per-call via parameter:
278
+
279
+
**Environment variable** — disables providers for all `index_folder` calls:
280
+
281
+
```bash
282
+
JCODEMUNCH_CONTEXT_PROVIDERS=0
283
+
```
284
+
285
+
In your MCP server config:
286
+
287
+
```json
288
+
{
289
+
"mcpServers": {
290
+
"jcodemunch": {
291
+
"command": "uvx",
292
+
"args": ["jcodemunch-mcp"],
293
+
"env": {
294
+
"JCODEMUNCH_CONTEXT_PROVIDERS": "0"
295
+
}
296
+
}
297
+
}
298
+
}
299
+
```
300
+
301
+
**Per-call parameter** — pass `context_providers: false` to `index_folder`:
0 commit comments