Terragrunt Documentation MCP server

Provides direct access to Terragrunt documentation and GitHub issues through a Deno/TypeScript server that fetches content from the official repository with fuzzy matching and normalized responses.
Back to servers
Provider
Excoriate
Release date
Apr 22, 2025
Language
TypeScript
Stats
13 stars

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.

Installation

Prerequisites

  • Deno installed on your system
  • GitHub Personal Access Token

Install Deno

Follow the official Deno Installation Guide to install Deno on your system.

Set Up GitHub Token

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.

Installation Methods

Option 1: Run directly from JSR (recommended)

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]

Option 2: Clone the repository

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

Option 3: Use Docker

# 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

Usage

Available Tools

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.

Integration with Claude Desktop

To use this MCP server with Claude Desktop, add the appropriate configuration to your claude_desktop_config.json file:

Using Deno

{
  "mcpServers": {
    "terragrunt_docs": {
      "command": "deno",
      "args": [
        "run",
        "-A",
        "main.ts"
      ],
      "env": {
        "GITHUB_TOKEN": "<YOUR_TOKEN>"
      }
    }
  }
}

Using Docker

{
  "mcpServers": {
    "terragrunt_docs": {
      "command": "docker",
      "args": [
        "run",
        "-e", "GITHUB_TOKEN=<YOUR_TOKEN>", "mcp-terragrunt-docs"
      ],
      "env": {
        "GITHUB_TOKEN": "<YOUR_TOKEN>"
      }
    }
  }
}

Using JSR

{
  "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.

Example Usage Workflow

  1. First, use list-doc-categories to see available documentation categories
  2. Then use list-all-docs-by-category with your chosen category
  3. Finally, use read-document-from-category to access specific documentation

This enables your AI assistant to provide accurate information about Terragrunt when helping with your Infrastructure as Code projects.

How to add this MCP server to Cursor

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.

Adding an MCP server to Cursor globally

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"
            ]
        }
    }
}

Adding an MCP server to a project

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.

How to use the MCP server

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.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later