NF

nsvk13/forgejo-mcp-server

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

10 stars 5 forks 质量 75 趋势 4GPL-3.0

Forgejo 与克洛德 MCP的自主融合

概览

一个模式背景协议(MCP)服务器,它为克洛德桌面提供了与Forgejo寄存器交互的工具. - 列表寄存器 - 获取寄存器信息 - 列表问题, 按状态过滤 - 创建新问题 - 从寄存器读取文件内容 - 列表, 查看和创建拉动请求 设置以下环境变量: -FORGEJO BASE URL: 您的Forgejo实例 URL(例如 https://your-forgejo.com) - FORGEJO TOKEN: 您的Forgejo API 令牌 1. 转到您的 Forgejo 实例 2. 导航到设置 → 应用程序 3. 生成一个带有适当权限的新令牌 4. 复制令牌用于配置 在您的 Claude 桌面配置文件中添加以下内容 : :% APPDATA\\ Claude desktop config.json :% ~/ 图书馆/应用程序支持/Claude desktop config.json 将路径和证书替换为实际值.

概述(AI 翻译)

一个模式背景协议(MCP)服务器,它为克洛德桌面提供了与Forgejo寄存器交互的工具.

□ 特性

  • 清单储存库
  • 获取存储信息
  • 按国家列出过滤问题
  • 创建新问题
  • 从仓库读取文件内容
  • 列出、查看和创建拉动请求

□ 安装

□ 配置

环境变量

设置以下环境变量:

  • FORGEJO_BASE_URL:您的福热霍实例 URL(例如https://your-forgejo.com)
  • [[T2]: 您的 Forgejo API 代号

生成一个 Forgejo API 托肯

  1. 到你的Forgejo案例
  2. 导航到设置 – 应用程序
  3. 在适当许可下生成新的代号
  4. 复制用于配置的代号

XQ 克劳德桌面配置

在您的 Claude 桌面配置文件中添加以下内容 :

** 窗户**:%APPDATA%\Claude\claude_desktop_config.json macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

将路径和证书替换为实际值。

□ 使用量

配置后, 重新启动 Claude 桌面 。 然后可以使用命令,例如:

  • “给我的福吉霍仓库”

本页由 AI 翻译,技术细节请以原文为准。

README

Forgejo MCP Server

A Model Context Protocol (MCP) server that provides Claude Desktop with tools to interact with Forgejo repositories.

Features

  • List repositories
  • Get repository information
  • List issues with filtering by state
  • Create new issues
  • Read file contents from repositories
  • List, view, and create pull requests

Installation

git clone https://github.com/nsvk13/forgejo-mcp-server
cd forgejo-mcp-server
npm install
npm run build

Configuration

Environment Variables

Set the following environment variables:

  • FORGEJO_BASE_URL: Your Forgejo instance URL (e.g., https://your-forgejo.com)
  • FORGEJO_TOKEN: Your Forgejo API token

Generating a Forgejo API Token

  1. Go to your Forgejo instance
  2. Navigate to Settings → Applications
  3. Generate a new token with appropriate permissions
  4. Copy the token for use in configuration

Claude Desktop Configuration

Add the following to your Claude Desktop configuration file:

Windows: %APPDATA%\Claude\claude_desktop_config.json macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "forgejo": {
      "command": "node",
      "args": ["/absolute/path/to/forgejo-mcp-server/dist/index.js"],
      "env": {
        "FORGEJO_BASE_URL": "https://your-forgejo-instance.com",
        "FORGEJO_TOKEN": "your_api_token_here"
      }
    }
  }
}

Replace the path and credentials with your actual values.

Usage

After configuration, restart Claude Desktop. You can then use commands like:

  • “List my Forgejo repositories”
  • “Show issues in repository owner/repo-name”
  • “Create an issue in repository with title ‘Bug report’”
  • “Show the contents of README.md from repository”

Available Tools

  • list_repositories: Get list of user repositories
  • get_repository: Get detailed repository information
  • list_issues: List issues with optional state filtering
  • create_issue: Create a new issue
  • get_file_content: Read file contents from repository
  • list_pull_requests: List pull requests with optional state filtering
  • get_pull_request: Get a single pull request by its number
  • create_pull_request: Open a new pull request from a head branch into a base branch

Development

# Build the project
npm run build

# Run in development mode
npm run dev

Requirements

  • Node.js 18 or higher
  • TypeScript
  • Valid Forgejo instance with API access
在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "forgejo": { "command": "node", "args": ["/absolute/path/to/forgejo-mcp-server/dist/index.js"], "env": { "FORGEJO_BASE_URL": "https://your-forgejo-instance.com", "FORGEJO_TOKEN": "your_api_token_here" } } } }