query_modulesLABSCO SUMMARY
Reading the modules is half of it; reading the callers is the other half.
Plenty of tools can index module source. What is unusual here is indexing consumer repositories too, so the answer to "how do we tag things" comes from what your teams actually wrote rather than from the module's documentation. Two things to settle before adopting: the licence is BUSL 1.1, so production use is a commercial conversation, and authentication is disabled by default — turn it on before the instance is reachable by anyone else.
What it is
A knowledge base over your Terraform module repositories. It clones them, parses every HCL file, embeds the results into PostgreSQL with pgvector, and then indexes consumer repositories to learn how the modules are really used — naming, variables, tagging, layout. The MCP endpoint puts that base in front of an agent.
What you get
- Nine tools —
query_modules,pick_modules,list_modules,get_module_details,get_dependencies,get_module_usage,find_similar_usages,fetch_example_code,get_stats list_modulesalso takes asemantic_queryfor natural-language search rather than exact namesget_dependencieswalks the dependency tree using PostgreSQL recursive CTEs, so you can trace what depends on whatget_module_usageandfind_similar_usagesanswer 'how do we normally call this' from real consumer code- A knowledge layer distils conventions across six dimensions — naming, variables, tagging, layout, versions and deployment — and treats them as authoritative in prompts
- Version tracking through automatic git tag discovery, with code-hash caching so re-indexing does not repeat LLM and embedding calls
- A full audit trail of LLM, MCP and API calls
Requirements
You host it. git clone, cp .env.example .env, set POSTGRES_PASSWORD, JWT_SECRET and an LLM API key, then docker compose up -d — the frontend on port 3000, the API on port 8000, the MCP endpoint at http://localhost:8000/mcp/. Index a repository by POSTing its repo_url and branch to /index/; private repos need an SSH deploy key at ./worker_deploy_key or a path in SSH_KEY_PATH. The LLM backend is your choice — Anthropic directly or through Bedrock, OpenRouter, Ollama, or any OpenAI-compatible endpoint, selected with LLM_BASE_URL and LLM_MODEL. Authentication is off by default, with local email/password plus JWT or ALB-terminated SSO as alternatives. Licensed under BUSL 1.1: non-production use is permitted, production use needs a commercial licence until it converts to AGPL-3.0 in 2029.
Setup effort
Run a container — build the image from the repository, then point your client at it
USE CASES
Finding the module for a job you have not done before
Search by what you are trying to build rather than by module name.
Calling a module the way your team calls it
Pull real usage from consumer repos instead of guessing variable names from the docs.
Working out the blast radius of a change
Trace the dependency tree to see what breaks if this module changes.
Auditing an existing configuration
Compare what a repo does against the conventions distilled from the rest of the estate.
9 tools
Listed in project docs. Your client may show a different list.
pick_moduleslist_modulesget_module_detailsget_dependenciesget_module_usagefind_similar_usagesfetch_example_codeget_statsBEFORE YOU INSTALL
What to know first
Tools you get
9 tools named in the project's documentation.
Requires
Docker with Docker Compose
Where it runs
Of the 2 documented clients, 1 runs the server on your machine and 1 connects to a hosted endpoint.
INSTALLATION
Connect your client
Server setup
git clone https://github.com/krzysztofgawrys/rag-for-terraform.git
cd rag-for-terraform
cp .env.example .envEdit .env - set POSTGRES_PASSWORD, JWT_SECRET, and your LLM API key
docker compose up -dIndex a repo: POST http://localhost:8000/index/ with {"repo_url": ..., "branch": "main"}
Point your MCP client at http://localhost:8000/mcp/ (Streamable HTTP)
MCP Clients
Claude Code
{
"mcpServers": {
"terraform-rag": {
"type": "http",
"url": "http://localhost:8000/mcp/"
}
}
}Any MCP client — hosted demo
The project's public demo, read-only, over the 2,700+ public modules it has indexed, with the shared demo key the README publishes. To search your own modules, run your own instance and use the Claude Code block.
{
"mcpServers": {
"terraform-rag": {
"type": "http",
"url": "https://terraform-rag.io/mcp",
"headers": {
"Authorization": "Bearer trag_6c495d7a027369cb5d324d877626c272"
}
}
}
}