dev
Generic: Repo Health / Scripts governance (push) Blocked by required conditions
Generic: Repo Health / Repository health (push) Blocked by required conditions
Generic: Repo Health / Report Issues (push) Blocked by required conditions
Generic: Repo Health / Site Health (push) Has been skipped
Generic: Repo Health / Access control (push) Successful in 3s
Universal: Pre-Release / Build Pre-Release (${{ inputs.stability || github.ref_name }}) (push) Successful in 20s
Contributing to gitea-api-mcp
Thank you for your interest in contributing to gitea-api-mcp. This document provides guidelines and information for contributors.
Table of Contents
- Getting Started
- Development Setup
- Gitea API Explorer
- Code Style
- Commit Conventions
- Branch Protection Rules
- Pull Request Process
- Adding a New Tool
Getting Started
- Fork the repository on Gitea: https://git.mokoconsulting.tech/MokoConsulting/gitea-api-mcp
- Clone your fork locally
- Create a feature branch from
main - Make your changes
- Submit a pull request
Development Setup
git clone https://git.mokoconsulting.tech/YourUsername/gitea-api-mcp.git
cd gitea-api-mcp
npm install
npm run build
For live recompilation during development:
npm run dev
Ensure you have a valid ~/.gitea-api-mcp.json config file pointing to a test Gitea instance before testing.
Gitea API Explorer
When adding or modifying tools, refer to your Gitea instance's built-in API explorer:
https://your-gitea-instance/api/swagger
For the Moko Consulting instance:
https://git.mokoconsulting.tech/api/swagger
The Swagger UI provides:
- Full endpoint documentation with request/response schemas
- Interactive API testing ("Try it out" button)
- Authentication configuration for testing
- Parameter type and validation details
Code Style
- Use TypeScript strict mode
- Follow the existing patterns in
src/index.tsfor tool registration - Use the
OwnerRepo,PaginationParams, andConnectionParamshared parameter objects - Format responses through
formatResponse() - Include mokostandards file headers on all new source files
File Header Template
/* Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
*
* This file is part of a Moko Consulting project.
*
* SPDX-License-Identifier: GPL-3.0-or-later
*
* FILE INFORMATION
* DEFGROUP: gitea-api-mcp.<GroupName>
* INGROUP: gitea-api-mcp
* REPO: https://git.mokoconsulting.tech/MokoConsulting/gitea-api-mcp
* PATH: /src/<filename>.ts
* VERSION: 01.00.00
* BRIEF: <One-line description>
*/
Commit Conventions
This project uses Conventional Commits:
<type>(<scope>): <description>
[optional body]
[optional footer(s)]
Types
| Type | Description |
|---|---|
feat |
New feature (new tool, new parameter) |
fix |
Bug fix |
docs |
Documentation only |
refactor |
Code change that neither fixes a bug nor adds a feature |
chore |
Build process, dependency updates |
test |
Adding or updating tests |
Scope
Use the tool category as scope when applicable:
feat(issues): add gitea_issue_lock tool
fix(client): handle 204 No Content responses
docs(readme): update tool count
Branch Protection Rules
The main branch has the following protections:
- Direct pushes to
mainare not allowed - All changes must come through pull requests
- At least one approval is required before merging
- Status checks must pass before merging
- Force pushes are disabled
Branch Naming
feat/short-description
fix/issue-number-description
docs/what-changed
refactor/what-changed
Pull Request Process
- Ensure your branch is up to date with
main - Update documentation if you added or changed tools
- Update
CHANGELOG.mdunder an[Unreleased]section - Fill out the PR template with a clear description
- Request review from a maintainer
- Address any review feedback
- Squash-merge will be used for final integration
Adding a New Tool
- Identify the Gitea API endpoint in the Swagger explorer
- Add the tool registration in
src/index.tsunder the appropriate category section - Follow the existing parameter patterns:
- Use
OwnerRepofor tools that operate on a specific repository - Use
PaginationParamsfor list endpoints - Always include
ConnectionParamfor multi-connection support
- Use
- Use
z.string().describe('...')for all parameters with clear descriptions - Route through
formatResponse()for consistent output - Update the tool tables in
README.mdanddocs/API.md - Add the tool to
CHANGELOG.md
Example
server.tool(
'gitea_example_action',
'Description of what this tool does',
{
...OwnerRepo,
some_param: z.string().describe('What this parameter controls'),
...PaginationParams,
...ConnectionParam,
},
async ({ owner, repo, some_param, page, limit, connection }) => {
const params: Record<string, string> = { ...pageQuery({ page, limit }) };
if (some_param) params['some_param'] = some_param;
return formatResponse(
await clientFor(connection).get(`/repos/${owner}/${repo}/example`, params),
);
},
);
Description
MCP server for Gitea REST API v1 operations — 61 tools for repos, issues, PRs, releases, branches, actions, orgs, wiki, webhooks, and more
853 KiB
Languages
TypeScript
56.1%
Markdown
34.5%
Shell
6%
JavaScript
1.5%
JSON
1.1%
Other
0.8%