@andrebuzeli/git-mcp 5.0.4 → 5.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +143 -89
- package/dist/config.d.ts +72 -71
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +226 -139
- package/dist/config.js.map +1 -1
- package/dist/index.d.ts +15 -17
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +133 -128
- package/dist/index.js.map +1 -1
- package/dist/providers/base-provider.d.ts +42 -153
- package/dist/providers/base-provider.d.ts.map +1 -1
- package/dist/providers/base-provider.js +42 -302
- package/dist/providers/base-provider.js.map +1 -1
- package/dist/providers/gitea-provider.d.ts +67 -118
- package/dist/providers/gitea-provider.d.ts.map +1 -1
- package/dist/providers/gitea-provider.js +487 -1161
- package/dist/providers/gitea-provider.js.map +1 -1
- package/dist/providers/github-provider.d.ts +70 -81
- package/dist/providers/github-provider.d.ts.map +1 -1
- package/dist/providers/github-provider.js +641 -278
- package/dist/providers/github-provider.js.map +1 -1
- package/dist/providers/index.d.ts +9 -9
- package/dist/providers/index.d.ts.map +1 -1
- package/dist/providers/index.js +13 -19
- package/dist/providers/index.js.map +1 -1
- package/dist/providers/provider-factory.d.ts +29 -59
- package/dist/providers/provider-factory.d.ts.map +1 -1
- package/dist/providers/provider-factory.js +134 -265
- package/dist/providers/provider-factory.js.map +1 -1
- package/dist/providers/provider-operation-handler.d.ts +93 -0
- package/dist/providers/provider-operation-handler.d.ts.map +1 -0
- package/dist/providers/provider-operation-handler.js +280 -0
- package/dist/providers/provider-operation-handler.js.map +1 -0
- package/dist/providers/types.d.ts +201 -355
- package/dist/providers/types.d.ts.map +1 -1
- package/dist/providers/types.js +3 -2
- package/dist/providers/types.js.map +1 -1
- package/dist/server.d.ts +34 -4
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +439 -262
- package/dist/server.js.map +1 -1
- package/dist/tools/git-analytics.d.ts +239 -16
- package/dist/tools/git-analytics.d.ts.map +1 -1
- package/dist/tools/git-analytics.js +737 -25
- package/dist/tools/git-analytics.js.map +1 -1
- package/dist/tools/git-archive.d.ts +109 -15
- package/dist/tools/git-archive.d.ts.map +1 -1
- package/dist/tools/git-archive.js +462 -10
- package/dist/tools/git-archive.js.map +1 -1
- package/dist/tools/git-backup.d.ts +101 -15
- package/dist/tools/git-backup.d.ts.map +1 -1
- package/dist/tools/git-backup.js +410 -10
- package/dist/tools/git-backup.js.map +1 -1
- package/dist/tools/git-branches.d.ts +141 -15
- package/dist/tools/git-branches.d.ts.map +1 -1
- package/dist/tools/git-branches.js +466 -11
- package/dist/tools/git-branches.js.map +1 -1
- package/dist/tools/git-config.d.ts +115 -15
- package/dist/tools/git-config.d.ts.map +1 -1
- package/dist/tools/git-config.js +446 -11
- package/dist/tools/git-config.js.map +1 -1
- package/dist/tools/git-files.d.ts +179 -59
- package/dist/tools/git-files.d.ts.map +1 -1
- package/dist/tools/git-files.js +682 -222
- package/dist/tools/git-files.js.map +1 -1
- package/dist/tools/git-issues.d.ts +158 -15
- package/dist/tools/git-issues.d.ts.map +1 -1
- package/dist/tools/git-issues.js +323 -11
- package/dist/tools/git-issues.js.map +1 -1
- package/dist/tools/git-monitor.d.ts +149 -14
- package/dist/tools/git-monitor.d.ts.map +1 -1
- package/dist/tools/git-monitor.js +528 -11
- package/dist/tools/git-monitor.js.map +1 -1
- package/dist/tools/git-packages.d.ts +163 -15
- package/dist/tools/git-packages.d.ts.map +1 -1
- package/dist/tools/git-packages.js +526 -11
- package/dist/tools/git-packages.js.map +1 -1
- package/dist/tools/git-pulls.d.ts +174 -15
- package/dist/tools/git-pulls.d.ts.map +1 -1
- package/dist/tools/git-pulls.js +352 -11
- package/dist/tools/git-pulls.js.map +1 -1
- package/dist/tools/git-release.d.ts +167 -15
- package/dist/tools/git-release.d.ts.map +1 -1
- package/dist/tools/git-release.js +465 -11
- package/dist/tools/git-release.js.map +1 -1
- package/dist/tools/git-remote.d.ts +124 -15
- package/dist/tools/git-remote.d.ts.map +1 -1
- package/dist/tools/git-remote.js +539 -11
- package/dist/tools/git-remote.js.map +1 -1
- package/dist/tools/git-reset.d.ts +100 -15
- package/dist/tools/git-reset.d.ts.map +1 -1
- package/dist/tools/git-reset.js +409 -11
- package/dist/tools/git-reset.js.map +1 -1
- package/dist/tools/git-stash.d.ts +120 -15
- package/dist/tools/git-stash.d.ts.map +1 -1
- package/dist/tools/git-stash.js +503 -11
- package/dist/tools/git-stash.js.map +1 -1
- package/dist/tools/git-sync.d.ts +160 -16
- package/dist/tools/git-sync.d.ts.map +1 -1
- package/dist/tools/git-sync.js +462 -113
- package/dist/tools/git-sync.js.map +1 -1
- package/dist/tools/git-tags.d.ts +142 -15
- package/dist/tools/git-tags.d.ts.map +1 -1
- package/dist/tools/git-tags.js +471 -11
- package/dist/tools/git-tags.js.map +1 -1
- package/dist/tools/git-workflow.d.ts +151 -80
- package/dist/tools/git-workflow.d.ts.map +1 -1
- package/dist/tools/git-workflow.js +407 -912
- package/dist/tools/git-workflow.js.map +1 -1
- package/dist/utils/credential-manager.d.ts +119 -0
- package/dist/utils/credential-manager.d.ts.map +1 -0
- package/dist/utils/credential-manager.js +450 -0
- package/dist/utils/credential-manager.js.map +1 -0
- package/dist/utils/git-command-executor.d.ts +326 -0
- package/dist/utils/git-command-executor.d.ts.map +1 -0
- package/dist/utils/git-command-executor.js +877 -0
- package/dist/utils/git-command-executor.js.map +1 -0
- package/dist/utils/logger.d.ts +143 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +473 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/operation-error-handler.d.ts +54 -41
- package/dist/utils/operation-error-handler.d.ts.map +1 -1
- package/dist/utils/operation-error-handler.js +211 -227
- package/dist/utils/operation-error-handler.js.map +1 -1
- package/dist/utils/parameter-validator.d.ts +41 -0
- package/dist/utils/parameter-validator.d.ts.map +1 -0
- package/dist/utils/parameter-validator.js +464 -0
- package/dist/utils/parameter-validator.js.map +1 -0
- package/dist/utils/repository-detector.d.ts +128 -0
- package/dist/utils/repository-detector.d.ts.map +1 -0
- package/dist/utils/repository-detector.js +422 -0
- package/dist/utils/repository-detector.js.map +1 -0
- package/dist/utils/response-formatter.d.ts +146 -0
- package/dist/utils/response-formatter.d.ts.map +1 -0
- package/dist/utils/response-formatter.js +378 -0
- package/dist/utils/response-formatter.js.map +1 -0
- package/dist/utils/retry.d.ts +12 -0
- package/dist/utils/retry.d.ts.map +1 -0
- package/dist/utils/retry.js +28 -0
- package/dist/utils/retry.js.map +1 -0
- package/dist/utils/terminal-controller.d.ts +73 -139
- package/dist/utils/terminal-controller.d.ts.map +1 -1
- package/dist/utils/terminal-controller.js +234 -459
- package/dist/utils/terminal-controller.js.map +1 -1
- package/package.json +79 -60
- package/dist/providers/error-handler.d.ts +0 -51
- package/dist/providers/error-handler.d.ts.map +0 -1
- package/dist/providers/error-handler.js +0 -176
- package/dist/providers/error-handler.js.map +0 -1
- package/dist/providers/github-provider-backup.d.ts +0 -81
- package/dist/providers/github-provider-backup.d.ts.map +0 -1
- package/dist/providers/github-provider-backup.js +0 -1179
- package/dist/providers/github-provider-backup.js.map +0 -1
- package/dist/providers/github-provider-complete.d.ts +0 -1
- package/dist/providers/github-provider-complete.d.ts.map +0 -1
- package/dist/providers/github-provider-complete.js +0 -2
- package/dist/providers/github-provider-complete.js.map +0 -1
- package/dist/tools/git-init.d.ts +0 -50
- package/dist/tools/git-init.d.ts.map +0 -1
- package/dist/tools/git-init.js +0 -258
- package/dist/tools/git-init.js.map +0 -1
- package/dist/tools/git-log.d.ts +0 -67
- package/dist/tools/git-log.d.ts.map +0 -1
- package/dist/tools/git-log.js +0 -320
- package/dist/tools/git-log.js.map +0 -1
- package/dist/tools/git-status.d.ts +0 -29
- package/dist/tools/git-status.d.ts.map +0 -1
- package/dist/tools/git-status.js +0 -182
- package/dist/tools/git-status.js.map +0 -1
- package/dist/tools/git-update.d.ts +0 -34
- package/dist/tools/git-update.d.ts.map +0 -1
- package/dist/tools/git-update.js +0 -191
- package/dist/tools/git-update.js.map +0 -1
- package/dist/utils/auto-detection.d.ts +0 -120
- package/dist/utils/auto-detection.d.ts.map +0 -1
- package/dist/utils/auto-detection.js +0 -259
- package/dist/utils/auto-detection.js.map +0 -1
- package/dist/utils/configuration-error-generator.d.ts +0 -41
- package/dist/utils/configuration-error-generator.d.ts.map +0 -1
- package/dist/utils/configuration-error-generator.js +0 -168
- package/dist/utils/configuration-error-generator.js.map +0 -1
- package/dist/utils/configuration-validator.d.ts +0 -67
- package/dist/utils/configuration-validator.d.ts.map +0 -1
- package/dist/utils/configuration-validator.js +0 -257
- package/dist/utils/configuration-validator.js.map +0 -1
- package/dist/utils/error-handler.d.ts +0 -107
- package/dist/utils/error-handler.d.ts.map +0 -1
- package/dist/utils/error-handler.js +0 -331
- package/dist/utils/error-handler.js.map +0 -1
- package/dist/utils/git-operations.d.ts +0 -200
- package/dist/utils/git-operations.d.ts.map +0 -1
- package/dist/utils/git-operations.js +0 -836
- package/dist/utils/git-operations.js.map +0 -1
- package/dist/utils/multi-provider-error-handler.d.ts +0 -75
- package/dist/utils/multi-provider-error-handler.d.ts.map +0 -1
- package/dist/utils/multi-provider-error-handler.js +0 -276
- package/dist/utils/multi-provider-error-handler.js.map +0 -1
- package/dist/utils/multi-provider-operation-handler.d.ts +0 -113
- package/dist/utils/multi-provider-operation-handler.d.ts.map +0 -1
- package/dist/utils/multi-provider-operation-handler.js +0 -303
- package/dist/utils/multi-provider-operation-handler.js.map +0 -1
- package/dist/utils/provider-operation-handler.d.ts +0 -80
- package/dist/utils/provider-operation-handler.d.ts.map +0 -1
- package/dist/utils/provider-operation-handler.js +0 -201
- package/dist/utils/provider-operation-handler.js.map +0 -1
- package/dist/utils/response-helper.d.ts +0 -57
- package/dist/utils/response-helper.d.ts.map +0 -1
- package/dist/utils/response-helper.js +0 -54
- package/dist/utils/response-helper.js.map +0 -1
- package/dist/utils/user-detection.d.ts +0 -25
- package/dist/utils/user-detection.d.ts.map +0 -1
- package/dist/utils/user-detection.js +0 -54
- package/dist/utils/user-detection.js.map +0 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Andre Buzeli
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,134 +1,188 @@
|
|
|
1
|
-
# MCP
|
|
1
|
+
# GIT MCP Server
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Professional MCP (Model Context Protocol) server for Git operations with multi-provider support.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Features
|
|
6
6
|
|
|
7
|
-
- **
|
|
8
|
-
- **Provider
|
|
9
|
-
- **
|
|
10
|
-
- **
|
|
11
|
-
- **
|
|
7
|
+
- 🚀 **17 Specialized Git Tools** - Complete Git workflow coverage
|
|
8
|
+
- 🔄 **Multi-Provider Support** - GitHub and Gitea simultaneously
|
|
9
|
+
- � **Compatibilidade com IDEs/Clients** - Alguns clientes MCP ou IDEs esperam nomes alternativos para operações de arquivo (ex.: `listFiles`, `getFile`). O servidor mantém a universalidade oferecendo aliases compatíveis além das operações padrão `file-*`.
|
|
10
|
+
- �🛡️ **Production Ready** - Robust validation and error handling
|
|
11
|
+
- 📦 **NPM Distribution** - Easy installation via npx
|
|
12
|
+
- 🤖 **AI Agent Integration** - Designed for AI agent workflows
|
|
12
13
|
|
|
13
|
-
##
|
|
14
|
+
## Quick Start
|
|
15
|
+
|
|
16
|
+
### Installation & Usage
|
|
14
17
|
|
|
15
18
|
```bash
|
|
16
|
-
|
|
19
|
+
# Run directly with npx (recommended)
|
|
20
|
+
npx @andrebuzeli/git-mcp@latest
|
|
21
|
+
|
|
22
|
+
# Or install globally
|
|
23
|
+
npm install -g @andrebuzeli/git-mcp
|
|
24
|
+
git-mcp
|
|
17
25
|
```
|
|
18
26
|
|
|
19
|
-
|
|
27
|
+
### Configuration
|
|
20
28
|
|
|
21
|
-
|
|
29
|
+
Set up your provider credentials via environment variables:
|
|
22
30
|
|
|
23
|
-
|
|
31
|
+
#### GitHub Configuration
|
|
24
32
|
```bash
|
|
25
|
-
GITHUB_TOKEN=
|
|
26
|
-
GITHUB_USERNAME=
|
|
33
|
+
export GITHUB_TOKEN="your_github_token"
|
|
34
|
+
export GITHUB_USERNAME="your_username"
|
|
27
35
|
```
|
|
28
36
|
|
|
29
|
-
|
|
37
|
+
#### Gitea Configuration
|
|
30
38
|
```bash
|
|
31
|
-
GITEA_URL=https://your-gitea.com
|
|
32
|
-
GITEA_TOKEN=
|
|
33
|
-
GITEA_USERNAME=
|
|
39
|
+
export GITEA_URL="https://your-gitea-instance.com"
|
|
40
|
+
export GITEA_TOKEN="your_gitea_token"
|
|
41
|
+
export GITEA_USERNAME="your_username"
|
|
34
42
|
```
|
|
35
43
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
##
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
## 🤖 Uso com Agentes IA
|
|
67
|
-
|
|
68
|
-
### Operações Locais
|
|
69
|
-
```typescript
|
|
70
|
-
// Operações que não precisam de provider
|
|
44
|
+
#### Multi-Provider Support
|
|
45
|
+
Configure both GitHub and Gitea to use `provider="both"` in tool calls.
|
|
46
|
+
|
|
47
|
+
## Available Tools
|
|
48
|
+
|
|
49
|
+
| Tool | Description | Operations |
|
|
50
|
+
|------|-------------|------------|
|
|
51
|
+
| `git-workflow` | Core Git workflow operations | init, commit, sync, status, backup, create, list, get, update, delete, fork, search |
|
|
52
|
+
| `git-files` | File management operations | read, create, update, delete, search, backup, list |
|
|
53
|
+
| `git-branches` | Branch management | create, list, get, delete, merge, compare |
|
|
54
|
+
| `git-issues` | Issue management | create, list, get, update, close, comment, search |
|
|
55
|
+
| `git-pulls` | Pull request management | create, list, get, update, merge, close, review, search |
|
|
56
|
+
| `git-tags` | Tag operations | create, list, get, delete, search |
|
|
57
|
+
| `git-release` | Release management | create, list, get, update, delete, publish, download |
|
|
58
|
+
| `git-remote` | Remote operations | add, remove, rename, show, set-url, prune |
|
|
59
|
+
| `git-reset` | Reset operations | soft, mixed, hard, reset-to-commit, reset-branch |
|
|
60
|
+
| `git-stash` | Stash management | stash, pop, apply, list, show, drop, clear |
|
|
61
|
+
| `git-config` | Git configuration | get, set, unset, list, edit, show |
|
|
62
|
+
| `git-monitor` | Monitoring and logs | log, status, commits, contributors |
|
|
63
|
+
| `git-backup` | Backup system | backup, restore, list, verify |
|
|
64
|
+
| `git-archive` | Archive operations | create, extract, list, verify |
|
|
65
|
+
| `git-packages` | Package management | list, get, create, update, delete, publish, download |
|
|
66
|
+
| `git-analytics` | Analytics and stats | stats, commits, contributors |
|
|
67
|
+
| `git-sync` | Advanced synchronization | sync, status |
|
|
68
|
+
|
|
69
|
+
## Usage Examples
|
|
70
|
+
|
|
71
|
+
### Basic Git Operations
|
|
72
|
+
|
|
73
|
+
```json
|
|
71
74
|
{
|
|
72
|
-
"
|
|
73
|
-
"
|
|
75
|
+
"name": "git-workflow",
|
|
76
|
+
"arguments": {
|
|
77
|
+
"action": "init",
|
|
78
|
+
"projectPath": "/path/to/project"
|
|
79
|
+
}
|
|
74
80
|
}
|
|
75
81
|
```
|
|
76
82
|
|
|
77
|
-
###
|
|
78
|
-
|
|
79
|
-
|
|
83
|
+
### Remote Repository Operations
|
|
84
|
+
|
|
85
|
+
```json
|
|
80
86
|
{
|
|
81
|
-
"
|
|
82
|
-
"
|
|
83
|
-
|
|
84
|
-
|
|
87
|
+
"name": "git-workflow",
|
|
88
|
+
"arguments": {
|
|
89
|
+
"action": "create",
|
|
90
|
+
"projectPath": "/path/to/project",
|
|
91
|
+
"provider": "github",
|
|
92
|
+
"name": "my-new-repo",
|
|
93
|
+
"description": "My new repository",
|
|
94
|
+
"private": false
|
|
95
|
+
}
|
|
85
96
|
}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### Multi-Provider Operations
|
|
86
100
|
|
|
87
|
-
|
|
101
|
+
```json
|
|
88
102
|
{
|
|
89
|
-
"
|
|
90
|
-
"
|
|
91
|
-
|
|
103
|
+
"name": "git-issues",
|
|
104
|
+
"arguments": {
|
|
105
|
+
"action": "create",
|
|
106
|
+
"projectPath": "/path/to/project",
|
|
107
|
+
"provider": "both",
|
|
108
|
+
"title": "Bug Report",
|
|
109
|
+
"body": "Description of the issue"
|
|
110
|
+
}
|
|
92
111
|
}
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### File Management
|
|
93
115
|
|
|
94
|
-
|
|
116
|
+
```json
|
|
95
117
|
{
|
|
96
|
-
"
|
|
97
|
-
"
|
|
98
|
-
|
|
99
|
-
|
|
118
|
+
"name": "git-files",
|
|
119
|
+
"arguments": {
|
|
120
|
+
"action": "create",
|
|
121
|
+
"projectPath": "/path/to/project",
|
|
122
|
+
"provider": "github",
|
|
123
|
+
"path": "src/new-file.js",
|
|
124
|
+
"content": "console.log('Hello World');",
|
|
125
|
+
"message": "Add new file"
|
|
126
|
+
}
|
|
100
127
|
}
|
|
101
128
|
```
|
|
102
129
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
- `
|
|
106
|
-
- `
|
|
130
|
+
## MCP Resources
|
|
131
|
+
|
|
132
|
+
- `mcp-git://status` - Server status and configuration
|
|
133
|
+
- `mcp-git://tools` - List of available tools with detailed information
|
|
134
|
+
|
|
135
|
+
## Error Handling
|
|
136
|
+
|
|
137
|
+
The server provides comprehensive error handling with:
|
|
107
138
|
|
|
108
|
-
|
|
139
|
+
- **Detailed Error Messages** - Clear descriptions of what went wrong
|
|
140
|
+
- **Configuration Guidance** - Instructions for missing setup
|
|
141
|
+
- **Validation Errors** - Specific parameter validation feedback
|
|
142
|
+
- **Troubleshooting Tips** - Actionable suggestions for resolution
|
|
109
143
|
|
|
110
|
-
|
|
111
|
-
- **AutoDetection**: Sistema de descoberta automática
|
|
112
|
-
- **UniversalErrorHandler**: Tratamento padronizado de erros
|
|
113
|
-
- **UniversalResponse**: Formato padronizado de resposta
|
|
144
|
+
## Requirements
|
|
114
145
|
|
|
115
|
-
|
|
146
|
+
- **Node.js** 18.0.0 or higher
|
|
147
|
+
- **Git** installed and accessible in PATH
|
|
148
|
+
- **Provider Credentials** (GitHub token, Gitea token) for remote operations
|
|
149
|
+
|
|
150
|
+
## Development
|
|
151
|
+
|
|
152
|
+
### Local Development
|
|
116
153
|
|
|
117
154
|
```bash
|
|
118
|
-
#
|
|
155
|
+
# Clone the repository
|
|
156
|
+
git clone https://github.com/andrebuzeli/git-mcp.git
|
|
157
|
+
cd git-mcp
|
|
158
|
+
|
|
159
|
+
# Install dependencies
|
|
119
160
|
npm install
|
|
120
161
|
|
|
121
|
-
# Build
|
|
162
|
+
# Build the project
|
|
122
163
|
npm run build
|
|
123
164
|
|
|
124
|
-
#
|
|
165
|
+
# Run locally
|
|
166
|
+
npm start
|
|
167
|
+
|
|
168
|
+
# Development mode with auto-reload
|
|
125
169
|
npm run dev
|
|
126
170
|
```
|
|
127
171
|
|
|
128
|
-
|
|
172
|
+
### Testing
|
|
173
|
+
|
|
174
|
+
```bash
|
|
175
|
+
# Run tests
|
|
176
|
+
npm test
|
|
177
|
+
|
|
178
|
+
# Run tests in watch mode
|
|
179
|
+
npm run test:watch
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
## License
|
|
129
183
|
|
|
130
|
-
MIT
|
|
184
|
+
MIT License - see [LICENSE](LICENSE) file for details.
|
|
131
185
|
|
|
132
|
-
##
|
|
186
|
+
## Contributing
|
|
133
187
|
|
|
134
|
-
|
|
188
|
+
Contributions are welcome! Please read our contributing guidelines and submit pull requests.
|
package/dist/config.d.ts
CHANGED
|
@@ -1,77 +1,78 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
1
|
/**
|
|
3
|
-
*
|
|
2
|
+
* Configuration Management
|
|
3
|
+
*
|
|
4
|
+
* Handles environment variable configuration for GitHub and Gitea providers.
|
|
5
|
+
* Provides validation and auto-detection utilities.
|
|
4
6
|
*/
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
githubToken?: string | undefined;
|
|
36
|
-
githubUsername?: string | undefined;
|
|
37
|
-
provider?: "gitea" | "github" | undefined;
|
|
38
|
-
apiUrl?: string | undefined;
|
|
39
|
-
apiToken?: string | undefined;
|
|
40
|
-
defaultProvider?: string | undefined;
|
|
41
|
-
providersJson?: string | undefined;
|
|
42
|
-
debug?: boolean | undefined;
|
|
43
|
-
timeout?: number | undefined;
|
|
44
|
-
}>;
|
|
45
|
-
type Config = z.infer<typeof ConfigSchema>;
|
|
46
|
-
/**
|
|
47
|
-
* Gerenciador de configuração usando padrão Singleton
|
|
48
|
-
*/
|
|
49
|
-
declare class ConfigManager {
|
|
50
|
-
private static instance;
|
|
7
|
+
export interface GitMCPConfig {
|
|
8
|
+
github?: {
|
|
9
|
+
token: string;
|
|
10
|
+
username: string;
|
|
11
|
+
};
|
|
12
|
+
gitea?: {
|
|
13
|
+
url: string;
|
|
14
|
+
token: string;
|
|
15
|
+
username: string;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export interface ProjectContext {
|
|
19
|
+
projectPath: string;
|
|
20
|
+
repositoryName: string;
|
|
21
|
+
isGitRepository: boolean;
|
|
22
|
+
remoteOrigin?: string;
|
|
23
|
+
currentBranch?: string;
|
|
24
|
+
detectedProvider?: string;
|
|
25
|
+
}
|
|
26
|
+
export interface ConfigValidationResult {
|
|
27
|
+
isValid: boolean;
|
|
28
|
+
errors: string[];
|
|
29
|
+
warnings: string[];
|
|
30
|
+
missingEnvVars: string[];
|
|
31
|
+
configurationGuide?: {
|
|
32
|
+
requiredEnvVars: string[];
|
|
33
|
+
exampleConfig: Record<string, string>;
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
export declare class ConfigManager {
|
|
51
37
|
private config;
|
|
52
38
|
constructor();
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
39
|
+
private loadConfiguration;
|
|
40
|
+
getConfig(): GitMCPConfig;
|
|
41
|
+
isGitHubConfigured(): boolean;
|
|
42
|
+
isGiteaConfigured(): boolean;
|
|
43
|
+
getConfigurationStatus(): Record<string, string>;
|
|
44
|
+
/**
|
|
45
|
+
* Validates GitHub and Gitea credentials
|
|
46
|
+
*/
|
|
47
|
+
validateCredentials(): ConfigValidationResult;
|
|
48
|
+
/**
|
|
49
|
+
* Auto-detects project context from projectPath
|
|
50
|
+
*/
|
|
51
|
+
detectProjectContext(projectPath: string): ProjectContext;
|
|
52
|
+
/**
|
|
53
|
+
* Auto-detects username/owner from environment variables
|
|
54
|
+
*/
|
|
55
|
+
autoDetectUsername(provider: 'github' | 'gitea'): string | undefined;
|
|
56
|
+
/**
|
|
57
|
+
* Gets provider configuration for a specific provider
|
|
58
|
+
*/
|
|
59
|
+
getProviderConfig(provider: 'github' | 'gitea'): {
|
|
60
|
+
token: string;
|
|
61
|
+
username: string;
|
|
62
|
+
} | undefined;
|
|
63
|
+
/**
|
|
64
|
+
* Checks if a provider is supported for operations
|
|
65
|
+
*/
|
|
66
|
+
isProviderSupported(provider: 'github' | 'gitea' | 'both'): boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Gets configuration guidance for missing setup
|
|
69
|
+
*/
|
|
70
|
+
getConfigurationGuidance(): {
|
|
71
|
+
requiredEnvVars: string[];
|
|
72
|
+
exampleConfig: Record<string, string>;
|
|
73
|
+
setupInstructions: string[];
|
|
74
|
+
};
|
|
71
75
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
*/
|
|
75
|
-
export declare const config: ConfigManager;
|
|
76
|
-
export {};
|
|
76
|
+
export declare const configManager: ConfigManager;
|
|
77
|
+
export declare function getProviderConfig(): GitMCPConfig;
|
|
77
78
|
//# sourceMappingURL=config.d.ts.map
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,MAAM,WAAW,YAAY;IAC3B,MAAM,CAAC,EAAE;QACP,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,KAAK,CAAC,EAAE;QACN,GAAG,EAAE,MAAM,CAAC;QACZ,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC;CACH;AAED,MAAM,WAAW,cAAc;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,OAAO,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,kBAAkB,CAAC,EAAE;QACnB,eAAe,EAAE,MAAM,EAAE,CAAC;QAC1B,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KACvC,CAAC;CACH;AAED,qBAAa,aAAa;IACxB,OAAO,CAAC,MAAM,CAAe;;IAM7B,OAAO,CAAC,iBAAiB;IAuBlB,SAAS,IAAI,YAAY;IAIzB,kBAAkB,IAAI,OAAO;IAI7B,iBAAiB,IAAI,OAAO;IAI5B,sBAAsB,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAOvD;;OAEG;IACI,mBAAmB,IAAI,sBAAsB;IA2DpD;;OAEG;IACI,oBAAoB,CAAC,WAAW,EAAE,MAAM,GAAG,cAAc;IAgDhE;;OAEG;IACI,kBAAkB,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS;IAU3E;;OAEG;IACI,iBAAiB,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO;eAhN5C,MAAM;kBACH,MAAM;;IAmNlB;;OAEG;IACI,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,OAAO;IAO1E;;OAEG;IACI,wBAAwB,IAAI;QACjC,eAAe,EAAE,MAAM,EAAE,CAAC;QAC1B,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACtC,iBAAiB,EAAE,MAAM,EAAE,CAAC;KAC7B;CAqBF;AAGD,eAAO,MAAM,aAAa,eAAsB,CAAC;AAEjD,wBAAgB,iBAAiB,IAAI,YAAY,CAEhD"}
|