datapilot-canada/gitea-mcp
If you are the rightful owner of gitea-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
Datapilot Canada - Gitea MCP Server is a server implementation designed to interact with a self-hosted Gitea instance, providing repository management and issue tracking capabilities.
Datapilot Canada - Gitea MCP Server
MCP Server Implementation for interacting with Gitea.
Features
- Connect to a self-hosted Gitea instance
- Repository Management (List, Create, Delete, Search, Update)
- Issue Tracking (Create, Search, Update, Comment, Label)
Setup
-
Install Dependencies:
pip install -r requirements.txt(Note: You may need to create a
requirements.txtor installmcp,httpx,python-dotenvmanually)Or if using
uv:uv add mcp httpx python-dotenv -
Configuration: Copy
.env.exampleto.envand fill in your Gitea details:cp .env.example .envEdit
.env:GITEA_MCP_API_URL=https://your-gitea-instance.com GITEA_ACCESS_TOKEN=your_access_token_here
Usage with MCP Client (e.g. Claude Desktop, VS Code)
Add the server to your MCP configuration. A sample configuration is provided in mcp_config.json.
To run manually:
python src/datapilot_gitea_mcp/server.py
Docker Usage
You can also run this server using Docker.
-
Build the image:
docker build -t datapilotgiteamcp . -
Run the container: Since MCP uses stdio for communication, you need to run the container interactively and pass environment variables.
docker run -i --rm \ -e GITEA_MCP_API_URL=https://your-gitea-instance.com \ -e GITEA_ACCESS_TOKEN=your_access_token_here \ datapilotgiteamcpNote: When configuring this in an MCP client (like Claude Desktop), use the
dockercommand in the configuration.Example
claude_desktop_config.json:{ "mcpServers": { "gitea": { "command": "docker", "args": [ "run", "-i", "--rm", "-e", "GITEA_MCP_API_URL=https://your-gitea-instance.com", "-e", "GITEA_ACCESS_TOKEN=your_token", "datapilotgiteamcp" ] } } }
Using Self-Signed Certificates
If your Gitea instance uses a self-signed certificate, you can mount your certificate into the container and configure the environment variables to trust it.
-
Mount the certificate: Use the
-vflag to mount your certificate file into the container. -
Set environment variables: Set
SSL_CERT_FILEandREQUESTS_CA_BUNDLEto point to the mounted certificate.docker run -i --rm \ -e GITEA_MCP_API_URL=https://your-gitea-instance.com \ -e GITEA_ACCESS_TOKEN=your_token \ -v /path/to/your/cert.crt:/usr/local/share/ca-certificates/custom-cert.crt \ -e SSL_CERT_FILE=/usr/local/share/ca-certificates/custom-cert.crt \ -e REQUESTS_CA_BUNDLE=/usr/local/share/ca-certificates/custom-cert.crt \ datapilotgiteamcp
Remote Deployment
You can run this MCP server on a remote machine and connect to it securely via SSH. This is useful if you want to keep the server running on a central host or closer to your Gitea instance.
1. Prepare the Remote Host
Ensure the remote machine has Docker installed and the user has permissions to run containers. Transfer your Docker image to the remote host:
# Save image locally and load it on the remote host
docker save datapilotgiteamcp | ssh user@your-remote-host "docker load"
2. Configure VS Code (Local)
Use the gitea-docker-ssh configuration provided in mcp_config.json.
Important Notes:
- SSH Keys: You must have SSH key-based authentication set up (passwordless login) for this to work seamlessly.
- Environment Variables: Since the process runs remotely, you must pass the environment variables explicitly in the
argslist, or mount a.envfile that exists on the remote filesystem.
Troubleshooting
"Request URL is missing an 'http://' or 'https://' protocol"
This error means the GITEA_MCP_API_URL environment variable is not set or is invalid.
- If running via Docker: Ensure you are passing the environment variables correctly.
- If using
--env-file .env, make sure the.envfile exists in the directory where you are running the command (or VS Code workspace root) and containsGITEA_MCP_API_URL. - If running from a different workspace, you may need to provide the absolute path to your
.envfile in themcp.jsonconfiguration:"--env-file", "C:/path/to/your/project/.env"
- If using
- If running locally: Ensure
.envis in the project root or the same directory asserver.py.
Prompt Samples
Creating an issue
Create a new issue in the 'your-repository' repository to track the implementation of the new feature. Add the 'enhancement' label to it.