Get the FREE Ultimate OpenClaw Setup Guide →

forgejo

Forgejo Self-Hosted Integration with Claude MCP (AI Assistant)

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio nsvk13-forgejo-mcp-server node /absolute/path/to/forgejo-mcp-server/dist/index.js \
  --env FORGEJO_TOKEN="your_api_token_here" \
  --env FORGEJO_BASE_URL="https://your-forgejo-instance.com"

How to use

Forgejo MCP Server exposes a set of tools that Claude Desktop can use to interact with a Forgejo instance. It can list your repositories, fetch detailed repository information, list issues with optional state filtering, create new issues, and read file contents from repositories. To use it, configure Claude Desktop to point at the built server binary and provide the Forgejo instance URL and a valid API token via environment variables. Once configured and the server is running, you can issue natural language commands like: “List my Forgejo repositories”, “Show issues in owner/repo”, “Create an issue in owner/repo with title ‘Bug report’”, or “Show the contents of README.md from owner/repo”. The server translates these requests into Forgejo API calls and returns structured results suitable for Claude Desktop to present to you.

How to install

Prerequisites: - Bun (1.0 or newer) - A Forgejo instance with API access - Node.js tooling is not required for runtime if you use the Bun build, but you will build with Bun.

Step-by-step:

  1. Clone the repository: git clone https://github.com/nsvk13/forgejo-mcp-server
  2. Enter the project directory: cd forgejo-mcp-server
  3. Install dependencies with Bun: bun install
  4. Build the project: bun run build
  5. Run or configure the server in Claude Desktop by pointing to the built dist/index.js and setting environment variables (see configuration).

Notes:

  • Ensure Bun is installed and in your PATH. The project uses Bun to install and build.
  • You will need a Forgejo instance URL and an API token with appropriate permissions.

Additional notes

Tips and common considerations:

  • Environment variables FORGEJO_BASE_URL and FORGEJO_TOKEN are required for access to the Forgejo API. Keep tokens secure and do not commit them.
  • The configuration example assumes a built server at /absolute/path/to/forgejo-mcp-server/dist/index.js. Use the actual absolute path on your system.
  • If Forgejo requires specific permissions for issuing or reading repository contents, ensure the token has those scopes.
  • If you update the server code, re-run bun run build and refresh Claude Desktop configuration as needed.
  • For Windows/macOS, ensure the config paths in Claude Desktop point to the correct claude_desktop_config.json location as described in the README.

Related MCP Servers

Sponsor this space

Reach thousands of developers