MCP Servers

A collection of Model Context Protocol servers, templates, tools and more.

Gitea MCP Server is an integration plugin designed to connect Gitea with Model Context Protocol (MCP) systems. This allows for seamless command execution and repository management through an MCP-compatible chat interface.

Created 2/24/2026
Updated about 9 hours ago
Repository documentation and setup instructions

Gitea MCP Server

A Model Context Protocol (MCP) server for reviewing Gitea pull requests.

Quick Start

1. Build the Server

dotnet build

2. Set Environment Variables

  • Generate gitea private token with read/write access.
  • Add token and root link in to Environmental variable (GITEA_BASE_URL, GITEA_TOKEN) image

[or]

# Set your Gitea instance URL (without trailing slash)
$env:GITEA_BASE_URL = "https://your-gitea-instance.com"

# Set your Gitea personal access token (with repo read/write permissions)
$env:GITEA_TOKEN = "your-token-here"

3. Run Manual Test

Test the server directly using PowerShell:

# Navigate to project directory
cd d:\Projects\GiteaMcpServer

# Run the test script
.\test-mcp.ps1

Available Tools

Tools

The server exposes the following tools via MCP tools.list / tools.call.

  • list_pull_requests — List pull requests in a repository.

    • Parameters: owner (string, optional), repo (string, optional), repository (string, optional, "owner/repo"), state (string, default "open"), summary (bool, default true), per_page (int, default 50), base_url (string, optional).
  • get_pull_request_diff — Get the unified diff for a PR.

    • Parameters: owner (string), repo (string), pr_number (integer), base_url (string, optional).
  • get_pull_request_description — Return PR title and description. If the PR body is empty, falls back to the author's first comment.

    • Parameters: owner (string), repo (string), pr_number (integer), base_url (string, optional).
  • add_pull_request_comment — Add a general comment to a PR (issue comment).

    • Parameters: owner (string), repo (string), pr_number (integer), body (string), base_url (string, optional).
  • add_pull_request_inline_comment — Add an inline code review comment at a specific file and line. If the Gitea instance does not support inline PR comments, the server falls back to posting an issue comment that includes the file and line context.

    • Parameters: owner, repo, pr_number, body, path, line (all required); optional position, commit_id, base_url.
  • manage_pull_request_labels — Add, remove, or replace labels on a PR (issue).

    • Parameters: owner, repo, pr_number (required); add_labels (array of strings), remove_labels (array of strings), set_labels (array of strings), base_url (optional).
  • list_org_labels — List labels defined for an organization or repository (useful to pick labels when updating PRs).

    • Parameters: owner (organization/owner, required), optional repo (string) to list repo labels instead, base_url (optional).
  • create_branch — Create a branch in the repository (from a base branch or default branch).

    • Parameters: owner, repo, new_branch (required); optional base_branch, base_url.
  • commit_files — Commit one or more files to a branch. Each file must be provided with path and content (UTF-8 plain text); the server will create or update the files.

    • Parameters: owner, repo, branch, commit_message, files (array of objects with path + content), base_url (optional).

Use these tools together to inspect PRs, post suggestions (inline or general comments), modify labels, create branches and push small patch commits so suggested fixes can be reviewed.

Configuration for MCP Clients

Claude Desktop Configuration

Add to your Claude Desktop config file (%APPDATA%\Claude\claude_desktop_config.json):

{
  "mcpServers": {
    "gitea": {
      "command": "dotnet",
      "args": [
        "run",
        "--project",
        "d:\\Projects\\GiteaMcpServer\\GiteaMcpServer.csproj"
      ],
      "env": {
        "GITEA_BASE_URL": "https://your-gitea-instance.com",
        "GITEA_TOKEN": "your-token-here"
      }
    }
  }
}

Code Studio / Cline Configuration

See the document .help

  • Build and deploy the project at you local machine, take exe path.
  • At codestudio Chat -> settings -> MCP Servers -> Custom Servers -> + Add Custom Server
  • Paste ..\GiteaMcpServer\bin\debug\GiteaMcpServer.exe, Name the server. the below file will generate.
{
	"servers": {
		"Gitea_MCP_server": {
			"type": "stdio",
			"command": "D:\\MCPServer\\GiteaMCPServer\\GiteaMCPServer2_0\\bin\\Debug\\net10.0\\GiteaMCPServer2_0.exe",
			"args": []
		}
	},
	"inputs": []
}

Testing Tips

  1. Check Environment Variables: Ensure GITEA_BASE_URL and GITEA_TOKEN are set correctly
  2. Verify Token Permissions: Your token needs read access for listing PRs and diffs, write access for comments
  3. Check Gitea API Version: This server is tested with Gitea v1.x API
  4. Monitor Logs: Server logs are written to stderr and visible in the MCP client logs

Troubleshooting

  • "GITEA_BASE_URL not set": Environment variables aren't configured
  • Empty PR list: Check repository name, token permissions, or PR state filter
  • 401/403 errors: Token is invalid or lacks required permissions
  • Connection errors: Verify GITEA_BASE_URL is correct and accessible
Quick Setup
Installation guide for this server

Installation Command (package not published)

git clone https://github.com/Saravanan-Madhesh/GiteaMCPServer
Manual Installation: Please check the README for detailed setup instructions and any additional dependencies required.

Cursor configuration (mcp.json)

{ "mcpServers": { "saravanan-madhesh-giteamcpserver": { "command": "git", "args": [ "clone", "https://github.com/Saravanan-Madhesh/GiteaMCPServer" ] } } }