The Gitea/Forgejo MCP Server is a powerful tool that turns AI assistants like Claude, Gemini, and Copilot into capable repository management assistants. It enables you to leverage AI for issue tracking, project organization, code reviews, and documentation management through the Model Context Protocol (MCP).
For SSE/Streamable HTTP mode, run the forgejo-mcp as a server:
docker run -p 8080:8080 -e FORGEJOMCP_TOKEN="my-forgejo-api-token" ronmi/forgejo-mcp http --address :8080 --server https://git.example.com
go install github.com/raohwork/forgejo-mcp@latest
You can download the appropriate version for your operating system from the Releases page.
Before configuring your MCP client, you need to create an access token:
For better security, set environment variables instead of using tokens directly:
export FORGEJOMCP_SERVER="https://your-forgejo-instance.com"
export FORGEJOMCP_TOKEN="your_access_token"
This mode is recommended for integrating with local AI assistant clients like Claude Desktop or Gemini CLI.
Using docker:
{
"mcpServers": {
"forgejo": {
"command": "docker",
"args": [
"--rm",
"ronmi/forgejo-mcp",
"stdio",
"--server", "https://your-forgejo-instance.com",
"--token", "your_access_token"
]
}
}
}
Using installed binary:
{
"mcpServers": {
"forgejo": {
"command": "/path/to/forgejo-mcp",
"args": [
"stdio",
"--server", "https://your-forgejo-instance.com",
"--token", "your_access_token"
]
}
}
}
This mode starts a web server for remote clients to connect via HTTP.
To start the server:
# with local binary
/path/to/forgejo-mcp http --address :8080 --server https://your-forgejo-instance.com
# with docker
docker run -p 8080:8080 -d --rm ronmi/forgejo-mcp http --address :8080 --server https://your-forgejo-instance.com
Single-user mode:
forgejo-mcp http --address :8080 --server https://git.example.com --token your_token
Multi-user mode: No token provided at startup; clients must send an Authorization header with each request.
For SSE clients:
{
"mcpServers": {
"forgejo-remote": {
"type": "sse",
"url": "http://localhost:8080/sse",
"headers": {
"Authorization": "Bearer your_token"
}
}
}
}
For HTTP clients:
{
"mcpServers": {
"forgejo-remote": {
"type": "http",
"url": "http://localhost:8080/",
"headers": {
"Authorization": "Bearer your_token"
}
}
}
}
After configuration, you can use natural language with your AI assistant:
The server supports features including issue management, project organization, release management, pull request viewing, and wiki page management.
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "forgejo" '{"command":"docker","args":["--rm","ronmi/forgejo-mcp","stdio","--server","https://your-forgejo-instance.com","--token","your_access_token"]}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:
{
"mcpServers": {
"forgejo": {
"command": "docker",
"args": [
"--rm",
"ronmi/forgejo-mcp",
"stdio",
"--server",
"https://your-forgejo-instance.com",
"--token",
"your_access_token"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%\Claude\claude_desktop_config.json~/.config/Claude/claude_desktop_config.json2. Add this to your configuration file:
{
"mcpServers": {
"forgejo": {
"command": "docker",
"args": [
"--rm",
"ronmi/forgejo-mcp",
"stdio",
"--server",
"https://your-forgejo-instance.com",
"--token",
"your_access_token"
]
}
}
}
3. Restart Claude Desktop for the changes to take effect