@commitsage/mcp-server 1.0.0 → 1.1.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.
Files changed (57) hide show
  1. package/README.md +87 -101
  2. package/dist/models/errors.d.ts +0 -12
  3. package/dist/models/errors.d.ts.map +1 -1
  4. package/dist/models/errors.js +0 -24
  5. package/dist/models/errors.js.map +1 -1
  6. package/dist/models/types.d.ts +0 -19
  7. package/dist/models/types.d.ts.map +1 -1
  8. package/dist/models/types.js.map +1 -1
  9. package/dist/server/mcpServer.d.ts.map +1 -1
  10. package/dist/server/mcpServer.js +3 -79
  11. package/dist/server/mcpServer.js.map +1 -1
  12. package/dist/server/tools.d.ts +1 -49
  13. package/dist/server/tools.d.ts.map +1 -1
  14. package/dist/server/tools.js +22 -178
  15. package/dist/server/tools.js.map +1 -1
  16. package/dist/services/baseAIService.d.ts +15 -26
  17. package/dist/services/baseAIService.d.ts.map +1 -1
  18. package/dist/services/baseAIService.js +53 -62
  19. package/dist/services/baseAIService.js.map +1 -1
  20. package/dist/services/codestralService.d.ts.map +1 -1
  21. package/dist/services/codestralService.js +11 -35
  22. package/dist/services/codestralService.js.map +1 -1
  23. package/dist/services/geminiService.d.ts +2 -6
  24. package/dist/services/geminiService.d.ts.map +1 -1
  25. package/dist/services/geminiService.js +61 -84
  26. package/dist/services/geminiService.js.map +1 -1
  27. package/dist/services/ollamaService.d.ts +1 -2
  28. package/dist/services/ollamaService.d.ts.map +1 -1
  29. package/dist/services/ollamaService.js +16 -35
  30. package/dist/services/ollamaService.js.map +1 -1
  31. package/dist/services/openaiService.d.ts +0 -1
  32. package/dist/services/openaiService.d.ts.map +1 -1
  33. package/dist/services/openaiService.js +12 -33
  34. package/dist/services/openaiService.js.map +1 -1
  35. package/dist/utils/config.d.ts +1 -0
  36. package/dist/utils/config.d.ts.map +1 -1
  37. package/dist/utils/config.js +3 -0
  38. package/dist/utils/config.js.map +1 -1
  39. package/dist/utils/httpUtils.d.ts +1 -2
  40. package/dist/utils/httpUtils.d.ts.map +1 -1
  41. package/dist/utils/httpUtils.js +7 -8
  42. package/dist/utils/httpUtils.js.map +1 -1
  43. package/dist/utils/logger.js +3 -3
  44. package/dist/utils/logger.js.map +1 -1
  45. package/package.json +1 -1
  46. package/dist/adapters/sse.d.ts +0 -26
  47. package/dist/adapters/sse.d.ts.map +0 -1
  48. package/dist/adapters/sse.js +0 -45
  49. package/dist/adapters/sse.js.map +0 -1
  50. package/dist/auth/jwt.d.ts +0 -70
  51. package/dist/auth/jwt.d.ts.map +0 -1
  52. package/dist/auth/jwt.js +0 -171
  53. package/dist/auth/jwt.js.map +0 -1
  54. package/dist/auth/oauth.d.ts +0 -71
  55. package/dist/auth/oauth.d.ts.map +0 -1
  56. package/dist/auth/oauth.js +0 -213
  57. package/dist/auth/oauth.js.map +0 -1
package/README.md CHANGED
@@ -23,35 +23,17 @@ CommitSage MCP Server provides AI-powered Git commit message generation through
23
23
  - Git installed and in PATH
24
24
  - API key for your chosen provider (Gemini, OpenAI, or Codestral) - not needed for Ollama
25
25
 
26
- ### Installation Options
26
+ ### Installation
27
27
 
