-
Notifications
You must be signed in to change notification settings - Fork 209
Expanded Context Providers
Index and search infrastructure files the same way you index code — paths, schemas, resources, RPCs all become first-class symbols.
Terraform configs, Protobuf definitions, and OpenAPI specs describe your system as precisely as source code does — but most code search tools treat them as plain text. jcodemunch-mcp v1.3.9 adds first-class symbol extraction for all three formats, so search_symbols, get_file_outline, and get_context_bundle work on .tf, .proto, and openapi.yaml files exactly like they work on .py or .go.
Symbols extracted: HCL resource/variable/output/module blocks, Protobuf message/service/rpc/enum nodes (with nested scope), and OpenAPI path operations (GET /users) plus component schemas.
If you've ever grepped through a Terraform repo for "which bucket does this Lambda write to?" or searched a .proto file for a specific RPC — you now get ranked, token-efficient symbol search instead of a raw text scan.
| Provider | File extensions | Symbols extracted | Kind mapping |
|---|---|---|---|
| Protobuf | .proto |
message, enum, service, rpc, extend
|
class, type, class, method
|
| Terraform / HCL |
.tf, .hcl, .tfvars
|
resource, data, module, variable, output, provider, terraform
|
class / constant / type
|
| OpenAPI v3 |
openapi.yaml, .openapi.yaml, .swagger.yaml
|
Path operations (GET /path) + components/schemas
|
function, type
|
| Swagger v2 |
swagger.json, .swagger.json
|
Path operations + definitions
|
function, type
|
OpenAPI file detection (priority order):
- Well-known basenames:
openapi.yaml,swagger.json,openapi.yml, etc. - Compound extensions:
.openapi.yaml,.swagger.json
Plain .yaml files are never mis-classified — the parser validates an openapi, swagger, or paths key before extracting anything.
Protobuf and HCL use tree-sitter grammars from tree-sitter-language-pack. OpenAPI uses pyyaml (now a core dependency) for YAML and stdlib json for JSON files.
{
"tool": "search_symbols",
"arguments": {
"repo": "my-org/my-service",
"query": "CreateUser",
"language": "proto"
}
}{
"tool": "search_symbols",
"arguments": {
"repo": "my-org/infra",
"query": "s3 bucket",
"language": "hcl"
}
}{
"tool": "search_symbols",
"arguments": {
"repo": "my-org/api",
"query": "GET /users",
"language": "openapi"
}
}Protobuf — nested scope preserved:
[
{ "kind": "class", "name": "User", "signature": "message User" },
{ "kind": "class", "name": "Address", "signature": "message Address", "qualified_name": "User.Address" },
{ "kind": "class", "name": "UserService", "signature": "service UserService" },
{ "kind": "method", "name": "GetUser", "signature": "rpc GetUser", "qualified_name": "UserService.GetUser" }
]HCL / Terraform — block type folded into name:
[
{ "kind": "class", "name": "aws_s3_bucket.my_bucket", "signature": "resource \"aws_s3_bucket\" \"my_bucket\"" },
{ "kind": "constant", "name": "region", "signature": "variable \"region\"" },
{ "kind": "constant", "name": "bucket_arn", "signature": "output \"bucket_arn\"" }
]OpenAPI — HTTP method + path as symbol name:
[
{ "kind": "function", "name": "GET /pets", "signature": "GET /pets # listPets" },
{ "kind": "function", "name": "POST /pets/{petId}", "signature": "POST /pets/{petId} # createPet" },
{ "kind": "type", "name": "Pet", "signature": "schema Pet" },
{ "kind": "type", "name": "PetId", "signature": "schema PetId: string" }
]-
src/jcodemunch_mcp/parser/languages.py—OPENAPI_SPECadded; compound extensions (.openapi.yaml,.swagger.json, …) and_OPENAPI_BASENAMESfrozenset registered;get_language_for_pathupdated with basename-first detection;"openapi"added toLANGUAGE_REGISTRY. -
src/jcodemunch_mcp/parser/extractor.py—_parse_openapi_symbols()added (YAML/JSON parsing, path operation + schema extraction, line-accurate byte offsets); dispatch added toparse_file. -
src/jcodemunch_mcp/server.py—"openapi"added to thelanguageenum insearch_symbols. -
pyproject.toml—pyyaml>=6.0promoted from optional to core dependency; version bumped to1.3.9.
The jMRI retrieval spec defines provider-agnostic symbol retrieval — these additions extend jcodemunch-mcp's coverage from general-purpose code into the infrastructure and API-contract layer. Helm chart support is the natural next step once a Helm-specific schema key detection strategy is established.
jcodemunch-mcp on GitHub · 900+ stars