@cyanheads/git-mcp-server 2.4.5 → 2.4.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/README.md +47 -54
- package/package.json +38 -36
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<div align="center">
|
|
2
2
|
<h1>@cyanheads/git-mcp-server</h1>
|
|
3
|
-
<p><b>A secure and scalable Git MCP server giving AI agents powerful version control for local and (soon) serverless environments
|
|
4
|
-
<div>27 Tools • 1
|
|
3
|
+
<p><b>A secure and scalable Git MCP server giving AI agents powerful version control for local and (soon) serverless environments. STDIO & Streamable HTTP</b>
|
|
4
|
+
<div>27 Tools • 1 Resource • 1 Prompt</div>
|
|
5
5
|
</p>
|
|
6
6
|
</div>
|
|
7
7
|
|
|
@@ -26,40 +26,39 @@ This server provides 27 comprehensive Git operations organized into six function
|
|
|
26
26
|
| **Remote Operations** | `git_remote`, `git_fetch`, `git_pull`, `git_push` | Configure remotes, download updates, synchronize repositories, and publish changes |
|
|
27
27
|
| **Advanced Workflows** | `git_tag`, `git_stash`, `git_reset`, `git_worktree`, `git_set_working_dir`, `git_clear_working_dir`, `git_wrapup_instructions` | Tag releases, stash changes, reset state, manage worktrees, set/clear session directory, and access workflow guidance |
|
|
28
28
|
|
|
29
|
-
##
|
|
29
|
+
## 📦 Resources Overview
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
The server provides resources that offer contextual information about the Git environment:
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
- **Abstracted Storage**: Swap storage backends (`in-memory`, `filesystem`, `Supabase`, `Cloudflare KV/R2`) without changing business logic.
|
|
37
|
-
- **Full-Stack Observability**: Deep insights with structured logging (Pino) and optional, auto-instrumented OpenTelemetry for traces and metrics.
|
|
38
|
-
- **Dependency Injection**: Built with `tsyringe` for a clean, decoupled, and testable architecture.
|
|
39
|
-
- **Edge-Ready Architecture**: Built on an edge-compatible framework that runs seamlessly on local machines or Cloudflare Workers. _Note: Current git operations use the CLI provider which requires local git installation. Edge deployment support is planned through the isomorphic-git provider integration._
|
|
33
|
+
| Resource | URI | Description |
|
|
34
|
+
| :---------------------- | :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
35
|
+
| **Git Working Directory** | `git://working-directory` | Provides the current session working directory for git operations. This is the directory set via `git_set_working_dir` and used as the default. |
|
|
40
36
|
|
|
41
|
-
|
|
37
|
+
## 🎯 Prompts Overview
|
|
42
38
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
- **Commit Signing**: Optional GPG/SSH signing support for verified commits.
|
|
39
|
+
The server provides structured prompt templates that guide AI agents through complex workflows:
|
|
40
|
+
|
|
41
|
+
| Prompt | Description | Parameters |
|
|
42
|
+
| :------------- | :--------------------------------------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------- |
|
|
43
|
+
| **Git Wrap-up** | A systematic workflow protocol for completing git sessions. Guides agents through reviewing, documenting, committing, and tagging changes. | `changelogPath`, `skipDocumentation`, `createTag`, and `updateAgentFiles`. |
|
|
49
44
|
|
|
50
45
|
## 🚀 Getting Started
|
|
51
46
|
|
|
52
47
|
### MCP Client Settings/Configuration
|
|
53
48
|
|
|
54
|
-
Add the following to your MCP Client configuration file (e.g., `cline_mcp_settings.json`).
|
|
49
|
+
Add the following to your MCP Client configuration file (e.g., `cline_mcp_settings.json`). Clients have different ways to configure servers, so refer to your client's documentation for specifics.
|
|
50
|
+
|
|
51
|
+
** Be sure to update environment variables as needed (especially your Git information!) **
|
|
55
52
|
|
|
56
53
|
```json
|
|
57
54
|
{
|
|
58
55
|
"mcpServers": {
|
|
59
56
|
"git-mcp-server": {
|
|
57
|
+
"type": "stdio",
|
|
60
58
|
"command": "bunx",
|
|
61
59
|
"args": ["@cyanheads/git-mcp-server@latest"],
|
|
62
60
|
"env": {
|
|
61
|
+
"MCP_TRANSPORT_TYPE": "stdio",
|
|
63
62
|
"MCP_LOG_LEVEL": "info",
|
|
64
63
|
"GIT_MCP_BASE_DIR": "~/Developer/",
|
|
65
64
|
"LOGS_DIR": "~/Developer/logs/git-mcp-server/",
|
|
@@ -72,6 +71,35 @@ Add the following to your MCP Client configuration file (e.g., `cline_mcp_settin
|
|
|
72
71
|
}
|
|
73
72
|
```
|
|
74
73
|
|
|
74
|
+
Or for Streamable HTTP:
|
|
75
|
+
```bash
|
|
76
|
+
MCP_TRANSPORT_TYPE=http
|
|
77
|
+
MCP_HTTP_PORT=3015
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## ✨ Server Features
|
|
81
|
+
|
|
82
|
+
This server is built on the [`mcp-ts-template`](https://github.com/cyanheads/mcp-ts-template) and inherits its rich feature set:
|
|
83
|
+
|
|
84
|
+
- **Declarative Tools**: Define agent capabilities in single, self-contained files. The framework handles registration, validation, and execution.
|
|
85
|
+
- **Robust Error Handling**: A unified `McpError` system ensures consistent, structured error responses.
|
|
86
|
+
- **Pluggable Authentication**: Secure your server with zero-fuss support for `none`, `jwt`, or `oauth` modes.
|
|
87
|
+
- **Abstracted Storage**: Swap storage backends (`in-memory`, `filesystem`, `Supabase`, `Cloudflare KV/R2`) without changing business logic.
|
|
88
|
+
- **Full-Stack Observability**: Deep insights with structured logging (Pino) and optional, auto-instrumented OpenTelemetry for traces and metrics.
|
|
89
|
+
- **Dependency Injection**: Built with `tsyringe` for a clean, decoupled, and testable architecture.
|
|
90
|
+
- **Edge-Ready Architecture**: Built on an edge-compatible framework that runs seamlessly on local machines or Cloudflare Workers. _Note: Current git operations use the CLI provider which requires local git installation. Edge deployment support is planned through the isomorphic-git provider integration._
|
|
91
|
+
|
|
92
|
+
Plus, specialized features for **Git integration**:
|
|
93
|
+
|
|
94
|
+
- **Provider-Based Architecture**: Pluggable git provider system with current CLI implementation and planned isomorphic-git provider for edge deployment.
|
|
95
|
+
- **Optimized Git Execution**: Direct git CLI interaction via Bun.spawn for high-performance process management with streaming I/O and timeout handling (current CLI provider).
|
|
96
|
+
- **Comprehensive Coverage**: 27 tools covering all essential Git operations from init to push.
|
|
97
|
+
- **Working Directory Management**: Session-specific directory context for multi-repo workflows.
|
|
98
|
+
- **Safety Features**: Explicit confirmations for destructive operations like `git clean` and `git reset --hard`.
|
|
99
|
+
- **Commit Signing**: Optional GPG/SSH signing support for verified commits.
|
|
100
|
+
|
|
101
|
+
### Development Environment Setup
|
|
102
|
+
|
|
75
103
|
### Prerequisites
|
|
76
104
|
|
|
77
105
|
- [Bun v1.2.0](https://bun.sh/) or higher
|
|
@@ -184,41 +212,6 @@ bun deploy:prod
|
|
|
184
212
|
| `src/config` | Environment variable parsing and validation with Zod. |
|
|
185
213
|
| `tests/` | Unit and integration tests, mirroring the `src/` directory structure. |
|
|
186
214
|
|
|
187
|
-
## 📦 Resources
|
|
188
|
-
|
|
189
|
-
The server provides resources that offer contextual information about the Git environment:
|
|
190
|
-
|
|
191
|
-
| Resource URI | Description |
|
|
192
|
-
| :------------------------ | :-------------------------------------------------------------------------------------------- |
|
|
193
|
-
| `git://working-directory` | Returns the currently configured working directory for the session. Shows `NOT_SET` if unset. |
|
|
194
|
-
|
|
195
|
-
## 🎯 Prompts
|
|
196
|
-
|
|
197
|
-
The server provides structured prompt templates that guide AI agents through complex workflows:
|
|
198
|
-
|
|
199
|
-
| Prompt Name | Description | Parameters |
|
|
200
|
-
| :----------- | :------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------------------------------------------------------- |
|
|
201
|
-
| `git_wrapup` | A systematic workflow protocol for completing git sessions. Guides agents through reviewing changes, updating documentation, and creating commits. | `changelogPath`, `skipDocumentation`, `createTag`, `updateAgentFiles` |
|
|
202
|
-
|
|
203
|
-
### Using Prompts
|
|
204
|
-
|
|
205
|
-
Prompts are MCP primitives that LLM clients can discover and invoke through the protocol. They work together with tools to provide comprehensive workflows:
|
|
206
|
-
|
|
207
|
-
**How it works:**
|
|
208
|
-
|
|
209
|
-
1. **Prompt** (`git_wrapup`): Provides the workflow template and instructions to the agent
|
|
210
|
-
2. **Tool** (`git_wrapup_instructions`): Retrieves current repository status and user-specific workflow preferences
|
|
211
|
-
|
|
212
|
-
The `git_wrapup` prompt creates a structured checklist for completing git sessions:
|
|
213
|
-
|
|
214
|
-
- First calls `git_wrapup_instructions` tool to get context and workflow configuration
|
|
215
|
-
- Analyzes repository changes with `git_diff`
|
|
216
|
-
- Updates `CHANGELOG.md` with version entries
|
|
217
|
-
- Reviews and updates documentation
|
|
218
|
-
- Creates atomic, conventional commits
|
|
219
|
-
- Verifies completion with `git_status`
|
|
220
|
-
|
|
221
|
-
This dual approach (prompt + tool) ensures agents have both the workflow logic and current repository context to complete tasks effectively.
|
|
222
215
|
|
|
223
216
|
## 📤 Understanding Tool Responses
|
|
224
217
|
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cyanheads/git-mcp-server",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.6",
|
|
4
4
|
"mcpName": "io.github.cyanheads/git-mcp-server",
|
|
5
|
-
"description": "
|
|
5
|
+
"description": "A secure and scalable Git MCP server enabling AI agents to perform comprehensive Git version control operations via STDIO and Streamable HTTP.",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"files": [
|
|
8
8
|
"dist"
|
|
@@ -29,34 +29,38 @@
|
|
|
29
29
|
},
|
|
30
30
|
"homepage": "https://github.com/cyanheads/git-mcp-server#readme",
|
|
31
31
|
"scripts": {
|
|
32
|
-
"
|
|
33
|
-
"
|
|
32
|
+
"//--- Development": "",
|
|
33
|
+
"dev": "bun --watch src/index.ts",
|
|
34
|
+
"dev:http": "MCP_LOG_LEVEL=debug MCP_TRANSPORT_TYPE=http bun --watch src/index.ts",
|
|
35
|
+
"dev:stdio": "MCP_LOG_LEVEL=debug MCP_TRANSPORT_TYPE=stdio bun --watch src/index.ts",
|
|
36
|
+
"devcheck": "bun run scripts/devcheck.ts",
|
|
37
|
+
"devdocs": "bun run scripts/devdocs.ts",
|
|
38
|
+
"//--- Build & Deploy": "",
|
|
39
|
+
"build": "rm -rf dist && bun build ./src/index.ts --outdir ./dist --target node",
|
|
40
|
+
"build:worker": "rm -rf dist && bun build ./src/worker.ts --outdir ./dist --target bun --no-external",
|
|
34
41
|
"deploy:dev": "MCP_TRANSPORT_TYPE=http bunx wrangler dev",
|
|
35
42
|
"deploy:prod": "MCP_TRANSPORT_TYPE=http bunx wrangler deploy",
|
|
43
|
+
"//--- Start": "",
|
|
36
44
|
"start": "bun ./dist/index.js",
|
|
37
|
-
"start:stdio": "MCP_TRANSPORT_TYPE=stdio bun ./dist/index.js",
|
|
38
45
|
"start:http": "MCP_TRANSPORT_TYPE=http bun ./dist/index.js",
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"devcheck": "bun run scripts/devcheck.ts",
|
|
44
|
-
"rebuild": "bun run scripts/clean.ts && bun run build",
|
|
45
|
-
"docs:generate": "bunx typedoc",
|
|
46
|
+
"start:stdio": "MCP_TRANSPORT_TYPE=stdio bun ./dist/index.js",
|
|
47
|
+
"//--- Quality & Maintenance": "",
|
|
48
|
+
"audit": "bun audit",
|
|
49
|
+
"audit:fix": "bun audit --fix",
|
|
46
50
|
"depcheck": "bunx depcheck",
|
|
51
|
+
"format": "bunx prettier --write \"**/*.{ts,js,json,md,html,css}\"",
|
|
47
52
|
"lint": "bunx eslint .",
|
|
48
53
|
"lint:fix": "bunx eslint . --fix",
|
|
49
|
-
"typecheck": "bunx tsc --noEmit",
|
|
50
|
-
"tree": "bun run scripts/tree.ts",
|
|
51
|
-
"fetch-spec": "bun run scripts/fetch-openapi-spec.ts",
|
|
52
|
-
"format": "bunx prettier --write \"**/*.{ts,js,json,md,html,css}\"",
|
|
53
54
|
"prepare": "bunx husky",
|
|
54
|
-
"inspector": "bunx mcp-inspector --config mcp.json --server git-mcp-server",
|
|
55
55
|
"test": "bun test --config vitest.config.ts",
|
|
56
56
|
"test:coverage": "bun test --coverage",
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
57
|
+
"typecheck": "bunx tsc --noEmit",
|
|
58
|
+
"//--- Utilities": "",
|
|
59
|
+
"docs:generate": "bunx typedoc",
|
|
60
|
+
"fetch-spec": "bun run scripts/fetch-openapi-spec.ts",
|
|
61
|
+
"inspector": "bunx mcp-inspector --config mcp.json --server git-mcp-server",
|
|
62
|
+
"publish-mcp": "bun scripts/validate-mcp-publish-schema.ts",
|
|
63
|
+
"tree": "bun run scripts/tree.ts"
|
|
60
64
|
},
|
|
61
65
|
"resolutions": {
|
|
62
66
|
"@hono/node-server": "1.19.5",
|
|
@@ -109,7 +113,7 @@
|
|
|
109
113
|
"@eslint/js": "^9.37.0",
|
|
110
114
|
"@types/bun": "^1.3.0",
|
|
111
115
|
"@types/js-yaml": "^4.0.9",
|
|
112
|
-
"@types/node": "^24.7.
|
|
116
|
+
"@types/node": "^24.7.2",
|
|
113
117
|
"@types/node-cron": "^3.0.11",
|
|
114
118
|
"@types/papaparse": "^5.3.16",
|
|
115
119
|
"@types/sanitize-html": "^2.16.0",
|
|
@@ -134,18 +138,9 @@
|
|
|
134
138
|
"vitest": "^3.2.4"
|
|
135
139
|
},
|
|
136
140
|
"keywords": [
|
|
137
|
-
"
|
|
138
|
-
"
|
|
139
|
-
"
|
|
140
|
-
"mcp-server",
|
|
141
|
-
"llm-tools",
|
|
142
|
-
"git-tools",
|
|
143
|
-
"LLM",
|
|
144
|
-
"AI-integration",
|
|
145
|
-
"server",
|
|
146
|
-
"git",
|
|
147
|
-
"version-control",
|
|
148
|
-
"repository",
|
|
141
|
+
"ai-agent",
|
|
142
|
+
"ai-integration",
|
|
143
|
+
"automation",
|
|
149
144
|
"branch",
|
|
150
145
|
"cherry-pick",
|
|
151
146
|
"clone",
|
|
@@ -153,8 +148,15 @@
|
|
|
153
148
|
"devops",
|
|
154
149
|
"diff",
|
|
155
150
|
"fetch",
|
|
151
|
+
"git",
|
|
152
|
+
"git-tools",
|
|
153
|
+
"llm",
|
|
154
|
+
"llm-tools",
|
|
156
155
|
"log",
|
|
156
|
+
"mcp",
|
|
157
|
+
"mcp-server",
|
|
157
158
|
"merge",
|
|
159
|
+
"model-context-protocol",
|
|
158
160
|
"pull",
|
|
159
161
|
"push",
|
|
160
162
|
"rebase",
|
|
@@ -163,9 +165,9 @@
|
|
|
163
165
|
"stash",
|
|
164
166
|
"status",
|
|
165
167
|
"tag",
|
|
166
|
-
"
|
|
167
|
-
"
|
|
168
|
-
"
|
|
168
|
+
"typescript",
|
|
169
|
+
"version-control",
|
|
170
|
+
"worktree"
|
|
169
171
|
],
|
|
170
172
|
"author": "cyanheads <casey@caseyjhand.com> (https://github.com/cyanheads/git-mcp-server#readme)",
|
|
171
173
|
"license": "Apache-2.0",
|