@andrebuzeli/git-mcp 5.5.1 → 5.8.0
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/README.md +94 -6
- package/dist/config.d.ts +5 -131
- package/dist/config.js +28 -430
- package/dist/index.d.ts +1 -21
- package/dist/index.js +118 -140
- package/dist/providers/giteaProvider.d.ts +3 -0
- package/dist/providers/giteaProvider.js +12 -0
- package/dist/providers/githubProvider.d.ts +2 -0
- package/dist/providers/githubProvider.js +7 -0
- package/dist/providers/providerManager.d.ts +11 -0
- package/dist/providers/providerManager.js +48 -0
- package/dist/resources/toolsGuide.d.ts +12 -0
- package/dist/resources/toolsGuide.js +1491 -0
- package/dist/server.d.ts +7 -40
- package/dist/server.js +59 -696
- package/dist/tools/gitAnalytics.d.ts +29 -0
- package/dist/tools/gitAnalytics.js +72 -0
- package/dist/tools/gitArchive.d.ts +6 -0
- package/dist/tools/gitArchive.js +27 -0
- package/dist/tools/gitBackup.d.ts +10 -0
- package/dist/tools/gitBackup.js +44 -0
- package/dist/tools/gitBranches.d.ts +72 -0
- package/dist/tools/gitBranches.js +98 -0
- package/dist/tools/gitConfig.d.ts +34 -0
- package/dist/tools/gitConfig.js +73 -0
- package/dist/tools/gitFiles.d.ts +30 -0
- package/dist/tools/gitFiles.js +55 -0
- package/dist/tools/gitHistory.d.ts +17 -0
- package/dist/tools/gitHistory.js +365 -0
- package/dist/tools/gitIssues.d.ts +6 -0
- package/dist/tools/gitIssues.js +279 -0
- package/dist/tools/gitMonitor.d.ts +51 -0
- package/dist/tools/gitMonitor.js +102 -0
- package/dist/tools/gitPackages.d.ts +6 -0
- package/dist/tools/gitPackages.js +28 -0
- package/dist/tools/gitPulls.d.ts +6 -0
- package/dist/tools/gitPulls.js +288 -0
- package/dist/tools/gitRelease.d.ts +6 -0
- package/dist/tools/gitRelease.js +321 -0
- package/dist/tools/gitRemote.d.ts +51 -0
- package/dist/tools/gitRemote.js +68 -0
- package/dist/tools/gitReset.d.ts +34 -0
- package/dist/tools/gitReset.js +64 -0
- package/dist/tools/gitStash.d.ts +41 -0
- package/dist/tools/gitStash.js +67 -0
- package/dist/tools/gitSync.d.ts +25 -0
- package/dist/tools/gitSync.js +51 -0
- package/dist/tools/gitTags.d.ts +30 -0
- package/dist/tools/gitTags.js +69 -0
- package/dist/tools/gitUpdate.d.ts +14 -0
- package/dist/tools/gitUpdate.js +374 -0
- package/dist/tools/gitUpload.d.ts +11 -0
- package/dist/tools/gitUpload.js +342 -0
- package/dist/tools/gitWorkflow.d.ts +6 -0
- package/dist/tools/gitWorkflow.js +303 -0
- package/dist/types.d.ts +17 -0
- package/dist/types.js +2 -0
- package/dist/utils/errors.d.ts +13 -0
- package/dist/utils/errors.js +22 -0
- package/dist/utils/safetyController.d.ts +1 -0
- package/dist/utils/safetyController.js +15 -0
- package/package.json +8 -3
- package/dist/config.d.ts.map +0 -1
- package/dist/config.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/providers/base-provider.d.ts +0 -66
- package/dist/providers/base-provider.d.ts.map +0 -1
- package/dist/providers/base-provider.js +0 -65
- package/dist/providers/base-provider.js.map +0 -1
- package/dist/providers/gitea-provider.d.ts +0 -79
- package/dist/providers/gitea-provider.d.ts.map +0 -1
- package/dist/providers/gitea-provider.js +0 -576
- package/dist/providers/gitea-provider.js.map +0 -1
- package/dist/providers/github-provider.d.ts +0 -74
- package/dist/providers/github-provider.d.ts.map +0 -1
- package/dist/providers/github-provider.js +0 -683
- package/dist/providers/github-provider.js.map +0 -1
- package/dist/providers/index.d.ts +0 -13
- package/dist/providers/index.d.ts.map +0 -1
- package/dist/providers/index.js +0 -35
- package/dist/providers/index.js.map +0 -1
- package/dist/providers/provider-factory.d.ts +0 -49
- package/dist/providers/provider-factory.d.ts.map +0 -1
- package/dist/providers/provider-factory.js +0 -193
- package/dist/providers/provider-factory.js.map +0 -1
- package/dist/providers/provider-operation-handler.d.ts +0 -115
- package/dist/providers/provider-operation-handler.d.ts.map +0 -1
- package/dist/providers/provider-operation-handler.js +0 -449
- package/dist/providers/provider-operation-handler.js.map +0 -1
- package/dist/providers/types.d.ts +0 -200
- package/dist/providers/types.d.ts.map +0 -1
- package/dist/providers/types.js +0 -8
- package/dist/providers/types.js.map +0 -1
- package/dist/server.d.ts.map +0 -1
- package/dist/server.js.map +0 -1
- package/dist/tools/git-analytics.d.ts +0 -237
- package/dist/tools/git-analytics.d.ts.map +0 -1
- package/dist/tools/git-analytics.js +0 -819
- package/dist/tools/git-analytics.js.map +0 -1
- package/dist/tools/git-archive.d.ts +0 -113
- package/dist/tools/git-archive.d.ts.map +0 -1
- package/dist/tools/git-archive.js +0 -466
- package/dist/tools/git-archive.js.map +0 -1
- package/dist/tools/git-auto-monitor.d.ts +0 -180
- package/dist/tools/git-auto-monitor.d.ts.map +0 -1
- package/dist/tools/git-auto-monitor.js +0 -522
- package/dist/tools/git-auto-monitor.js.map +0 -1
- package/dist/tools/git-backup.d.ts +0 -105
- package/dist/tools/git-backup.d.ts.map +0 -1
- package/dist/tools/git-backup.js +0 -414
- package/dist/tools/git-backup.js.map +0 -1
- package/dist/tools/git-branches.d.ts +0 -183
- package/dist/tools/git-branches.d.ts.map +0 -1
- package/dist/tools/git-branches.js +0 -498
- package/dist/tools/git-branches.js.map +0 -1
- package/dist/tools/git-config.d.ts +0 -119
- package/dist/tools/git-config.d.ts.map +0 -1
- package/dist/tools/git-config.js +0 -449
- package/dist/tools/git-config.js.map +0 -1
- package/dist/tools/git-files.d.ts +0 -150
- package/dist/tools/git-files.d.ts.map +0 -1
- package/dist/tools/git-files.js +0 -527
- package/dist/tools/git-files.js.map +0 -1
- package/dist/tools/git-history.d.ts +0 -253
- package/dist/tools/git-history.d.ts.map +0 -1
- package/dist/tools/git-history.js +0 -824
- package/dist/tools/git-history.js.map +0 -1
- package/dist/tools/git-issues.d.ts +0 -164
- package/dist/tools/git-issues.d.ts.map +0 -1
- package/dist/tools/git-issues.js +0 -340
- package/dist/tools/git-issues.js.map +0 -1
- package/dist/tools/git-monitor.d.ts +0 -154
- package/dist/tools/git-monitor.d.ts.map +0 -1
- package/dist/tools/git-monitor.js +0 -531
- package/dist/tools/git-monitor.js.map +0 -1
- package/dist/tools/git-packages.d.ts +0 -157
- package/dist/tools/git-packages.d.ts.map +0 -1
- package/dist/tools/git-packages.js +0 -534
- package/dist/tools/git-packages.js.map +0 -1
- package/dist/tools/git-pulls.d.ts +0 -180
- package/dist/tools/git-pulls.d.ts.map +0 -1
- package/dist/tools/git-pulls.js +0 -369
- package/dist/tools/git-pulls.js.map +0 -1
- package/dist/tools/git-release.d.ts +0 -161
- package/dist/tools/git-release.d.ts.map +0 -1
- package/dist/tools/git-release.js +0 -466
- package/dist/tools/git-release.js.map +0 -1
- package/dist/tools/git-remote.d.ts +0 -128
- package/dist/tools/git-remote.d.ts.map +0 -1
- package/dist/tools/git-remote.js +0 -542
- package/dist/tools/git-remote.js.map +0 -1
- package/dist/tools/git-reset.d.ts +0 -120
- package/dist/tools/git-reset.d.ts.map +0 -1
- package/dist/tools/git-reset.js +0 -479
- package/dist/tools/git-reset.js.map +0 -1
- package/dist/tools/git-stash.d.ts +0 -124
- package/dist/tools/git-stash.d.ts.map +0 -1
- package/dist/tools/git-stash.js +0 -506
- package/dist/tools/git-stash.js.map +0 -1
- package/dist/tools/git-sync.d.ts +0 -154
- package/dist/tools/git-sync.d.ts.map +0 -1
- package/dist/tools/git-sync.js +0 -479
- package/dist/tools/git-sync.js.map +0 -1
- package/dist/tools/git-tags.d.ts +0 -136
- package/dist/tools/git-tags.d.ts.map +0 -1
- package/dist/tools/git-tags.js +0 -461
- package/dist/tools/git-tags.js.map +0 -1
- package/dist/tools/git-update.d.ts +0 -224
- package/dist/tools/git-update.d.ts.map +0 -1
- package/dist/tools/git-update.js +0 -948
- package/dist/tools/git-update.js.map +0 -1
- package/dist/tools/git-workflow.d.ts +0 -189
- package/dist/tools/git-workflow.d.ts.map +0 -1
- package/dist/tools/git-workflow.js +0 -542
- package/dist/tools/git-workflow.js.map +0 -1
- package/dist/utils/credential-manager.d.ts +0 -119
- package/dist/utils/credential-manager.d.ts.map +0 -1
- package/dist/utils/credential-manager.js +0 -450
- package/dist/utils/credential-manager.js.map +0 -1
- package/dist/utils/data-merger.d.ts +0 -49
- package/dist/utils/data-merger.d.ts.map +0 -1
- package/dist/utils/data-merger.js +0 -233
- package/dist/utils/data-merger.js.map +0 -1
- package/dist/utils/git-command-executor.d.ts +0 -330
- package/dist/utils/git-command-executor.d.ts.map +0 -1
- package/dist/utils/git-command-executor.js +0 -901
- package/dist/utils/git-command-executor.js.map +0 -1
- package/dist/utils/logger.d.ts +0 -143
- package/dist/utils/logger.d.ts.map +0 -1
- package/dist/utils/logger.js +0 -473
- package/dist/utils/logger.js.map +0 -1
- package/dist/utils/operation-error-handler.d.ts +0 -97
- package/dist/utils/operation-error-handler.d.ts.map +0 -1
- package/dist/utils/operation-error-handler.js +0 -367
- package/dist/utils/operation-error-handler.js.map +0 -1
- package/dist/utils/parameter-validator.d.ts +0 -49
- package/dist/utils/parameter-validator.d.ts.map +0 -1
- package/dist/utils/parameter-validator.js +0 -647
- package/dist/utils/parameter-validator.js.map +0 -1
- package/dist/utils/repository-checker.d.ts +0 -46
- package/dist/utils/repository-checker.d.ts.map +0 -1
- package/dist/utils/repository-checker.js +0 -151
- package/dist/utils/repository-checker.js.map +0 -1
- package/dist/utils/repository-detector.d.ts +0 -128
- package/dist/utils/repository-detector.d.ts.map +0 -1
- package/dist/utils/repository-detector.js +0 -422
- package/dist/utils/repository-detector.js.map +0 -1
- package/dist/utils/repository-sync.d.ts +0 -67
- package/dist/utils/repository-sync.d.ts.map +0 -1
- package/dist/utils/repository-sync.js +0 -344
- package/dist/utils/repository-sync.js.map +0 -1
- package/dist/utils/response-formatter.d.ts +0 -146
- package/dist/utils/response-formatter.d.ts.map +0 -1
- package/dist/utils/response-formatter.js +0 -378
- package/dist/utils/response-formatter.js.map +0 -1
- package/dist/utils/retry.d.ts +0 -12
- package/dist/utils/retry.d.ts.map +0 -1
- package/dist/utils/retry.js +0 -28
- package/dist/utils/retry.js.map +0 -1
- package/dist/utils/safety-warnings.d.ts +0 -56
- package/dist/utils/safety-warnings.d.ts.map +0 -1
- package/dist/utils/safety-warnings.js +0 -330
- package/dist/utils/safety-warnings.js.map +0 -1
- package/dist/utils/terminal-controller.d.ts +0 -79
- package/dist/utils/terminal-controller.d.ts.map +0 -1
- package/dist/utils/terminal-controller.js +0 -291
- package/dist/utils/terminal-controller.js.map +0 -1
- package/dist/utils/user-friendly-formatter.d.ts +0 -45
- package/dist/utils/user-friendly-formatter.d.ts.map +0 -1
- package/dist/utils/user-friendly-formatter.js +0 -175
- package/dist/utils/user-friendly-formatter.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
# GIT MCP Server
|
|
2
2
|
|
|
3
|
-
Professional MCP (Model Context Protocol) server for Git operations with multi-provider support, enhanced security,
|
|
3
|
+
Professional MCP (Model Context Protocol) server for Git operations with multi-provider support, enhanced security, comprehensive safety features, and **self-documenting resources**.
|
|
4
4
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
7
|
-
- 🚀 **
|
|
8
|
-
-
|
|
7
|
+
- 🚀 **20 Specialized Git Tools** - Complete Git workflow coverage with safety warnings
|
|
8
|
+
- 📚 **NEW: Self-Documenting Resources** - Complete documentation via MCP protocol
|
|
9
|
+
- ⚡ **3 Powerful Tools with Full Traceability**
|
|
10
|
+
- **git-upload** - Upload complete projects to GitHub + Gitea automatically
|
|
11
|
+
- **git-update** - Complete update workflow (add + commit + push) with tracking
|
|
12
|
+
- **git-history** - Detailed history tracking with remote issues
|
|
13
|
+
- 🔄 **Dual Provider Support** - GitHub and Gitea with automatic dual execution
|
|
9
14
|
- 🔒 **Security-First Design** - Read-only file operations, no content modification via API
|
|
10
15
|
- 🚨 **Safety Warnings** - Comprehensive warnings for destructive operations
|
|
11
16
|
- 🛡️ **Enhanced Error Handling** - Detailed diagnostics with actionable solutions
|
|
@@ -13,6 +18,49 @@ Professional MCP (Model Context Protocol) server for Git operations with multi-p
|
|
|
13
18
|
- 🔧 **IDE/Client Compatibility** - Universal aliases for different MCP client expectations
|
|
14
19
|
- 📦 **NPM Distribution** - Easy installation via npx
|
|
15
20
|
- 🤖 **AI Agent Integration** - Designed for AI agent workflows with safety controls
|
|
21
|
+
- 📊 **Full Traceability** - Every operation tracked locally and remotely
|
|
22
|
+
|
|
23
|
+
## Resources System
|
|
24
|
+
|
|
25
|
+
Git-MCP v5.7.0 includes a comprehensive **Resources** system that provides detailed documentation directly through the MCP protocol:
|
|
26
|
+
|
|
27
|
+
### Available Resources
|
|
28
|
+
|
|
29
|
+
#### Tools Guide Resource
|
|
30
|
+
- **URI:** `git-mcp://tools/guide`
|
|
31
|
+
- **Format:** Markdown
|
|
32
|
+
- **Content:** Complete documentation for all 20 tools with 102 actions
|
|
33
|
+
- **Size:** 35,000+ characters
|
|
34
|
+
|
|
35
|
+
### Accessing Documentation
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
# List all available resources
|
|
39
|
+
curl http://localhost:3210/resources
|
|
40
|
+
|
|
41
|
+
# Get complete tools guide
|
|
42
|
+
curl "http://localhost:3210/resources/git-mcp://tools/guide"
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### What's Included
|
|
46
|
+
|
|
47
|
+
- ✅ Quick start guide
|
|
48
|
+
- ✅ All 20 tools documented with examples
|
|
49
|
+
- ✅ 102 actions with parameters
|
|
50
|
+
- ✅ Provider types explained (LOCAL/DUAL/HYBRID)
|
|
51
|
+
- ✅ Best practices and workflows
|
|
52
|
+
- ✅ Troubleshooting guide
|
|
53
|
+
- ✅ Complete reference tables
|
|
54
|
+
|
|
55
|
+
**See [RESOURCES.md](RESOURCES.md) for detailed documentation on the resources system.**
|
|
56
|
+
|
|
57
|
+
## Provider Architecture
|
|
58
|
+
|
|
59
|
+
This MCP server supports **2 providers** (for remote API operations only):
|
|
60
|
+
- **`github`** - GitHub remote operations (issues, PRs, releases) via @octokit/rest
|
|
61
|
+
- **`gitea`** - Gitea remote operations (issues, PRs, releases) via axios to nas-ubuntu:3000
|
|
62
|
+
|
|
63
|
+
**Important**: Local Git operations (commit, branch, tag, stash, etc) use `simple-git` directly and do **NOT** require a `provider` parameter. The `provider` parameter is only needed for remote API operations (issues, PRs, releases, etc). Gitea as a provider is only for remote API calls, not for local Git operations.
|
|
16
64
|
|
|
17
65
|
## Quick Start
|
|
18
66
|
|
|
@@ -44,8 +92,15 @@ export GITEA_TOKEN="your_gitea_token"
|
|
|
44
92
|
export GITEA_USERNAME="your_username"
|
|
45
93
|
```
|
|
46
94
|
|
|
95
|
+
PowerShell (Windows) example - session only:
|
|
96
|
+
```powershell
|
|
97
|
+
$env:GITEA_URL = 'https://your-gitea-instance.com'
|
|
98
|
+
$env:GITEA_TOKEN = 'your_gitea_token'
|
|
99
|
+
$env:GITEA_USERNAME = 'your_username'
|
|
100
|
+
```
|
|
101
|
+
|
|
47
102
|
#### Multi-Provider Support
|
|
48
|
-
|
|
103
|
+
You can configure both GitHub and Gitea simultaneously. Use `provider="github"` or `provider="gitea"` in tool calls to specify which provider to use for remote operations.
|
|
49
104
|
|
|
50
105
|
## Available Tools
|
|
51
106
|
|
|
@@ -169,14 +224,13 @@ All tools provide detailed error messages with actionable solutions:
|
|
|
169
224
|
}
|
|
170
225
|
```
|
|
171
226
|
|
|
172
|
-
### Remote Repository Operations
|
|
227
|
+
### Remote Repository Operations (GitHub Example)
|
|
173
228
|
|
|
174
229
|
```json
|
|
175
230
|
{
|
|
176
231
|
"tool": "git-workflow",
|
|
177
232
|
"params": {
|
|
178
233
|
"action": "create",
|
|
179
|
-
"projectPath": "/path/to/project",
|
|
180
234
|
"provider": "github",
|
|
181
235
|
"name": "my-new-repo",
|
|
182
236
|
"description": "My new repository",
|
|
@@ -185,6 +239,22 @@ All tools provide detailed error messages with actionable solutions:
|
|
|
185
239
|
}
|
|
186
240
|
```
|
|
187
241
|
|
|
242
|
+
### Remote Repository Operations (Gitea Example)
|
|
243
|
+
|
|
244
|
+
```json
|
|
245
|
+
{
|
|
246
|
+
"tool": "git-issues",
|
|
247
|
+
"params": {
|
|
248
|
+
"action": "create",
|
|
249
|
+
"provider": "gitea",
|
|
250
|
+
"owner": "your-username",
|
|
251
|
+
"repo": "your-repo",
|
|
252
|
+
"title": "Bug report",
|
|
253
|
+
"body": "Description of the issue"
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
```
|
|
257
|
+
|
|
188
258
|
### Safe File Operations (Read-Only)
|
|
189
259
|
|
|
190
260
|
```json
|
|
@@ -277,6 +347,24 @@ The server automatically validates credentials on startup:
|
|
|
277
347
|
npx @andrebuzeli/git-mcp@latest
|
|
278
348
|
```
|
|
279
349
|
|
|
350
|
+
Optional: use a local `mcp.json` (NOT committed) to keep credentials for local testing.
|
|
351
|
+
|
|
352
|
+
1. Create `mcp.json` next to package.json with this shape (use the `.example` as a starting point):
|
|
353
|
+
|
|
354
|
+
```json
|
|
355
|
+
{
|
|
356
|
+
"env": {
|
|
357
|
+
"GITEA_URL": "http://nas-ubuntu:3000",
|
|
358
|
+
"GITEA_TOKEN": "<GITEA_TOKEN>",
|
|
359
|
+
"GITEA_USERNAME": "<GITEA_USERNAME>",
|
|
360
|
+
"GITHUB_TOKEN": "<GITHUB_TOKEN>",
|
|
361
|
+
"GITHUB_USERNAME": "<GITHUB_USERNAME>"
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
```
|
|
365
|
+
|
|
366
|
+
Security note: do NOT commit `mcp.json` with real tokens. The repository's `.gitignore` includes `mcp.json` to help avoid leaks.
|
|
367
|
+
|
|
280
368
|
## Troubleshooting
|
|
281
369
|
|
|
282
370
|
### Common Issues
|
package/dist/config.d.ts
CHANGED
|
@@ -1,131 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
*/
|
|
7
|
-
export type GitMCPMode = 'normal' | 'universal';
|
|
8
|
-
export interface GitMCPConfig {
|
|
9
|
-
mode: GitMCPMode;
|
|
10
|
-
github?: {
|
|
11
|
-
token: string;
|
|
12
|
-
username: string;
|
|
13
|
-
};
|
|
14
|
-
gitea?: {
|
|
15
|
-
url: string;
|
|
16
|
-
token: string;
|
|
17
|
-
username: string;
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
export interface ProjectContext {
|
|
21
|
-
projectPath: string;
|
|
22
|
-
repositoryName: string;
|
|
23
|
-
isGitRepository: boolean;
|
|
24
|
-
remoteOrigin?: string;
|
|
25
|
-
currentBranch?: string;
|
|
26
|
-
detectedProvider?: string;
|
|
27
|
-
}
|
|
28
|
-
export interface ConfigValidationResult {
|
|
29
|
-
isValid: boolean;
|
|
30
|
-
errors: string[];
|
|
31
|
-
warnings: string[];
|
|
32
|
-
missingEnvVars: string[];
|
|
33
|
-
configurationGuide?: {
|
|
34
|
-
requiredEnvVars: string[];
|
|
35
|
-
exampleConfig: Record<string, string>;
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
export interface DetailedValidationResult {
|
|
39
|
-
isValid: boolean;
|
|
40
|
-
providerResults: {
|
|
41
|
-
github?: ProviderValidationResult;
|
|
42
|
-
gitea?: ProviderValidationResult;
|
|
43
|
-
};
|
|
44
|
-
summary: {
|
|
45
|
-
totalProviders: number;
|
|
46
|
-
validProviders: number;
|
|
47
|
-
errors: string[];
|
|
48
|
-
warnings: string[];
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
export interface ProviderValidationResult {
|
|
52
|
-
provider: 'github' | 'gitea';
|
|
53
|
-
isValid: boolean;
|
|
54
|
-
isConfigured: boolean;
|
|
55
|
-
credentialStatus: 'valid' | 'invalid' | 'missing' | 'network_error';
|
|
56
|
-
errorDetails?: string;
|
|
57
|
-
userInfo?: {
|
|
58
|
-
username: string;
|
|
59
|
-
displayName?: string;
|
|
60
|
-
email?: string;
|
|
61
|
-
};
|
|
62
|
-
permissions?: string[];
|
|
63
|
-
rateLimit?: {
|
|
64
|
-
limit: number;
|
|
65
|
-
remaining: number;
|
|
66
|
-
reset: Date;
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
export declare class ConfigManager {
|
|
70
|
-
private config;
|
|
71
|
-
constructor();
|
|
72
|
-
private loadConfiguration;
|
|
73
|
-
getConfig(): GitMCPConfig;
|
|
74
|
-
isGitHubConfigured(): boolean;
|
|
75
|
-
isGiteaConfigured(): boolean;
|
|
76
|
-
getConfigurationStatus(): Record<string, string>;
|
|
77
|
-
/**
|
|
78
|
-
* Gets the current operation mode
|
|
79
|
-
*/
|
|
80
|
-
getMode(): GitMCPMode;
|
|
81
|
-
/**
|
|
82
|
-
* Checks if universal mode is enabled
|
|
83
|
-
*/
|
|
84
|
-
isUniversalMode(): boolean;
|
|
85
|
-
/**
|
|
86
|
-
* Validates GitHub and Gitea credentials
|
|
87
|
-
*/
|
|
88
|
-
validateCredentials(): ConfigValidationResult;
|
|
89
|
-
/**
|
|
90
|
-
* Auto-detects project context from projectPath
|
|
91
|
-
*/
|
|
92
|
-
detectProjectContext(projectPath: string): ProjectContext;
|
|
93
|
-
/**
|
|
94
|
-
* Auto-detects username/owner from environment variables
|
|
95
|
-
*/
|
|
96
|
-
autoDetectUsername(provider: 'github' | 'gitea'): string | undefined;
|
|
97
|
-
/**
|
|
98
|
-
* Gets provider configuration for a specific provider
|
|
99
|
-
*/
|
|
100
|
-
getProviderConfig(provider: 'github' | 'gitea'): {
|
|
101
|
-
token: string;
|
|
102
|
-
username: string;
|
|
103
|
-
} | undefined;
|
|
104
|
-
/**
|
|
105
|
-
* Checks if a provider is supported for operations
|
|
106
|
-
*/
|
|
107
|
-
isProviderSupported(provider: 'github' | 'gitea' | 'both'): boolean;
|
|
108
|
-
/**
|
|
109
|
-
* Validates credentials with detailed testing of API connectivity
|
|
110
|
-
*/
|
|
111
|
-
validateCredentialsDetailed(): Promise<DetailedValidationResult>;
|
|
112
|
-
/**
|
|
113
|
-
* Validates GitHub credentials with API test
|
|
114
|
-
*/
|
|
115
|
-
private validateGitHubCredentials;
|
|
116
|
-
/**
|
|
117
|
-
* Validates Gitea credentials with API test
|
|
118
|
-
*/
|
|
119
|
-
private validateGiteaCredentials;
|
|
120
|
-
/**
|
|
121
|
-
* Gets configuration guidance for missing setup
|
|
122
|
-
*/
|
|
123
|
-
getConfigurationGuidance(): {
|
|
124
|
-
requiredEnvVars: string[];
|
|
125
|
-
exampleConfig: Record<string, string>;
|
|
126
|
-
setupInstructions: string[];
|
|
127
|
-
};
|
|
128
|
-
}
|
|
129
|
-
export declare const configManager: ConfigManager;
|
|
130
|
-
export declare function getProviderConfig(): GitMCPConfig;
|
|
131
|
-
//# sourceMappingURL=config.d.ts.map
|
|
1
|
+
export type MCPConfig = {
|
|
2
|
+
env?: Record<string, string>;
|
|
3
|
+
[k: string]: any;
|
|
4
|
+
};
|
|
5
|
+
export declare function loadMCPConfig(configPath?: string): MCPConfig | null;
|