Skip to content

prasannasahaj/contextify

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Contextify — GitLab Context MCP Server

A lightweight MCP (Model Context Protocol) server that exposes GitLab merge request data, commit diffs, and discussions to AI tools like Claude.

What It Does

Contextify wraps the GitLab API and exposes these MCP tools:

Tool Description
get_authenticated_user Get the authenticated GitLab user's info
get_merge_request_changes Full diff and metadata for a merge request
get_merge_request_commits Per-commit diffs for a merge request
get_merge_request_discussions Threaded comments and discussions on a merge request
get_commit_diff Diff for a specific commit

Quick Setup

1. Install dependencies

python -m venv venv
source venv/bin/activate
pip install -r requirements.txt

2. Configure GitLab token

Create a Personal Access Token with api, read_user, and read_repository scopes.

echo "GITLAB_PRIVATE_TOKEN=glpat-xxxxxxxxxxxxxxxxxxxx" > .env

3. Add to Claude Code

Add this to your .claude/settings.json (project or user-level):

{
  "mcpServers": {
    "gitlab-mcp": {
      "type": "stdio",
      "command": "python",
      "args": ["server.py"],
      "cwd": "/absolute/path/to/contextify"
    }
  }
}

Claude Code will automatically start and manage the server process.

Project Structure

app/
├── api/gitlab.py              # API endpoint definitions
├── client/gitlab_client.py    # GitLab HTTP client
├── core/config.py             # Settings & env vars
├── responses/                 # Pydantic response models
├── utils/formatters.py        # Diff parsing & formatting
└── main.py                    # FastAPI app
server.py                      # MCP server entry point

Running Tests

pytest

Pre-commit Hooks

pre-commit install

Runs Ruff (lint + format), syntax checks, and pytest before each commit.

About

An MCP server that allows AI coding assistants to fetch MR details and code changes from Gitlab. It assists in gaining context and reviewing MRs

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 100.0%