The MCP Terragrunt Docs Provider is a Model Context Protocol server built with Deno and TypeScript that provides contextual information about Terragrunt documentation and related GitHub issues. This tool helps improve AI assistance for Terragrunt development by providing accurate, up-to-date documentation and issue information to AI models.
Follow the official Deno Installation Guide to install Deno on your system.
Before running the server, you need to set your GitHub token as an environment variable:
Unix/macOS:
export GITHUB_TOKEN=ghp_xxx...
Windows (cmd):
set GITHUB_TOKEN=ghp_xxx...
You can also set the token in a .env
file in the project directory.
The simplest way to use the MCP server is to run it directly from JavaScript Registry (JSR):
# Set your GitHub token
export GITHUB_TOKEN=ghp_xxx...
# Run the server
deno run -A jsr:@excoriate/[email protected]
git clone https://github.com/Excoriate/mcp-terragrunt-docs.git
cd mcp-terragrunt-docs
# Run using Deno
deno run -A main.ts
# Or use the justfile if available
just run
# For debugging
just inspect
# Build the Docker image
docker build -t mcp-terragrunt-docs .
# Run the container
docker run -it --rm -e GITHUB_TOKEN=ghp_xxx... mcp-terragrunt-docs
The MCP server provides the following tools that you can use to query Terragrunt documentation:
Tool Name | Purpose | Inputs | Use Case |
---|---|---|---|
list-doc-categories |
Get all documentation categories | None | Use to explore the available documentation structure |
list-all-docs-by-category |
List docs in a specific category | category (string) |
Use to see all available docs within a category |
read-document-from-category |
Read a specific document | category (string), document (string) |
Use to access a specific document's content |
read-all-docs-from-category |
Get all docs in a category | category (string) |
Use for a comprehensive view of all docs in a category |
get-all-open-issues |
Get open issues from GitHub | all (boolean, optional) |
Use to track current issues in the Terragrunt project |
Note: All tools require a valid GitHub token to be set as an environment variable.
To use this MCP server with Claude Desktop, add the appropriate configuration to your claude_desktop_config.json
file:
{
"mcpServers": {
"terragrunt_docs": {
"command": "deno",
"args": [
"run",
"-A",
"main.ts"
],
"env": {
"GITHUB_TOKEN": "<YOUR_TOKEN>"
}
}
}
}
{
"mcpServers": {
"terragrunt_docs": {
"command": "docker",
"args": [
"run",
"-e", "GITHUB_TOKEN=<YOUR_TOKEN>", "mcp-terragrunt-docs"
],
"env": {
"GITHUB_TOKEN": "<YOUR_TOKEN>"
}
}
}
}
{
"mcpServers": {
"terragrunt_docs": {
"command": "deno",
"args": [
"run",
"-A",
"jsr:@excoriate/[email protected]"
],
"env": {
"GITHUB_TOKEN": "<YOUR_TOKEN>"
}
}
}
}
Remember to replace <YOUR_TOKEN>
with your actual GitHub Personal Access Token in all examples.
list-doc-categories
to see available documentation categorieslist-all-docs-by-category
with your chosen categoryread-document-from-category
to access specific documentationThis enables your AI assistant to provide accurate information about Terragrunt when helping with your Infrastructure as Code projects.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.