Provides tools for searching files and content across all Gitea repositories: - gitea_list_repos, gitea_search_files, gitea_search_content - gitea_get_file, gitea_repo_info, gitea_list_files 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
61 lines
1.4 KiB
Markdown
61 lines
1.4 KiB
Markdown
# MCP Gitea Search
|
|
|
|
A Model Context Protocol (MCP) server for searching files and content across Gitea repositories.
|
|
|
|
## Installation
|
|
|
|
```bash
|
|
npm install
|
|
```
|
|
|
|
## Configuration
|
|
|
|
Set environment variables:
|
|
|
|
```bash
|
|
export GITEA_URL="http://your-gitea-server:3000"
|
|
export GITEA_TOKEN="your-api-token"
|
|
```
|
|
|
|
Or configure in Claude Code's `~/.claude/settings.json`:
|
|
|
|
```json
|
|
{
|
|
"mcpServers": {
|
|
"gitea": {
|
|
"command": "node",
|
|
"args": ["/path/to/mcp-gitea-search/index.js"],
|
|
"env": {
|
|
"GITEA_URL": "http://your-gitea-server:3000",
|
|
"GITEA_TOKEN": "your-api-token"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
```
|
|
|
|
## Available Tools
|
|
|
|
| Tool | Description |
|
|
|------|-------------|
|
|
| `gitea_list_repos` | List all accessible repositories |
|
|
| `gitea_search_files` | Search files by name pattern (regex) |
|
|
| `gitea_search_content` | Search within file contents |
|
|
| `gitea_get_file` | Get contents of a specific file |
|
|
| `gitea_repo_info` | Get repository details |
|
|
| `gitea_list_files` | List all files in a repo |
|
|
|
|
## Usage Examples
|
|
|
|
After configuring in Claude Code:
|
|
|
|
- "Search my Gitea for all .csproj files"
|
|
- "Find files containing 'ConnectionString' across all repos"
|
|
- "Get the contents of peter/myrepo/appsettings.json"
|
|
|
|
## Creating a Gitea API Token
|
|
|
|
1. Go to Settings → Applications in your Gitea instance
|
|
2. Generate a new token with `read:repository` scope
|
|
3. Copy the token (shown only once)
|