forgejo-communication-adapter
A utility bridging Forgejo's remote procedure call interface with Model Context Protocol interactions for comprehensive repository oversight and operation handling.
Author

goern
Quick Info
Actions
Tags
Forgejo MCP Conduit
Forgejo MCP Conduit serves as an integration module designed to link Forgejo instances with systems adhering to the Model Context Protocol (MCP). This facilitates fluid execution of commands and management of source code repositories via an MCP-compliant conversational interface.
🚧Acquisition
🔧Compiling From Source
Obtain the source code repository via Git cloning:
bash git clone https://codeberg.org/goern/forgejo-mcp.git
Prerequisites for compilation:
makeutility- Golang (version 1.24 or newer highly suggested)
Execute the build process:
bash make build
📁Installation into System Path
Relocate the compiled executable, forgejo-mcp, to a directory listed in your system's execution path. For instance:
bash cp forgejo-mcp /usr/local/bin/
🚀Operational Guide
This configuration example targets Cursor, though VSCode extensions are also compatible. To set up the MCP endpoint for Forgejo, incorporate the following structure into your MCP configuration file:
- Standard I/O Mode
{
"mcpServers": {
"forgejo": {
"command": "forgejo-mcp",
"args": [
"--transport", "stdio",
"--url", "https://forgejo.example.org"
// "--token", "
- Server-Sent Events (SSE) Mode
{ "mcpServers": { "forgejo": { "url": "http://localhost:8080/sse" } } }
[!TIP] The Forgejo instance URI and authorization credential can be supplied either as command-line flags or through environment variables. Command-line specifications take precedence. Environment variables have been updated for clarity: - Use
FORGEJO_URLsuperseding the retiredGITEA_HOST- UseFORGEJO_ACCESS_TOKENsuperseding the retiredGITEA_ACCESS_TOKEN- UseFORGEJO_DEBUGsuperseding the retiredGITEA_DEBUGOlder
GITEA_*variables are maintained for legacy support but will trigger deprecation advisories.
With the setup complete, initiate an interaction in your MCP-enabled chat interface, such as:
text list all my repositories
✅Accessible Functions
The Forgejo MCP Conduit exposes the following functionalities:
| Function Name | Target Scope | Purpose Description |
|---|---|---|
| get_my_user_info | User | Retrieve details for the currently authenticated user |
| create_repo | Repository | Instantiate a new repository |
| fork_repo | Repository | Duplicate an existing repository |
| list_my_repos | Repository | Enumerate all repositories under the authenticated user's ownership |
| create_branch | Branch | Establish a new branch pointer |
| delete_branch | Branch | Remove an existing branch |
| list_branches | Branch | Display all branch pointers within a repository |
| list_repo_commits | Commit | Fetch the commit history log for a repository |
| get_file_content | File | Obtain the contents and associated metadata of a specified file |
| create_file | File | Provision a new file within the repository structure |
| update_file | File | Modify the contents of an existing file |
| delete_file | File | Remove a file from the repository |
| get_issue_by_index | Issue | Fetch an issue using its sequential identifier |
| list_repo_issues | Issue | Generate a list of all issues associated with a repository |
| create_issue | Issue | Log a new issue ticket |
| create_issue_comment | Issue | Post a remark or annotation on an issue |
| get_pull_request_by_index | Pull Request | Retrieve a pull request based on its index |
| list_repo_pull_requests | Pull Request | Display all active pull requests for a repository |
| create_pull_request | Pull Request | Submit a proposal for merging changes |
| search_users | User | Query the system for user accounts |
| search_org_teams | Organization | Search for defined teams within an organization |
| search_repos | Repository | Search for repositories matching specific criteria |
| get_forgejo_mcp_server_version | Server | Report the current version identifier of the Forgejo MCP Conduit software |
🐛Diagnostic Procedures
To activate verbose logging, incorporate the -d flag when launching the Forgejo MCP Conduit in SSE mode:
sh
./forgejo-mcp --transport sse --url
Utilize this interface to explore and govern your Forgejo assets through natural language queries!
