{
  "markdown": "# Git MCP Server\n\nA clean, modular Git MCP server supporting both GitHub and GitLab.\n\n## Quick Start\n\n### Claude Desktop Configuration\n\nAdd to your `claude_desktop_config.json`:\n\n**macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`\n**Windows**: `%APPDATA%\\Claude\\claude_desktop_config.json`\n\n#### GitHub\n\n```json\n{\n  \"mcpServers\": {\n    \"git\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@raytien/git-mcp-server\"],\n      \"env\": {\n        \"GIT_PROVIDER\": \"github\",\n        \"GIT_TOKEN\": \"ghp_xxxxxxxxxxxxxxxxxxxx\"\n      }\n    }\n  }\n}\n```\n\n#### GitHub Enterprise\n\n```json\n{\n  \"mcpServers\": {\n    \"git\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@raytien/git-mcp-server\"],\n      \"env\": {\n        \"GIT_PROVIDER\": \"github\",\n        \"GIT_API_URL\": \"https://github.your-company.com/api/v3\",\n        \"GIT_TOKEN\": \"ghp_xxxxxxxxxxxxxxxxxxxx\"\n      }\n    }\n  }\n}\n```\n\n#### GitLab.com (SaaS)\n\n```json\n{\n  \"mcpServers\": {\n    \"git\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@raytien/git-mcp-server\"],\n      \"env\": {\n        \"GIT_PROVIDER\": \"gitlab\",\n        \"GIT_TOKEN\": \"glpat-xxxxxxxxxxxxxxxxxxxx\"\n      }\n    }\n  }\n}\n```\n\n#### Self-Hosted GitLab\n\n```json\n{\n  \"mcpServers\": {\n    \"git\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@raytien/git-mcp-server\"],\n      \"env\": {\n        \"GIT_PROVIDER\": \"gitlab\",\n        \"GIT_API_URL\": \"https://gitlab.your-company.com/api/v4\",\n        \"GIT_TOKEN\": \"glpat-xxxxxxxxxxxxxxxxxxxx\"\n      }\n    }\n  }\n}\n```\n\n#### Read-Only Mode\n\n```json\n{\n  \"mcpServers\": {\n    \"git\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@raytien/git-mcp-server\"],\n      \"env\": {\n        \"GIT_PROVIDER\": \"github\",\n        \"GIT_TOKEN\": \"ghp_xxxxxxxxxxxxxxxxxxxx\",\n        \"GIT_READ_ONLY\": \"true\"\n      }\n    }\n  }\n}\n```\n\n### Get Your Token\n\n#### GitHub\n1. Go to GitHub > Settings > Developer settings > Personal access tokens > Tokens (classic)\n2. Generate new token with scopes: `repo`, `read:org`, `workflow`\n3. Copy the token (starts with `ghp_`)\n\n#### GitLab\n1. Go to GitLab > Settings > Access Tokens\n2. Create a new token with scopes: `api`, `read_api`, `read_repository`, `write_repository`\n3. Copy the token (starts with `glpat-`)\n\n## Available Tools\n\n### Repository\n\n| Tool                  | Description                          |\n| --------------------- | ------------------------------------ |\n| `get_file_contents`   | Read file content from repository    |\n| `get_repository_tree` | List directory structure             |\n| `push_files`          | Push file changes in a single commit |\n| `create_branch`       | Create a new branch                  |\n| `list_branches`       | List repository branches             |\n| `list_commits`        | List commit history                  |\n| `search_code`         | Search for code in repository        |\n\n### Issues\n\n| Tool           | Description        |\n| -------------- | ------------------ |\n| `get_issue`    | Get a single issue |\n| `list_issues`  | List issues        |\n| `create_issue` | Create a new issue |\n| `update_issue` | Update an issue    |\n\n### Pull/Merge Requests\n\n| Tool                     | Description               |\n| ------------------------ | ------------------------- |\n| `get_pull_request`       | Get a merge request       |\n| `list_pull_requests`     | List merge requests       |\n| `create_pull_request`    | Create a merge request    |\n| `get_pull_request_diffs` | Get merge request changes |\n| `merge_pull_request`     | Merge a merge request     |\n\n### CI/CD (Pipelines / Workflow Runs)\n\n| Tool                 | Description                                    |\n| -------------------- | ---------------------------------------------- |\n| `get_pipeline`       | Get pipeline/workflow run status               |\n| `list_pipelines`     | List pipelines/workflow runs                   |\n| `list_pipeline_jobs` | List pipeline jobs/workflow jobs               |\n| `get_job_log`        | Get job log output                             |\n\n> Note: GitHub Actions workflow runs map to GitLab pipelines. The same tools work for both platforms.\n\n### Comments\n\n| Tool             | Description             |\n| ---------------- | ----------------------- |\n| `create_comment` | Add comment to issue/MR |\n| `list_comments`  | List comments           |\n\n### Users\n\n| Tool     | Description                    |\n| -------- | ------------------------------ |\n| `get_me` | Get current authenticated user |\n\n## Configuration\n\n| Environment Variable | Required | Default          | Description                                 |\n| -------------------- | -------- | ---------------- | ------------------------------------------- |\n| `GIT_PROVIDER`       | No       | `gitlab`         | Provider type: `gitlab` or `github`         |\n| `GIT_TOKEN`          | Yes      | -                | Personal Access Token                       |\n| `GIT_API_URL`        | No       | Provider default | API URL (auto-detected from provider)       |\n| `GIT_AUTH_TYPE`      | No       | `bearer`         | Auth type: `bearer` or `private-token`      |\n| `GIT_READ_ONLY`      | No       | `false`          | Disable write operations                    |\n| `LOG_LEVEL`          | No       | `info`           | Log level: `debug`, `info`, `warn`, `error` |\n\n## Architecture\n\n```\nsrc/\n├── index.ts              # Entry point\n├── server.ts             # MCP server (provider-agnostic)\n├── config.ts             # Configuration (multi-provider)\n├── providers/            # Platform abstraction\n│   ├── interface.ts      # GitProvider interface\n│   ├── types.ts          # Platform-agnostic types\n│   ├── config.ts         # Provider configuration\n│   ├── factory.ts        # Provider Factory (creates GitLab/GitHub)\n│   ├── gitlab/           # GitLab implementation\n│   └── github/           # GitHub implementation\n├── tools/                # Tool definitions\n│   ├── define.ts         # defineTool helper\n│   ├── registry.ts       # Tool registry\n│   ├── repository/       # Repository tools\n│   ├── issues/           # Issue tools\n│   ├── merge-requests/   # PR/MR tools\n│   ├── pipelines/        # CI/CD tools\n│   ├── notes/            # Comment tools\n│   └── users/            # User tools\n├── gitlab/               # GitLab API client\n│   ├── client.ts         # HTTP client\n│   └── types.ts          # GitLab API types\n├── github/               # GitHub API client\n│   ├── client.ts         # HTTP client\n│   └── types.ts          # GitHub API types\n├── auth/                 # Authentication\n└── lib/                  # Utilities\n```\n\n## Development\n\n```bash\n# Install dependencies\nnpm install\n\n# Build\nnpm run build\n\n# Run tests\nnpm test\n\n# Run locally\nnpm start\n\n# Development mode (watch)\nnpm run dev\n```\n\n## Adding a New Tool\n\n1. Create file: `src/tools/{category}/{action}.ts`\n\n```typescript\nimport { z } from 'zod';\nimport { defineTool, repoParam } from '../define.js';\n\nconst schema = z.object({\n    repo: repoParam,\n    // ... your params\n});\n\nexport const myTool = defineTool({\n    name: 'my_tool',\n    description: 'What this tool does',\n    schema,\n    category: 'my-category',\n    read_only: true,\n    handler: async (input, ctx) => {\n        return ctx.provider.repository.someMethod(input.repo, ...);\n    },\n});\n```\n\n2. Export from category index: `src/tools/{category}/index.ts`\n3. Add to allTools: `src/tools/index.ts`\n\n## Inspired By\n\n- [gitlab-mcp](https://github.com/zereight/gitlab-mcp) - GitLab MCP server\n- [github-mcp-server](https://github.com/github/github-mcp-server) - Official GitHub MCP server\n\n## License\n\nMIT\n",
  "bytes": 7543,
  "sha": "98fdb20c26025ba747c8860c911c1aece7be84c382ab0da6b67214cde95634ae",
  "repo_slug": "ray0907/git-mcp-server",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_ray0907_git_mcp_server_65696f6e/readme"
}