@andrebuzeli/git-mcp 11.0.4 → 12.0.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 +39 -47
- package/package.json +24 -19
- package/src/index.js +84 -0
- package/src/providers/providerManager.js +107 -0
- package/src/tools/git-branches.js +63 -0
- package/src/tools/git-config.js +53 -0
- package/src/tools/git-files.js +41 -0
- package/src/tools/git-history.js +36 -0
- package/src/tools/git-ignore.js +48 -0
- package/src/tools/git-issues.js +58 -12
- package/src/tools/git-pulls.js +61 -0
- package/src/tools/git-remote.js +182 -29
- package/src/tools/git-reset.js +35 -0
- package/src/tools/git-stash.js +57 -0
- package/src/tools/git-sync.js +44 -40
- package/src/tools/git-tags.js +58 -0
- package/src/tools/git-workflow.js +85 -0
- package/src/utils/errors.js +22 -0
- package/src/utils/gitAdapter.js +116 -0
- package/src/utils/providerExec.js +13 -0
- package/src/utils/repoHelpers.js +25 -0
- package/src/utils/retry.js +12 -0
- package/bin/git-mcp.js +0 -21
- package/docs/TOOLS.md +0 -110
- package/mcp.json.template +0 -12
- package/src/local/git.js +0 -14
- package/src/providers/gitea.js +0 -13
- package/src/providers/github.js +0 -13
- package/src/server.js +0 -115
- package/src/tools/git-actions.js +0 -19
- package/src/tools/git-activity.js +0 -28
- package/src/tools/git-admin.js +0 -20
- package/src/tools/git-checks.js +0 -14
- package/src/tools/git-commits.js +0 -34
- package/src/tools/git-contents.js +0 -30
- package/src/tools/git-deployments.js +0 -21
- package/src/tools/git-gists.js +0 -15
- package/src/tools/git-gitdata.js +0 -19
- package/src/tools/git-issues-prs.js +0 -44
- package/src/tools/git-local.js +0 -66
- package/src/tools/git-meta.js +0 -19
- package/src/tools/git-misc.js +0 -21
- package/src/tools/git-orgs.js +0 -26
- package/src/tools/git-packages.js +0 -12
- package/src/tools/git-raw.js +0 -14
- package/src/tools/git-releases.js +0 -17
- package/src/tools/git-repos.js +0 -60
- package/src/tools/git-search.js +0 -18
- package/src/tools/git-user.js +0 -26
- package/src/tools/schema.js +0 -3
- package/src/utils/fs.js +0 -29
- package/src/utils/project.js +0 -7
- package/tests/errors.js +0 -26
- package/tests/full_suite.js +0 -98
- package/tests/run.js +0 -50
package/tests/run.js
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { callOnce } from '../src/server.js'
|
|
2
|
-
import fs from 'fs'
|
|
3
|
-
const projectPath = process.env.TEST_PROJECT || 'Z:/MCP/GIT MCP/temp_git_mcp_test'
|
|
4
|
-
|
|
5
|
-
async function main() {
|
|
6
|
-
if (!fs.existsSync(projectPath)) fs.mkdirSync(projectPath, { recursive: true })
|
|
7
|
-
fs.writeFileSync(projectPath + '/README.md', 'Test')
|
|
8
|
-
const log = (name, res) => { console.log(name + ': ' + (res && res.ok === false ? 'ERR' : 'OK')) }
|
|
9
|
-
|
|
10
|
-
await callOnce({ tool: 'git-local', action: 'init', projectPath })
|
|
11
|
-
await callOnce({ tool: 'git-local', action: 'add', projectPath, args: { patterns: ['README.md'] } })
|
|
12
|
-
await callOnce({ tool: 'git-local', action: 'commit', projectPath, args: { message: 'init' } })
|
|
13
|
-
|
|
14
|
-
log('git-remote.createRepo', await callOnce({ tool: 'git-remote', action: 'createRepo', projectPath }))
|
|
15
|
-
const remotes = await callOnce({ tool: 'git-remote', action: 'ensureRemotes', projectPath })
|
|
16
|
-
log('git-remote.ensureRemotes', remotes)
|
|
17
|
-
await callOnce({ tool: 'git-local', action: 'addRemote', projectPath, args: { name: 'origin-gitea', url: remotes.gitea } })
|
|
18
|
-
await callOnce({ tool: 'git-local', action: 'addRemote', projectPath, args: { name: 'origin-github', url: remotes.github } })
|
|
19
|
-
|
|
20
|
-
log('git-local.push(github)', await callOnce({ tool: 'git-local', action: 'push', projectPath, args: { url: remotes.github, branch: 'master' } }))
|
|
21
|
-
|
|
22
|
-
const calls = [
|
|
23
|
-
{ tool: 'git-repos', action: 'get' },
|
|
24
|
-
{ tool: 'git-repos', action: 'languages' },
|
|
25
|
-
{ tool: 'git-repos', action: 'tags' },
|
|
26
|
-
{ tool: 'git-repos', action: 'topics-put', args: { topics: ['test'] } },
|
|
27
|
-
{ tool: 'git-contents', action: 'create', args: { path: 'test.txt', content: Buffer.from('Hello').toString('base64'), message: 'Add file', branch: 'master' } },
|
|
28
|
-
{ tool: 'git-contents', action: 'get', args: { path: 'test.txt' } },
|
|
29
|
-
{ tool: 'git-commits', action: 'branches' },
|
|
30
|
-
{ tool: 'git-commits', action: 'create-branch', args: { name: 'dev', from: 'main' } },
|
|
31
|
-
{ tool: 'git-issues-prs', action: 'labels-create', args: { name: 'bug', color: 'ff0000' } },
|
|
32
|
-
{ tool: 'git-issues-prs', action: 'issue-create', args: { title: 'Test Issue', body: 'Body' } },
|
|
33
|
-
{ tool: 'git-releases', action: 'create', args: { tag: 'v1.0.0', title: 'v1.0.0', body: 'Release' } },
|
|
34
|
-
{ tool: 'git-actions', action: 'workflows' },
|
|
35
|
-
{ tool: 'git-activity', action: 'notifications-get' },
|
|
36
|
-
{ tool: 'git-search', action: 'repos-gitea' },
|
|
37
|
-
{ tool: 'git-misc', action: 'version' }
|
|
38
|
-
]
|
|
39
|
-
|
|
40
|
-
for (const c of calls) {
|
|
41
|
-
const res = await callOnce({ tool: c.tool, action: c.action, projectPath, args: c.args })
|
|
42
|
-
log(`${c.tool}.${c.action}`, res)
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
// Mirror fallback via contents
|
|
46
|
-
await callOnce({ tool: 'git-sync', action: 'mirror', projectPath, args: { branch: 'master' } })
|
|
47
|
-
console.log('DONE')
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
main().catch(e => { console.error(e); process.exit(1) })
|