28
- #### Option 1: Zed Extension (Recommended)
28
+ CommitSage MCP Server is available on npm: [@commitsage/mcp-server](https://www.npmjs.com/package/@commitsage/mcp-server)
29
29
 
30
- The easiest way to use CommitSage is through the Zed extension, which handles installation and configuration automatically.
31
-
32
- See the [Zed Extension README](./zed-extension/README.md) for details.
33
-
34
- #### Option 2: Manual Installation
35
-
36
- 1. **Clone or download the project**
37
-
38
- ```bash
39
- cd C:\Users\IVAN\Documents\home\CommitSage\mcp-server
40
- ```
41
-
42
- 2. **Install dependencies**
43
-
44
- ```bash
45
- npm install
46
- ```
47
-
48
- 3. **Build the project**
30
+ No installation required when using `npx` (recommended), or install globally:
49
31
 
50
32
  ```bash
51
- npm run build
33
+ npm install -g @commitsage/mcp-server
52
34
  ```
53
35
 
54
- 4. **Configure in your MCP client** (see Configuration section below)
36
+ Then configure in your MCP client (see Configuration section below).
55
37
 
56
38
  ## Configuration for IDE Clients
57
39
 
@@ -66,8 +48,8 @@ Add to your Claude Code configuration file:
66
48
  {
67
49
  "mcpServers": {
68
50
  "commitsage": {
69
- "command": "node",
70
- "args": ["C:/Users/IVAN/Documents/home/CommitSage/mcp-server/dist/index.js"],
51
+ "command": "npx",
52
+ "args": ["-y", "@commitsage/mcp-server"],
71
53
  "env": {
72
54
  "GEMINI_API_KEY": "your-api-key-here",
73
55
  "DEFAULT_PROVIDER": "gemini",
@@ -86,8 +68,8 @@ Add to your Claude Code configuration file:
86
68
  {
87
69
  "mcpServers": {
88
70
  "commitsage": {
89
- "command": "node",
90
- "args": ["C:/Users/IVAN/Documents/home/CommitSage/mcp-server/dist/index.js"],
71
+ "command": "npx",
72
+ "args": ["-y", "@commitsage/mcp-server"],
91
73
  "env": {
92
74
  "GEMINI_API_KEY": "your-api-key-here"
93
75
  }
@@ -105,8 +87,8 @@ Add to Cursor settings (Settings > MCP):
105
87
  "mcp": {
106
88
  "servers": {
107
89
  "commitsage": {
108
- "command": "node",
109
- "args": ["C:/Users/IVAN/Documents/home/CommitSage/mcp-server/dist/index.js"],
90
+ "command": "npx",
91
+ "args": ["-y", "@commitsage/mcp-server"],
110
92
  "env": {
111
93
  "GEMINI_API_KEY": "your-api-key-here",
112
94
  "DEFAULT_PROVIDER": "gemini",
@@ -128,8 +110,8 @@ If you prefer manual configuration, add to `.zed/settings.json`:
128
110
  {
129
111
  "context_servers": {
130
112
  "commitsage": {
131
- "command": "node",
132
- "args": ["C:/Users/IVAN/Documents/home/CommitSage/mcp-server/dist/index.js"],
113
+ "command": "npx",
114
+ "args": ["-y", "@commitsage/mcp-server"],
133
115
  "env": {
134
116
  "GEMINI_API_KEY": "your-api-key-here",
135
117
  "DEFAULT_PROVIDER": "gemini"
@@ -143,24 +125,15 @@ If you prefer manual configuration, add to `.zed/settings.json`:
143
125
 
144
126
  ### 1. `generate_commit_message`
145
127
 
146
- Generate an AI-powered commit message for a Git repository.
128
+ Generate an AI-powered commit message for a Git repository. Analyzes all changes (staged and unstaged) using configuration from MCP server environment variables.
147
129
 
148
130
  **Parameters:**
149
131
  - `repoPath` (required): Path to the git repository
150
- - `provider` (optional): AI provider (`gemini`, `openai`, `codestral`, `ollama`)
151
- - `format` (optional): Commit format (`conventional`, `angular`, `karma`, `semantic`, `emoji`, `emojiKarma`, `google`, `atom`)
152
- - `language` (optional): Language (`english`, `russian`, `chinese`, `japanese`, `spanish`)
153
- - `onlyStaged` (optional): Only analyze staged changes (default: `false`)
154
- - `customInstructions` (optional): Custom instructions for generation
155
132
 
156
133
  **Example:**
157
134
  ```json
158
135
  {
159
- "repoPath": "/path/to/your/repo",
160
- "provider": "gemini",
161
- "format": "conventional",
162
- "language": "english",
163
- "onlyStaged": true
136
+ "repoPath": "/path/to/your/repo"
164
137
  }
165
138
  ```
166
139
 
@@ -174,61 +147,9 @@ Generate an AI-powered commit message for a Git repository.
174
147
  }
175
148
  ```
176
149
 
177
- ### 2. `analyze_changes`
178
-
179
- Analyze git changes in a repository.
180
-
181
- **Parameters:**
182
- - `repoPath` (required): Path to the git repository
183
- - `onlyStaged` (optional): Only analyze staged changes
184
-
185
- **Example:**
186
- ```json
187
- {
188
- "repoPath": "/path/to/your/repo",
189
- "onlyStaged": false
190
- }
191
- ```
192
-
193
- **Response:**
194
- ```json
195
- {
196
- "success": true,
197
- "analysis": {
198
- "hasStagedChanges": true,
199
- "hasUnstagedChanges": false,
200
- "hasUntrackedFiles": false,
201
- "changedFilesCount": 3,
202
- "changedFiles": ["src/auth.ts", "src/config.ts", "README.md"],
203
- "diffLength": 1234,
204
- "diffPreview": "diff --git a/src/auth.ts..."
205
- }
206
- }
207
- ```
208
-
209
- ### 3. `list_commit_formats`
210
-
211
- List all available commit message formats.
212
-
213
- **Parameters:** None
214
-
215
- **Response:**
216
- ```json
217
- {
218
- "success": true,
219
- "formats": [
220
- {
221
- "name": "conventional",
222
- "description": "Conventional Commits format: type(scope): description",
223
- "example": "feat(auth): add OAuth2 authentication"
224
- },
225
- ...
226
- ],
227
- "currentFormat": "conventional"
228
- }
229
- ```
150
+ **Note:** All configuration (provider, format, language, etc.) is set through environment variables in the MCP server configuration.
230
151
 
231
- ### 4. `validate_api_key`
152
+ ### 2. `validate_api_key`
232
153
 
233
154
  Validate that an API key is configured for a provider.
234
155
 
@@ -247,7 +168,7 @@ Validate that an API key is configured for a provider.
247
168
  ### In Claude Code
248
169
 
249
170
  ```
250
- Generate a commit message for my staged changes in C:/projects/myapp using conventional format
171
+ Generate a commit message for my changes in C:/projects/myapp
251
172
  ```
252
173
 
253
174
  Claude Code will call the `generate_commit_message` tool and provide you with a properly formatted commit message.
@@ -255,18 +176,18 @@ Claude Code will call the `generate_commit_message` tool and provide you with a
255
176
  ### In Cursor
256
177
 
257
178
  ```
258
- Analyze the changes in /home/user/projects/webapp
179
+ Generate commit message for the current repository
259
180
  ```
260
181
 
261
- Cursor will call the `analyze_changes` tool to show you what's changed.
182
+ Cursor will analyze all changes and generate an appropriate commit message.
262
183
 
263
184
  ### In Zed
264
185
 
265
186
  ```
266
- List all available commit formats
187
+ Create a commit message for my project
267
188
  ```
268
189
 
269
- Zed will call the `list_commit_formats` tool and show you all options.
190
+ Zed will call the `generate_commit_message` tool and show you the result.
270
191
 
271
192
  ## Environment Variables Reference
272
193
 
@@ -281,6 +202,7 @@ Zed will call the `list_commit_formats` tool and show you all options.
281
202
  | `DEFAULT_COMMIT_FORMAT` | Default commit format | `conventional` | No |
282
203
  | `DEFAULT_COMMIT_LANGUAGE` | Default language | `english` | No |
283
204
  | `API_REQUEST_TIMEOUT` | API timeout in seconds | `30` | No |
205
+ | `ONLY_STAGED` | Analyze only staged changes | `false` | No |
284
206
  | `LOG_LEVEL` | Logging level | `info` | No |
285
207
  | `USE_CUSTOM_INSTRUCTIONS` | Enable custom instructions | `false` | No |
286
208
  | `CUSTOM_INSTRUCTIONS` | Custom prompt instructions | - | If `USE_CUSTOM_INSTRUCTIONS` is `true` |
@@ -306,12 +228,66 @@ Zed will call the `list_commit_formats` tool and show you all options.
306
228
 
307
229
  ## Development
308
230
 
231
+ For local development, clone the repository:
232
+
233
+ ```bash
234
+ git clone https://github.com/VizzleTF/CommitSage.git
235
+ cd CommitSage/mcp-server
236
+ npm install
237
+ ```
238
+
309
239
  ### Run in development mode
310
240
 
311
241
  ```bash
312
242
  npm run dev
313
243
  ```
314
244
 
245
+ ### Run locally via index.ts
246
+
247
+ You can run the MCP server directly from source using `tsx`:
248
+
249
+ ```bash
250
+ GEMINI_API_KEY=your-key npx tsx src/index.ts
251
+ ```
252
+
253
+ On Windows (PowerShell):
254
+
255
+ ```powershell
256
+ $env:GEMINI_API_KEY="your-key"; npx tsx src/index.ts
257
+ ```
258
+
259
+ You can also point your MCP client to the local source instead of the npm package:
260
+
261
+ ```json
262
+ {
263
+ "mcpServers": {
264
+ "commitsage": {
265
+ "command": "npx",
266
+ "args": ["tsx", "/absolute/path/to/CommitSage-MCP/src/index.ts"],
267
+ "env": {
268
+ "GEMINI_API_KEY": "your-api-key-here"
269
+ }
270
+ }
271
+ }
272
+ }
273
+ ```
274
+
275
+ Or use the compiled version after `npm run build`:
276
+
277
+ ```json
278
+ {
279
+ "mcpServers": {
280
+ "commitsage": {
281
+ "command": "node",
282
+ "args": ["/absolute/path/to/CommitSage-MCP/dist/index.js"],
283
+ "env": {
284
+ "GEMINI_API_KEY": "your-api-key-here"
285
+ }
286
+ }
287
+ }
288
+ }
289
+ ```
290
+
315
291
  ### Build
316
292
 
317
293
  ```bash
@@ -415,6 +391,7 @@ MIT
415
391
  ## Support
416
392
 
417
393
  For issues, questions, or contributions, please visit:
394
+ - npm package: [@commitsage/mcp-server](https://www.npmjs.com/package/@commitsage/mcp-server)
418
395
  - Main project: [CommitSage GitHub](https://github.com/VizzleTF/CommitSage)
419
396
  - Issues: [GitHub Issues](https://github.com/VizzleTF/CommitSage/issues)
420
397
 
@@ -424,6 +401,15 @@ Built on top of the [CommitSage VSCode Extension](https://marketplace.visualstud
424
401
 
425
402
  ## Changelog
426
403
 
404
+ ### v1.1.0 (2026-02-07)
405
+
406
+ - **Security:** Gemini API key moved from URL query parameter to `x-goog-api-key` header
407
+ - **Security:** Removed unused `apiKey` parameter from `validate_api_key` tool
408
+ - **Feature:** Added `ONLY_STAGED` environment variable to analyze only staged changes
409
+ - **UX:** Tool descriptions now specify that `repoPath` must be an absolute path
410
+ - **Refactor:** Unified AI service logic via shared `BaseAIService.generateWithRetry` method, reducing code duplication across OpenAI, Codestral, Ollama, and Gemini services
411
+ - **Cleanup:** Removed unused interfaces (`IAIService`, `GitDiffOptions`, `CommitMessageOptions`, `AnalyzeChangesOptions`), error classes (`NoRepositoriesFoundError`, `NoRepositorySelectedError`, `UserCancelledError`, `AIServiceError`), and dead code
412
+
427
413
  ### v1.0.0 (2026-02-06)
428
414
 
429
415
  - Initial release
@@ -4,18 +4,9 @@
4
4
  export declare class GitExtensionNotFoundError extends Error {
5
5
  constructor();
6
6
  }
7
- export declare class NoRepositoriesFoundError extends Error {
8
- constructor();
9
- }
10
7
  export declare class NoChangesDetectedError extends Error {
11
8
  constructor();
12
9
  }
13
- export declare class NoRepositorySelectedError extends Error {
14
- constructor();
15
- }
16
- export declare class UserCancelledError extends Error {
17
- constructor(message?: string);
18
- }
19
10
  export declare class ApiKeyInvalidError extends Error {
20
11
  constructor(provider: string);
21
12
  }
@@ -25,9 +16,6 @@ export declare class InvalidRepositoryPathError extends Error {
25
16
  export declare class GitCommandError extends Error {
26
17
  constructor(command: string, exitCode: number, stderr: string);
27
18
  }
28
- export declare class AIServiceError extends Error {
29
- constructor(provider: string, message: string);
30
- }
31
19
  export declare class TimeoutError extends Error {
32
20
  constructor(operation: string, timeoutMs: number);
33
21
  }
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/models/errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,qBAAa,yBAA0B,SAAQ,KAAK;;CAKnD;AAED,qBAAa,w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this.name = "GitExtensionNotFoundError";
8
8
  }
9
9
  }
10
- export class NoRepositoriesFoundError extends Error {
11
- constructor() {
12
- super("No Git repositories found");
13
- this.name = "NoRepositoriesFoundError";
14
- }
15
- }
16
10
  export class NoChangesDetectedError extends Error {
17
11
  constructor() {
18
12
  super("No changes detected in the repository");
19
13
  this.name = "NoChangesDetectedError";
20
14
  }
21
15
  }
22
- export class NoRepositorySelectedError extends Error {
23
- constructor() {
24
- super("No repository selected");
25
- this.name = "NoRepositorySelectedError";
26
- }
27
- }
28
- export class UserCancelledError extends Error {
29
- constructor(message = "Operation cancelled by user") {
30
- super(message);
31
- this.name = "UserCancelledError";
32
- }
33
- }
34
16
  export class ApiKeyInvalidError extends Error {
35
17
  constructor(provider) {
36
18
  super(`Invalid or expired API key for ${provider}`);
@@ -52,12 +34,6 @@ export class GitCommandError extends Error {
52
34
  this.name = "GitCommandError";
53
35
  }
54
36
  }
55
- export class AIServiceError extends Error {
56
- constructor(provider, message) {
57
- super(`AI Service error (${provider}): ${message}`);
58
- this.name = "AIServiceError";
59
- }
60
- }
61
37
  export class TimeoutError extends Error {
62
38
  constructor(operation, timeoutMs) {
63
39
  super(`Operation timed out: ${operation} (timeout: ${timeoutMs}ms)`);
@@ -1 +1 @@
1
- {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/models/errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,OAAO,yBAA0B,SAAQ,KAAK;IAClD;QACE,KAAK,CAAC,2CAA2C,CAAC,CAAC;QACnD,IAAI,CAAC,IAAI,GAAG,2BAA2B,CAAC;IAC1C,CAAC;CACF;AAED,MAAM,OAAO,wBAAyB,SAAQ,KAAK;IACjD;QACE,KAAK,CAAC,2BAA2B,CAAC,CAAC;QACnC,IAAI,CAAC,IAAI,GAAG,0BAA0B,CAAC;IACzC,CAAC;CACF;AAED,MAAM,OAAO,sBAAuB,SAAQ,KAAK;IAC/C;QACE,KAAK,CAAC,uCAAuC,CAAC,CAAC;QA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AG,iBAAiB,CAAC;IAChC,CAAC;CACF;AAED,MAAM,OAAO,YAAa,SAAQ,KAAK;IACrC,YAAY,SAAiB,EAAE,SAAiB;QAC9C,KAAK,CAAC,wBAAwB,SAAS,cAAc,SAAS,KAAK,CAAC,CAAC;QACrE,IAAI,CAAC,IAAI,GAAG,cAAc,CAAC;IAC7B,CAAC;CACF"}
@@ -11,25 +11,6 @@ export interface ProgressReporter {
11
11
  increment?: number;
12
12
  }): void;
13
13
  }
14
- export interface IAIService {
15
- generateCommitMessage(prompt: string, progress: ProgressReporter, attempt?: number): Promise<CommitMessage>;
16
- }
17
- export interface GitDiffOptions {
18
- repoPath: string;
19
- onlyStaged?: boolean;
20
- }
21
- export interface CommitMessageOptions {
22
- repoPath: string;
23
- provider?: string;
24
- format?: string;
25
- language?: string;
26
- onlyStaged?: boolean;
27
- customInstructions?: string;
28
- }
29
- export interface AnalyzeChangesOptions {
30
- repoPath: string;
31
- onlyStaged?: boolean;
32
- }
33
14
  export declare class NoopProgressReporter implements ProgressReporter {
34
15
  report(_value: {
35
16
  message?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/models/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,CAAC,KAAK,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;CAC/D;AAED,MAAM,WAAW,UAAU;IACzB,qBAAqB,CACnB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,gBAAgB,EAC1B,OAAO,CAAC,EAAE,MAAM,GACf,OAAO,CAAC,aAAa,CAAC,CAAC;CAC3B;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,qBAAqB;IACpC,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,qBAAa,oBAAqB,YAAW,gBAAgB;IAC3D,MAAM,CAAC,MAAM,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI;CAG/D"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/models/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,CAAC,KAAK,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;CAC/D;AAED,qBAAa,oBAAqB,YAAW,gBAAgB;IAC3D,MAAM,CAAC,MAAM,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI;CAG/D"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/models/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAsCH,MAAM,OAAO,oBAAoB;IAC/B,MAAM,CAAC,MAAgD;QACrD,uBAAuB;IACzB,CAAC;CACF"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/models/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAWH,MAAM,OAAO,oBAAoB;IAC/B,MAAM,CAAC,MAAgD;QACrD,uBAAuB;IACzB,CAAC;CACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"mcpServer.d.ts","sourceRoot":"","sources":["../../src/server/mcpServer.ts"],"names":[],"mappings":"AAAA;;GAEG;AAsBH,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,MAAM,CAAS;;IAmBvB,OAAO,CAAC,iBAAiB;IAqKzB,OAAO,CAAC,kBAAkB;IAkBpB,KAAK;CAoBZ"}
1
+ {"version":3,"file":"mcpServer.d.ts","sourceRoot":"","sources":["../../src/server/mcpServer.ts"],"names":[],"mappings":"AAAA;;GAEG;AAkBH,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,MAAM,CAAS;;IAmBvB,OAAO,CAAC,iBAAiB;IAqFzB,OAAO,CAAC,kBAAkB;IAkBpB,KAAK;CAoBZ"}
@@ -7,7 +7,7 @@ import { CallToolRequestSchema, ListToolsRequestSchema, } from "@modelcontextpro
7
7
  import { Logger } from "../utils/logger.js";
8
8
  import { ConfigService } from "../utils/config.js";
9
9
  import { GitService } from "../services/gitService.js";
10
- import { GenerateCommitMessageSchema, AnalyzeChangesSchema, ListCommitFormatsSchema, ValidateApiKeySchema, handleGenerateCommitMessage, handleAnalyzeChanges, handleListCommitFormats, handleValidateApiKey, } from "./tools.js";
10
+ import { GenerateCommitMessageSchema, ValidateApiKeySchema, handleGenerateCommitMessage, handleValidateApiKey, } from "./tools.js";
11
11
  export class CommitSageMCPServer {
12
12
  server;
13
13
  constructor() {
@@ -29,82 +29,18 @@ export class CommitSageMCPServer {
29
29
  tools: [
30
30
  {
31
31
  name: "generate_commit_message",
32
- description: "Generate an AI-powered commit message for a Git repository based on staged or all changes. Analyzes the diff and git blame information to create a meaningful commit message in the specified format and language.",
32
+ description: "Generate an AI-powered commit message for a Git repository. Analyzes changes using configuration from MCP server environment variables. Set ONLY_STAGED=true to analyze only staged changes.",
33
33
  inputSchema: {
34
34
  type: "object",
35
35
  properties: {
36
36
  repoPath: {
37
37
  type: "string",
38
- description: "Path to the git repository",
39
- },
40
- provider: {
41
- type: "string",
42
- enum: ["gemini", "openai", "codestral", "ollama"],
43
- description: "AI provider to use (defaults to configured provider)",
44
- },
45
- format: {
46
- type: "string",
47
- enum: [
48
- "conventional",
49
- "angular",
50
- "karma",
51
- "semantic",
52
- "emoji",
53
- "emojiKarma",
54
- "google",
55
- "atom",
56
- ],
57
- description: "Commit message format",
58
- },
59
- language: {
60
- type: "string",
61
- enum: [
62
- "english",
63
- "russian",
64
- "chinese",
65
- "japanese",
66
- "spanish",
67
- ],
68
- description: "Language for commit message",
69
- },
70
- onlyStaged: {
71
- type: "boolean",
72
- description: "Only analyze staged changes (default: false)",
73
- },
74
- customInstructions: {
75
- type: "string",
76
- description: "Custom instructions for commit message generation",
77
- },
78
- },
79
- required: ["repoPath"],
80
- },
81
- },
82
- {
83
- name: "analyze_changes",
84
- description: "Analyze git changes in a repository. Returns information about staged/unstaged changes, changed files, and a preview of the diff.",
85
- inputSchema: {
86
- type: "object",
87
- properties: {
88
- repoPath: {
89
- type: "string",
90
- description: "Path to the git repository",
91
- },
92
- onlyStaged: {
93
- type: "boolean",
94
- description: "Only analyze staged changes (default: false)",
38
+ description: "Absolute path to the git repository (e.g. /home/user/project or C:\\Users\\user\\project)",
95
39
  },
96
40
  },
97
41
  required: ["repoPath"],
98
42
  },
99
43
  },
100
- {
101
- name: "list_commit_formats",
102
- description: "List all available commit message formats with descriptions and examples.",
103
- inputSchema: {
104
- type: "object",
105
- properties: {},
106
- },
107
- },
108
44
  {
109
45
  name: "validate_api_key",
110
46
  description: "Validate that an API key is configured for a specific provider.",
@@ -116,10 +52,6 @@ export class CommitSageMCPServer {
116
52
  enum: ["gemini", "openai", "codestral", "ollama"],
117
53
  description: "Provider to validate",
118
54
  },
119
- apiKey: {
120
- type: "string",
121
- description: "API key to validate (optional, uses env if not provided)",
122
- },
123
55
  },
124
56
  required: ["provider"],
125
57
  },
@@ -136,14 +68,6 @@ export class CommitSageMCPServer {
136
68
  const parsed = GenerateCommitMessageSchema.parse(args);
137
69
  return await handleGenerateCommitMessage(parsed);
138
70
  }
139
- case "analyze_changes": {
140
- const parsed = AnalyzeChangesSchema.parse(args);
141
- return await handleAnalyzeChanges(parsed);
142
- }
143
- case "list_commit_formats": {
144
- const parsed = ListCommitFormatsSchema.parse(args);
145
- return await handleListCommitFormats(parsed);
146
- }
147
71
  case "validate_api_key": {
148
72
  const parsed = ValidateApiKeySchema.parse(args);
149
73
  return await handleValidateApiKey(parsed);
@@ -1 +1 @@
1
- {"version":3,"file":"mcpServer.js","sourceRoot":"","sources":["../../src/server/mcpServer.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACL,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EACL,2BAA2B,EAC3B,oBAAoB,EACpB,uBAAuB,EACvB,oBAAoB,EACpB,2BAA2B,EAC3B,oBAAoB,EACpB,uBAAuB,EACvB,oBAAoB,GACrB,MAAM,YAAY,CAAC;AAEpB,MAAM,OAAO,mBAAmB;IACtB,MAAM,CAAS;IAEvB;QACE,IAAI,CAAC,MAAM,GAAG,IAAI,MAAM,CACtB;YACE,IAAI,EAAE,YAAY;YAClB,OAAO,EAAE,OAAO;SACjB,EACD;YACE,YAAY,EAAE;gBACZ,KAAK,EAAE,EAAE;aACV;SACF,CACF,CAAC;Q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AAK,CAAC,KAAK;QACT,IAAI,CAAC;YACH,sBAAsB;YACtB,MAAM,CAAC,GAAG,CAAC,uCAAuC,CAAC,CAAC;YACpD,aAAa,CAAC,UAAU,EAAE,CAAC;YAC3B,MAAM,UAAU,CAAC,WAAW,EAAE,CAAC;YAE/B,8BAA8B;YAC9B,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;YAC7C,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;YAErC,MAAM,CAAC,GAAG,CAAC,4CAA4C,CAAC,CAAC;YACzD,MAAM,CAAC,GAAG,CAAC,qBAAqB,aAAa,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;YAC/D,MAAM,CAAC,GAAG,CAAC,mBAAmB,aAAa,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC;YACjE,MAAM,CAAC,GAAG,CAAC,qBAAqB,aAAa,CAAC,iBAAiB,EAAE,EAAE,CAAC,CAAC;QACvE,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,CAAC,KAAK,CAAC,6BAA6B,EAAE,KAAK,CAAC,CAAC;YACnD,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;CACF"}
@@ -1,49 +1,20 @@
1
1
  /**
2
2
  * MCP Tools definitions for CommitSage
3
3
  */
4
- import { z } from 'zod';
4
+ import { z } from "zod";
5
5
  export declare const GenerateCommitMessageSchema: z.ZodObject<{
6
6
  repoPath: z.ZodString;
7
- provider: z.ZodOptional<z.ZodEnum<["gemini", "openai", "codestral", "ollama"]>>;
8
- format: z.ZodOptional<z.ZodEnum<["conventional", "angular", "karma", "semantic", "emoji", "emojiKarma", "google", "atom"]>>;
9
- language: z.ZodOptional<z.ZodEnum<["english", "russian", "chinese", "japanese", "spanish"]>>;
10
- onlyStaged: z.ZodOptional<z.ZodBoolean>;
11
- customInstructions: z.ZodOptional<z.ZodString>;
12
7
  }, "strip", z.ZodTypeAny, {
13
8
  repoPath: string;
14
- provider?: "gemini" | "openai" | "codestral" | "ollama" | undefined;
15
- format?: "conventional" | "angular" | "karma" | "semantic" | "emoji" | "emojiKarma" | "google" | "atom" | undefined;
16
- language?: "english" | "russian" | "chinese" | "japanese" | "spanish" | undefined;
17
- onlyStaged?: boolean | undefined;
18
- customInstructions?: string | undefined;
19
9
  }, {
20
10
  repoPath: string;
21
- provider?: "gemini" | "openai" | "codestral" | "ollama" | undefined;
22
- format?: "conventional" | "angular" | "karma" | "semantic" | "emoji" | "emojiKarma" | "google" | "atom" | undefined;
23
- language?: "english" | "russian" | "chinese" | "japanese" | "spanish" | undefined;
24
- onlyStaged?: boolean | undefined;
25
- customInstructions?: string | undefined;
26
11
  }>;
27
- export declare const AnalyzeChangesSchema: z.ZodObject<{
28
- repoPath: z.ZodString;
29
- onlyStaged: z.ZodOptional<z.ZodBoolean>;
30
- }, "strip", z.ZodTypeAny, {
31
- repoPath: string;
32
- onlyStaged?: boolean | undefined;
33
- }, {
34
- repoPath: string;
35
- onlyStaged?: boolean | undefined;
36
- }>;
37
- export declare const ListCommitFormatsSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
38
12
  export declare const ValidateApiKeySchema: z.ZodObject<{
39
13
  provider: z.ZodEnum<["gemini", "openai", "codestral", "ollama"]>;
40
- apiKey: z.ZodOptional<z.ZodString>;
41
14
  }, "strip", z.ZodTypeAny, {
42
15
  provider: "gemini" | "openai" | "codestral" | "ollama";
43
- apiKey?: string | undefined;
44
16
  }, {
45
17
  provider: "gemini" | "openai" | "codestral" | "ollama";
46
- apiKey?: string | undefined;
47
18
  }>;
48
19
  export declare function handleGenerateCommitMessage(args: z.infer<typeof GenerateCommitMessageSchema>): Promise<{
49
20
  content: {
@@ -58,25 +29,6 @@ export declare function handleGenerateCommitMessage(args: z.infer<typeof Generat
58
29
  }[];
59
30
  isError: boolean;
60
31
  }>;
61
- export declare function handleAnalyzeChanges(args: z.infer<typeof AnalyzeChangesSchema>): Promise<{
62
- content: {
63
- type: string;
64
- text: string;
65
- }[];
66
- isError?: undefined;
67
- } | {
68
- content: {
69
- type: string;
70
- text: string;
71
- }[];
72
- isError: boolean;
73
- }>;
74
- export declare function handleListCommitFormats(_args: z.infer<typeof ListCommitFormatsSchema>): Promise<{
75
- content: {
76
- type: string;
77
- text: string;
78
- }[];
79
- }>;
80
32
  export declare function handleValidateApiKey(args: z.infer<typeof ValidateApiKeySchema>): Promise<{
81
33
  content: {
82
34
  type: string;
@@ -1 +1 @@
1
- {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../src/server/tools.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;EA+BtC,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;;;;EAM/B,CAAC;AAEH,eAAO,MAAM,uBAAuB,gDAAe,CAAC;AAEpD,eAAO,MAAM,oBAAoB;;;;;;;;;EAK/B,CAAC;AAGH,wBAAsB,2BAA2B,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC;;;;;;;;;;;;GAkElG;AAED,wBAAsB,oBAAoB,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC;;;;;;;;;;;;GAuDpF;AAED,wBAAsB,uBAAuB,CAAC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC;;;;;GA4D3F;AAED,wBAAsB,oBAAoB,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC;;;;;;;;;;;;GA+DpF"}
1
+ {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../src/server/tools.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,2BAA2B;;;;;;EAMtC,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;EAI/B,CAAC;AAGH,wBAAsB,2BAA2B,CAC/C,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC;;;;;;;;;;;;GA+ClD;AAED,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC;;;;;;;;;;;;GAgE3C"}