Forgejo MCP
Provides tools for interacting with a Forgejo instance, enabling AI agents to manage repositories, issues, pull requests, milestones, labels, workflows, and other Forgejo resources.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Forgejo MCPlist all open issues assigned to me"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Forgejo MCP
Forgejo MCP is a self-hosted Model Context Protocol server and management Dashboard that gives organizations centrally governed, controlled and observable AI access to an existing Forgejo instance.
Users connect with their own scoped Forgejo personal access tokens (PATs). Administrators decide which MCP tools are enabled globally, available to each user and granted to each show-once MCP token.
v0.1.0 is the initial open-source release. The core workflow is tested locally against Forgejo 16.0.2, while some production deployment capabilities are not yet complete. Review the known limitations before production use.
What it provides
38 tools for repositories, git trees, branches, commits, labels, milestones, Issues, pull requests, reviews, workflows, tags and releases.
Global, user and token-level tool authorization in addition to Forgejo's own permissions.
Per-user Forgejo identity through a verified, scoped PAT.
AES-256-GCM encryption for stored PATs and show-once MCP tokens.
A web Dashboard for Forgejo configuration, users, permissions and audit records.
Redacted invocation auditing, structured logs, health endpoints and Prometheus metrics.
Related MCP server: devflow-mcp
Governance for company use
Forgejo MCP is designed as a governance layer between company AI clients and Forgejo—not merely as another API wrapper.
Manageable permissions: administrators centrally control which tools are enabled globally, available to each user and granted to each MCP token.
Controlled operations: AI clients never receive an unrestricted shared Forgejo token. Every operation remains bounded by the user's PAT scopes, Forgejo repository permissions and server-side input limits.
Traceable identity: each MCP token belongs to a specific user and client, so activity is not hidden behind a shared service account.
Auditable behavior: tool, user, target, authorization decision, status, duration and correlation identifiers are recorded with sensitive values redacted.
Observable service: structured logs, health checks, Prometheus metrics and request/user/invocation correlation support operational inspection.
Revocable access: administrators can revoke one client token, remove selected tool grants, deactivate a Forgejo credential or suspend a user.
Credential isolation: MCP tokens and Forgejo PATs are separate credentials. An MCP token neither contains nor reveals the PAT; if only an MCP token is exposed, it can be revoked without rotating the Forgejo PAT.
How it works
MCP client ──Bearer token──> Forgejo MCP /mcp ──user PAT──> Forgejo API
│
Web Dashboard ──admin/user──> permissions, credentials and audit records
│
PostgreSQLForgejo MCP does not replace Forgejo authorization. A tool is available only when it is globally enabled, allowed for the user, granted to the MCP token, and permitted by the user's Forgejo account and PAT.
Requirements
An existing Forgejo instance compatible with the locked Forgejo 16.0.2 API contract
Docker Engine with Docker Compose
OpenSSL for generating local secrets
The supported v0.1.0 deployment builds the React Dashboard into the App image and starts the App and PostgreSQL together. Operators do not need separate frontend and backend processes.
Quick start
From the repository root:
cp deploy/compose.example.env deploy/.env
# Edit deploy/.env and replace POSTGRES_PASSWORD before continuing.
mkdir -p deploy/secrets
openssl rand -base64 32 > deploy/secrets/admin_password
openssl rand -base64 32 > deploy/secrets/credential_key
chmod 600 deploy/secrets/admin_password deploy/secrets/credential_key
docker compose --env-file deploy/.env -f deploy/compose.yaml up --build -dVerify that the service is ready:
docker compose --env-file deploy/.env -f deploy/compose.yaml ps
curl http://127.0.0.1:8000/health/readyOpen http://127.0.0.1:8000 and sign in with:
Username:
admin(orFMCP_BOOTSTRAP_ADMIN_USERNAME)Password: the value in
deploy/secrets/admin_password
Change the bootstrap password immediately. Direct localhost HTTP requires FMCP_COOKIE_SECURE=false; secure cookies should remain enabled behind HTTPS.
For logs, shutdown, clean reset, common startup errors and the optional local Forgejo profile, see Getting started.
First-time setup
After signing in:
Change the bootstrap administrator password.
Configure and verify the Forgejo base URL.
Enable the required tools globally.
Create a user with their expected Forgejo username and send a one-time invitation.
Set the user's tool allowance.
Have the user verify a scoped Forgejo PAT and create an MCP token.
Grant the required tools to that token.
Connect an MCP client to
POST /mcp.
See the administrator guide and user guide for the complete workflow.
MCP connection
Forgejo MCP uses authenticated MCP Streamable HTTP:
URL: https://forgejo-mcp.example/mcp
Transport: Streamable HTTP
Authorization: Bearer fmcp_...The MCP token is shown only once. Store it in the client's secret storage; query-string tokens are rejected. See MCP client configuration for the field mapping, connection checks and troubleshooting guidance.
Documentation
Need | Document |
Install and start the service | |
Configure Forgejo, users and permissions | |
Create a PAT and MCP token | |
Connect an MCP client | |
Review current constraints | |
Inspect tool inputs and behavior | |
Review credential handling |
Development and verification
Run the disposable full-stack App/PostgreSQL/Forgejo E2E test:
./scripts/test-full-docker-e2e.shRun the individual quality checks:
uv run ruff check .
uv run ruff format --check .
uv run mypy
uv run pytest
npm run lint --prefix frontend
npm run typecheck --prefix frontend
npm run build --prefix frontendForgejo is pinned to codeberg.org/forgejo/forgejo:16.0.2-rootless. Verify another instance's Swagger contract with:
uv run python scripts/verify_forgejo_openapi.py https://forgejo.example/swagger.v1.jsonLicense
Copyright holders license this project under the Apache License 2.0.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityDmaintenanceAn MCP server for managing your repositories on Forgejo/Gitea server.Last updated64Mozilla Public 2.0
- Alicense-qualityDmaintenanceA production-ready MCP server that provides AI assistants with comprehensive GitHub developer tooling including PR analysis, code review, changelog generation, dependency auditing, commit summarization, and refactoring suggestions.Last updated10ISC
- AlicenseAqualityAmaintenanceAn MCP server that enables AI assistants to read, create, and manage issues, repositories, and releases on Gitea, Forgejo, or Codeberg instances via personal access tokens.Last updated21MIT
- AlicenseBqualityDmaintenanceA Model Context Protocol (MCP) server for Forgejo and Gitea instances, enabling AI assistants to interact with repositories, issues, pull requests, and more.Last updated1002348MIT
Related MCP Connectors
A MCP server built for developers enabling Git based project management with project and personal…
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
Self-hosted MCP gateway: turn any API, database or MCP server into AI connectors — no code.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/KePatrick/forgejo-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server