MCP Hub
Back to servers

Gitignore MCP Tool

A tool that generates customized .gitignore files by leveraging the gitignore.io API to combine templates for specific languages and environments.

Updated
Oct 30, 2025

Gitignore MCP Tool

A MCP server for generating .gitignore files using gitignore.io API

🌟 Features

  • Gitignore Generation: Generate .gitignore files
  • Template Listing: Browse all available gitignore templates

🛠️ Getting Started

Environment Variables

VariableDefaultDescription
GITIGNORE_API_BASEhttps://www.toptal.com/developers/gitignore/apiBase URL for gitignore.io API

Local Development

  • Install dependencies:
uv sync
  • (Optional) Set custom API endpoint:
export GITIGNORE_API_BASE="https://your-custom-api.com/api"
  • Run the MCP server:
uv run --with fastmcp fastmcp run mcp_tools/main.py

Docker

  • Build the Docker image:
docker build -t mcp-gitignore:latest .
  • Run the container:
docker run -i --rm -p 8000:8000 mcp-gitignore:latest
  • Run with custom API endpoint:
docker run -i --rm -p 8000:8000 -e GITIGNORE_API_BASE="https://your-custom-api.com/api" mcp-gitignore:latest
  • Run MCP Server:
{
  "mcpServers": {
    "mcp-gitignore": {
      "command": "docker",
      "args": [
        "run",
        "--rm",
        "-i",
        "-p",
        "8000:8000",
        "mcp-gitignore:latest"
      ],
      "env": {
        "GITIGNORE_API_BASE": "https://www.toptal.com/developers/gitignore/api"
      }
    }
  }
}

🎯 API Endpoints

List Templates

GET /gitignore/templates/

List all available gitignore templates.

Generate .gitignore

POST /gitignore/generate/

Generate .gitignore file based on templates.

Request Body:

{
  "templates": ["python", "visualstudiocode", "macos"],
  "output_path": ".gitignore"
}

📚 Documentation

  • Documentation is built using MkDocs and deployed to GitHub Pages.
  • To build the documentation locally:
chmod +x scripts/build_docs.sh
scripts/build_docs.sh
mkdocs build

Reviews

No reviews yet

Sign in to write a review

Gitignore MCP Tool — MCP Server | MCP Hub