gitea-mcp/README.md

1.6 KiB

Gitea MCP Server

An MCP server that provides tools for interacting with the Gitea API.

Setup

  1. Clone the repository
  2. Install dependencies:
    npm install
    
  3. Copy the example environment file:
    cp .env.example .env
    
  4. Configure your environment variables in .env:

Building

npm run build

Available Tools

  • list_repositories: List repositories for the authenticated user
  • get_repository: Get details about a specific repository
  • list_issues: List issues in a repository
  • create_issue: Create a new issue in a repository
  • list_pull_requests: List pull requests in a repository
  • create_repository: Create a new repository
  • get_contents: Get contents of a file or directory in a repository
  • add_file_to_repo: Add a new file to a repository
  • create_branch: Create a new branch in a repository

Tool Usage Examples

Adding a File to a Repository

{
  "owner": "username",
  "repo": "repository-name",
  "path": "path/to/file.txt",
  "content": "File content here",  // or use file_text
  "message": "Commit message",
  "branch": "main"  // optional
}

Creating a Repository

{
  "name": "repository-name",
  "description": "Repository description",
  "private": false,
  "autoInit": true
}

Error Handling

The server will throw appropriate errors if:

  • Required environment variables are missing
  • API requests fail
  • Invalid parameters are provided
  • Tool names are incorrect