Gitignore MCP Tool
<div align="center">
<h1> Gitignore MCP Tool </h1>
</div>
> 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
| Variable | Default | Description |
| -------------------- | ------------------------------------------------- | ----------------------------- |
| `GITIGNORE_API_BASE` | `https://www.toptal.com/developers/gitignore/api` | Base URL for gitignore.io API |
### Local Development
- Install dependencies:
```bash
uv sync
```
- (Optional) Set custom API endpoint:
```bash
export GITIGNORE_API_BASE="https://your-custom-api.com/api"
```
- Run the MCP server:
```bash
uv run --with fastmcp fastmcp run mcp_tools/main.py
```
### Docker
- Build the Docker image:
```bash
docker build -t mcp-gitignore:latest .
```
- Run the container:
```bash
docker run -i --rm -p 8000:8000 mcp-gitignore:latest
```
- Run with custom API endpoint:
```bash
docker run -i --rm -p 8000:8000 -e GITIGNORE_API_BASE="https://your-custom-api.com/api" mcp-gitignore:latest
```
- Run MCP Server:
```json
{
"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:**
```json
{
"templates": ["python", "visualstudiocode", "macos"],
"output_path": ".gitignore"
}
```
## 📚 Documentation
- Documentation is built using MkDocs and deployed to GitHub Pages.
- To build the documentation locally:
```bash
chmod +x scripts/build_docs.sh
scripts/build_docs.sh
mkdocs build
```
TDQS
Scored across 2 tools
The two tools have completely distinct purposes with no overlap. 'generate_gitignore' creates a file based on templates, while 'list_gitignore_templates' provides the available template list. An agent would never confuse these tools as they serve different stages of the workflow.
Both tools follow a perfect verb_noun pattern with consistent snake_case naming. 'generate_gitignore' and 'list_gitignore_templates' use clear, descriptive verbs that match their actions, creating a predictable naming convention throughout the tool set.
With only 2 tools, this server feels under-scoped for a gitignore management system. While the tools cover basic functionality, there are obvious missing operations like updating existing gitignore files, deleting them, or managing custom templates that would make the surface more complete.
The tools provide core read and generate functionality but lack full lifecycle coverage. There's no way to update or delete generated gitignore files, and while templates can be listed, there's no ability to manage them. The surface covers basic workflows but leaves significant gaps for more complex scenarios.