@azerate/claudette-mcp 1.7.2 → 1.7.4
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 +214 -214
- package/dist/index.js +62 -5
- package/package.json +39 -39
package/README.md
CHANGED
|
@@ -1,214 +1,214 @@
|
|
|
1
|
-
# Claudette MCP Server
|
|
2
|
-
|
|
3
|
-
MCP server for Claudette IDE - providing Claude with comprehensive workspace management tools.
|
|
4
|
-
|
|
5
|
-
## Installation
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
npx @azerate/claudette-mcp
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
Or install globally:
|
|
12
|
-
```bash
|
|
13
|
-
npm install -g @azerate/claudette-mcp
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
## Setup
|
|
17
|
-
|
|
18
|
-
### Option 1: Add via Claude Code CLI
|
|
19
|
-
```bash
|
|
20
|
-
claude mcp add claudette -- npx @azerate/claudette-mcp
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
### Option 2: Add to .mcp.json (project-level)
|
|
24
|
-
Create `.mcp.json` in your project root:
|
|
25
|
-
```json
|
|
26
|
-
{
|
|
27
|
-
"mcpServers": {
|
|
28
|
-
"claudette": {
|
|
29
|
-
"type": "stdio",
|
|
30
|
-
"command": "npx",
|
|
31
|
-
"args": ["@azerate/claudette-mcp"]
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
### Option 3: Add to Claude Code settings
|
|
38
|
-
Add to `~/.claude.json`:
|
|
39
|
-
```json
|
|
40
|
-
"mcpServers": {
|
|
41
|
-
"claudette": {
|
|
42
|
-
"type": "stdio",
|
|
43
|
-
"command": "npx",
|
|
44
|
-
"args": ["@azerate/claudette-mcp"]
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
## Available Tools
|
|
50
|
-
|
|
51
|
-
### Code Quality
|
|
52
|
-
|
|
53
|
-
| Tool | Description |
|
|
54
|
-
|------|-------------|
|
|
55
|
-
| `get_errors` | Get TypeScript compilation errors for the workspace |
|
|
56
|
-
| `run_tests` | Run Jest tests and return results |
|
|
57
|
-
| `get_test_results` | Get the latest test results |
|
|
58
|
-
| `run_benchmarks` | Run performance benchmarks (tinybench/vitest) |
|
|
59
|
-
| `get_benchmark_results` | Get the latest benchmark results |
|
|
60
|
-
|
|
61
|
-
### Git & Changes
|
|
62
|
-
|
|
63
|
-
| Tool | Description |
|
|
64
|
-
|------|-------------|
|
|
65
|
-
| `get_changes` | Get pending git changes (modified, added, deleted files) |
|
|
66
|
-
| `get_branch_info` | Get current branch, behind/ahead status, sync state |
|
|
67
|
-
| `get_branch_pr_status` | Check if current branch has an open/merged/closed PR |
|
|
68
|
-
| `create_branch` | Create a new feature branch from main/master |
|
|
69
|
-
| `sync_branch` | Rebase or merge current branch with main |
|
|
70
|
-
| `get_checkpoints` | List saved checkpoints (git stash snapshots) |
|
|
71
|
-
| `create_checkpoint` | Create a checkpoint before risky changes |
|
|
72
|
-
| `restore_checkpoint` | Restore workspace to a previous checkpoint |
|
|
73
|
-
| `delete_checkpoint` | Delete a checkpoint permanently |
|
|
74
|
-
|
|
75
|
-
### Workflow Automation
|
|
76
|
-
|
|
77
|
-
| Tool | Description |
|
|
78
|
-
|------|-------------|
|
|
79
|
-
| `get_workflow_status` | Get current workflow pipeline status |
|
|
80
|
-
| `get_workflow_recommendation` | **Smart recommendation** - analyzes branch, PR status, and changes to suggest the best next action |
|
|
81
|
-
| `trigger_workflow` | Start the workflow (lint, types, tests, coverage, benchmarks) |
|
|
82
|
-
| `generate_commit_message` | Generate a commit message from changes |
|
|
83
|
-
| `approve_commit` | Stage and commit with the provided message |
|
|
84
|
-
| `approve_push` | Push committed changes to remote |
|
|
85
|
-
| `approve_write_tests` | Mark the write tests step as complete |
|
|
86
|
-
| `create_pr` | Create a pull request using gh CLI |
|
|
87
|
-
| `approve_code_review` | Mark the code review step as complete |
|
|
88
|
-
|
|
89
|
-
### Project Memory
|
|
90
|
-
|
|
91
|
-
| Tool | Description |
|
|
92
|
-
|------|-------------|
|
|
93
|
-
| `get_memory` | Get project memory notes |
|
|
94
|
-
| `add_memory` | Add a note to project memory |
|
|
95
|
-
| `clear_memory` | Clear all project memory notes |
|
|
96
|
-
| `delete_memory` | Delete specific notes by index |
|
|
97
|
-
| `replace_memory` | Replace all memory with new notes |
|
|
98
|
-
|
|
99
|
-
### Scripts & Automation
|
|
100
|
-
|
|
101
|
-
| Tool | Description |
|
|
102
|
-
|------|-------------|
|
|
103
|
-
| `list_scripts` | List npm scripts and their status |
|
|
104
|
-
| `run_script` | Start an npm script |
|
|
105
|
-
| `stop_script` | Stop a running script |
|
|
106
|
-
| `get_console_output` | Get console output from a script |
|
|
107
|
-
| `check_quick_actions` | Check for pending UI-triggered actions |
|
|
108
|
-
|
|
109
|
-
### Refactoring
|
|
110
|
-
|
|
111
|
-
| Tool | Description |
|
|
112
|
-
|------|-------------|
|
|
113
|
-
| `create_refactor_plan` | Analyze workspace and create refactoring plan |
|
|
114
|
-
| `get_refactor_plan` | Get the current refactor plan |
|
|
115
|
-
| `get_next_refactor_step` | Get the next uncompleted step |
|
|
116
|
-
| `verify_refactor` | Run tests and compare to baseline |
|
|
117
|
-
| `complete_refactor_step` | Mark a step as completed |
|
|
118
|
-
| `complete_refactor` | Finish refactoring and delete plan |
|
|
119
|
-
|
|
120
|
-
## Smart Workflow Recommendations
|
|
121
|
-
|
|
122
|
-
Before starting a workflow, always call `get_workflow_recommendation` to get intelligent guidance:
|
|
123
|
-
|
|
124
|
-
```
|
|
125
|
-
get_workflow_recommendation(workspace_path="/path/to/project")
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
The tool analyzes your current state and recommends the best action:
|
|
129
|
-
|
|
130
|
-
| Recommended Action | When | What to Do |
|
|
131
|
-
|-------------------|------|------------|
|
|
132
|
-
| `start_workflow` | Normal flow, no blockers | Proceed with `trigger_workflow` |
|
|
133
|
-
| `create_feature_branch` | On main with `requireFeatureBranch` enabled | Use `create_branch` first |
|
|
134
|
-
| `add_to_existing_pr` | On feature branch with open PR | Your commits will update the existing PR |
|
|
135
|
-
| `switch_to_main` | PR was merged, branch is stale | Switch to main, pull, create new branch |
|
|
136
|
-
| `create_new_branch` | PR was closed (not merged) | Create a fresh branch or reopen PR |
|
|
137
|
-
| `sync_branch_first` | Branch is >5 commits behind main | Use `sync_branch` before committing |
|
|
138
|
-
| `no_changes` | No uncommitted changes | Nothing to commit yet |
|
|
139
|
-
|
|
140
|
-
Each recommendation includes:
|
|
141
|
-
- **reason**: Why this action is recommended
|
|
142
|
-
- **suggestion**: What you should do (trust this!)
|
|
143
|
-
- **consequences**: What will happen if you proceed
|
|
144
|
-
|
|
145
|
-
## Workflow Pipeline
|
|
146
|
-
|
|
147
|
-
The workflow feature provides a 10-step guided development process with best-practice Git support:
|
|
148
|
-
|
|
149
|
-
```
|
|
150
|
-
trigger_workflow()
|
|
151
|
-
|
|
|
152
|
-
v
|
|
153
|
-
[AUTOMATIC CHECKS]
|
|
154
|
-
1. Type checking (tsc --noEmit)
|
|
155
|
-
2. Lint/Format (eslint --fix)
|
|
156
|
-
3. Run tests
|
|
157
|
-
4. Coverage analysis (files needing tests)
|
|
158
|
-
5. Benchmarks (optional)
|
|
159
|
-
|
|
|
160
|
-
v
|
|
161
|
-
[HUMAN GATES]
|
|
162
|
-
6. Write Tests (if coverage found gaps)
|
|
163
|
-
7. Commit (approve_commit)
|
|
164
|
-
8. Push (approve_push)
|
|
165
|
-
9. Create PR (skipped if on main)
|
|
166
|
-
10. Code Review (approve_code_review)
|
|
167
|
-
```
|
|
168
|
-
|
|
169
|
-
### Branch Management
|
|
170
|
-
|
|
171
|
-
Best practice: Work on feature branches, not directly on main.
|
|
172
|
-
|
|
173
|
-
```
|
|
174
|
-
# Check current branch status
|
|
175
|
-
get_branch_info(workspace_path="/path/to/project")
|
|
176
|
-
|
|
177
|
-
# Create a feature branch
|
|
178
|
-
create_branch(workspace_path="/path/to/project", branch_name="feature/my-feature")
|
|
179
|
-
|
|
180
|
-
# Sync with latest main (rebase)
|
|
181
|
-
sync_branch(workspace_path="/path/to/project", method="rebase")
|
|
182
|
-
```
|
|
183
|
-
|
|
184
|
-
The workflow enforces feature branch usage by default (`requireFeatureBranch: true`).
|
|
185
|
-
Toggle this in the UI or set in `.claudette/workflow-config.json`.
|
|
186
|
-
|
|
187
|
-
## Example Usage
|
|
188
|
-
|
|
189
|
-
```
|
|
190
|
-
# Check for errors
|
|
191
|
-
get_errors(workspace_path="/path/to/project")
|
|
192
|
-
|
|
193
|
-
# Run full workflow
|
|
194
|
-
trigger_workflow(workspace_path="/path/to/project")
|
|
195
|
-
|
|
196
|
-
# Check workflow status
|
|
197
|
-
get_workflow_status(workspace_path="/path/to/project")
|
|
198
|
-
|
|
199
|
-
# After checks pass, commit
|
|
200
|
-
generate_commit_message(workspace_path="/path/to/project")
|
|
201
|
-
approve_commit(workspace_path="/path/to/project", message="Add new feature")
|
|
202
|
-
|
|
203
|
-
# Push changes
|
|
204
|
-
approve_push(workspace_path="/path/to/project")
|
|
205
|
-
```
|
|
206
|
-
|
|
207
|
-
## Requirements
|
|
208
|
-
|
|
209
|
-
- Node.js 18+
|
|
210
|
-
- Claudette IDE server running on port 52001 (for full functionality)
|
|
211
|
-
|
|
212
|
-
## License
|
|
213
|
-
|
|
214
|
-
MIT
|
|
1
|
+
# Claudette MCP Server
|
|
2
|
+
|
|
3
|
+
MCP server for Claudette IDE - providing Claude with comprehensive workspace management tools.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npx @azerate/claudette-mcp
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Or install globally:
|
|
12
|
+
```bash
|
|
13
|
+
npm install -g @azerate/claudette-mcp
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Setup
|
|
17
|
+
|
|
18
|
+
### Option 1: Add via Claude Code CLI
|
|
19
|
+
```bash
|
|
20
|
+
claude mcp add claudette -- npx @azerate/claudette-mcp
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### Option 2: Add to .mcp.json (project-level)
|
|
24
|
+
Create `.mcp.json` in your project root:
|
|
25
|
+
```json
|
|
26
|
+
{
|
|
27
|
+
"mcpServers": {
|
|
28
|
+
"claudette": {
|
|
29
|
+
"type": "stdio",
|
|
30
|
+
"command": "npx",
|
|
31
|
+
"args": ["@azerate/claudette-mcp"]
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Option 3: Add to Claude Code settings
|
|
38
|
+
Add to `~/.claude.json`:
|
|
39
|
+
```json
|
|
40
|
+
"mcpServers": {
|
|
41
|
+
"claudette": {
|
|
42
|
+
"type": "stdio",
|
|
43
|
+
"command": "npx",
|
|
44
|
+
"args": ["@azerate/claudette-mcp"]
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Available Tools
|
|
50
|
+
|
|
51
|
+
### Code Quality
|
|
52
|
+
|
|
53
|
+
| Tool | Description |
|
|
54
|
+
|------|-------------|
|
|
55
|
+
| `get_errors` | Get TypeScript compilation errors for the workspace |
|
|
56
|
+
| `run_tests` | Run Jest tests and return results |
|
|
57
|
+
| `get_test_results` | Get the latest test results |
|
|
58
|
+
| `run_benchmarks` | Run performance benchmarks (tinybench/vitest) |
|
|
59
|
+
| `get_benchmark_results` | Get the latest benchmark results |
|
|
60
|
+
|
|
61
|
+
### Git & Changes
|
|
62
|
+
|
|
63
|
+
| Tool | Description |
|
|
64
|
+
|------|-------------|
|
|
65
|
+
| `get_changes` | Get pending git changes (modified, added, deleted files) |
|
|
66
|
+
| `get_branch_info` | Get current branch, behind/ahead status, sync state |
|
|
67
|
+
| `get_branch_pr_status` | Check if current branch has an open/merged/closed PR |
|
|
68
|
+
| `create_branch` | Create a new feature branch from main/master |
|
|
69
|
+
| `sync_branch` | Rebase or merge current branch with main |
|
|
70
|
+
| `get_checkpoints` | List saved checkpoints (git stash snapshots) |
|
|
71
|
+
| `create_checkpoint` | Create a checkpoint before risky changes |
|
|
72
|
+
| `restore_checkpoint` | Restore workspace to a previous checkpoint |
|
|
73
|
+
| `delete_checkpoint` | Delete a checkpoint permanently |
|
|
74
|
+
|
|
75
|
+
### Workflow Automation
|
|
76
|
+
|
|
77
|
+
| Tool | Description |
|
|
78
|
+
|------|-------------|
|
|
79
|
+
| `get_workflow_status` | Get current workflow pipeline status |
|
|
80
|
+
| `get_workflow_recommendation` | **Smart recommendation** - analyzes branch, PR status, and changes to suggest the best next action |
|
|
81
|
+
| `trigger_workflow` | Start the workflow (lint, types, tests, coverage, benchmarks) |
|
|
82
|
+
| `generate_commit_message` | Generate a commit message from changes |
|
|
83
|
+
| `approve_commit` | Stage and commit with the provided message |
|
|
84
|
+
| `approve_push` | Push committed changes to remote |
|
|
85
|
+
| `approve_write_tests` | Mark the write tests step as complete |
|
|
86
|
+
| `create_pr` | Create a pull request using gh CLI |
|
|
87
|
+
| `approve_code_review` | Mark the code review step as complete |
|
|
88
|
+
|
|
89
|
+
### Project Memory
|
|
90
|
+
|
|
91
|
+
| Tool | Description |
|
|
92
|
+
|------|-------------|
|
|
93
|
+
| `get_memory` | Get project memory notes |
|
|
94
|
+
| `add_memory` | Add a note to project memory |
|
|
95
|
+
| `clear_memory` | Clear all project memory notes |
|
|
96
|
+
| `delete_memory` | Delete specific notes by index |
|
|
97
|
+
| `replace_memory` | Replace all memory with new notes |
|
|
98
|
+
|
|
99
|
+
### Scripts & Automation
|
|
100
|
+
|
|
101
|
+
| Tool | Description |
|
|
102
|
+
|------|-------------|
|
|
103
|
+
| `list_scripts` | List npm scripts and their status |
|
|
104
|
+
| `run_script` | Start an npm script |
|
|
105
|
+
| `stop_script` | Stop a running script |
|
|
106
|
+
| `get_console_output` | Get console output from a script |
|
|
107
|
+
| `check_quick_actions` | Check for pending UI-triggered actions |
|
|
108
|
+
|
|
109
|
+
### Refactoring
|
|
110
|
+
|
|
111
|
+
| Tool | Description |
|
|
112
|
+
|------|-------------|
|
|
113
|
+
| `create_refactor_plan` | Analyze workspace and create refactoring plan |
|
|
114
|
+
| `get_refactor_plan` | Get the current refactor plan |
|
|
115
|
+
| `get_next_refactor_step` | Get the next uncompleted step |
|
|
116
|
+
| `verify_refactor` | Run tests and compare to baseline |
|
|
117
|
+
| `complete_refactor_step` | Mark a step as completed |
|
|
118
|
+
| `complete_refactor` | Finish refactoring and delete plan |
|
|
119
|
+
|
|
120
|
+
## Smart Workflow Recommendations
|
|
121
|
+
|
|
122
|
+
Before starting a workflow, always call `get_workflow_recommendation` to get intelligent guidance:
|
|
123
|
+
|
|
124
|
+
```
|
|
125
|
+
get_workflow_recommendation(workspace_path="/path/to/project")
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
The tool analyzes your current state and recommends the best action:
|
|
129
|
+
|
|
130
|
+
| Recommended Action | When | What to Do |
|
|
131
|
+
|-------------------|------|------------|
|
|
132
|
+
| `start_workflow` | Normal flow, no blockers | Proceed with `trigger_workflow` |
|
|
133
|
+
| `create_feature_branch` | On main with `requireFeatureBranch` enabled | Use `create_branch` first |
|
|
134
|
+
| `add_to_existing_pr` | On feature branch with open PR | Your commits will update the existing PR |
|
|
135
|
+
| `switch_to_main` | PR was merged, branch is stale | Switch to main, pull, create new branch |
|
|
136
|
+
| `create_new_branch` | PR was closed (not merged) | Create a fresh branch or reopen PR |
|
|
137
|
+
| `sync_branch_first` | Branch is >5 commits behind main | Use `sync_branch` before committing |
|
|
138
|
+
| `no_changes` | No uncommitted changes | Nothing to commit yet |
|
|
139
|
+
|
|
140
|
+
Each recommendation includes:
|
|
141
|
+
- **reason**: Why this action is recommended
|
|
142
|
+
- **suggestion**: What you should do (trust this!)
|
|
143
|
+
- **consequences**: What will happen if you proceed
|
|
144
|
+
|
|
145
|
+
## Workflow Pipeline
|
|
146
|
+
|
|
147
|
+
The workflow feature provides a 10-step guided development process with best-practice Git support:
|
|
148
|
+
|
|
149
|
+
```
|
|
150
|
+
trigger_workflow()
|
|
151
|
+
|
|
|
152
|
+
v
|
|
153
|
+
[AUTOMATIC CHECKS]
|
|
154
|
+
1. Type checking (tsc --noEmit)
|
|
155
|
+
2. Lint/Format (eslint --fix)
|
|
156
|
+
3. Run tests
|
|
157
|
+
4. Coverage analysis (files needing tests)
|
|
158
|
+
5. Benchmarks (optional)
|
|
159
|
+
|
|
|
160
|
+
v
|
|
161
|
+
[HUMAN GATES]
|
|
162
|
+
6. Write Tests (if coverage found gaps)
|
|
163
|
+
7. Commit (approve_commit)
|
|
164
|
+
8. Push (approve_push)
|
|
165
|
+
9. Create PR (skipped if on main)
|
|
166
|
+
10. Code Review (approve_code_review)
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
### Branch Management
|
|
170
|
+
|
|
171
|
+
Best practice: Work on feature branches, not directly on main.
|
|
172
|
+
|
|
173
|
+
```
|
|
174
|
+
# Check current branch status
|
|
175
|
+
get_branch_info(workspace_path="/path/to/project")
|
|
176
|
+
|
|
177
|
+
# Create a feature branch
|
|
178
|
+
create_branch(workspace_path="/path/to/project", branch_name="feature/my-feature")
|
|
179
|
+
|
|
180
|
+
# Sync with latest main (rebase)
|
|
181
|
+
sync_branch(workspace_path="/path/to/project", method="rebase")
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
The workflow enforces feature branch usage by default (`requireFeatureBranch: true`).
|
|
185
|
+
Toggle this in the UI or set in `.claudette/workflow-config.json`.
|
|
186
|
+
|
|
187
|
+
## Example Usage
|
|
188
|
+
|
|
189
|
+
```
|
|
190
|
+
# Check for errors
|
|
191
|
+
get_errors(workspace_path="/path/to/project")
|
|
192
|
+
|
|
193
|
+
# Run full workflow
|
|
194
|
+
trigger_workflow(workspace_path="/path/to/project")
|
|
195
|
+
|
|
196
|
+
# Check workflow status
|
|
197
|
+
get_workflow_status(workspace_path="/path/to/project")
|
|
198
|
+
|
|
199
|
+
# After checks pass, commit
|
|
200
|
+
generate_commit_message(workspace_path="/path/to/project")
|
|
201
|
+
approve_commit(workspace_path="/path/to/project", message="Add new feature")
|
|
202
|
+
|
|
203
|
+
# Push changes
|
|
204
|
+
approve_push(workspace_path="/path/to/project")
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
## Requirements
|
|
208
|
+
|
|
209
|
+
- Node.js 18+
|
|
210
|
+
- Claudette IDE server running on port 52001 (for full functionality)
|
|
211
|
+
|
|
212
|
+
## License
|
|
213
|
+
|
|
214
|
+
MIT
|
package/dist/index.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
3
3
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
4
4
|
import { CallToolRequestSchema, ListToolsRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
|
|
5
|
+
import { execSync } from "child_process";
|
|
5
6
|
// Import from extracted modules
|
|
6
7
|
import { getScripts, getScriptOutput, startScript, stopScript } from './scripts.js';
|
|
7
8
|
import { getWorkspaceConfig, saveWorkspaceConfig, clearMemory, deleteMemoryNotes, replaceMemory } from './workspace.js';
|
|
@@ -541,7 +542,7 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
541
542
|
},
|
|
542
543
|
{
|
|
543
544
|
name: "approve_code_review",
|
|
544
|
-
description: "
|
|
545
|
+
description: "Complete the code review step AND merge the PR. This will merge the PR on GitHub and mark the workflow as complete.",
|
|
545
546
|
inputSchema: {
|
|
546
547
|
type: "object",
|
|
547
548
|
properties: {
|
|
@@ -553,6 +554,11 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
553
554
|
type: "string",
|
|
554
555
|
description: "Name of the reviewer (optional)",
|
|
555
556
|
},
|
|
557
|
+
merge_method: {
|
|
558
|
+
type: "string",
|
|
559
|
+
enum: ["squash", "merge", "rebase"],
|
|
560
|
+
description: "How to merge the PR: squash (default), merge, or rebase",
|
|
561
|
+
},
|
|
556
562
|
},
|
|
557
563
|
required: ["workspace_path"],
|
|
558
564
|
},
|
|
@@ -1552,22 +1558,73 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
1552
1558
|
case "approve_code_review": {
|
|
1553
1559
|
const workspacePath = args?.workspace_path;
|
|
1554
1560
|
const reviewer = args?.reviewer;
|
|
1561
|
+
const mergeMethod = args?.merge_method || 'squash';
|
|
1555
1562
|
if (!workspacePath) {
|
|
1556
1563
|
return { content: [{ type: "text", text: "Error: workspace_path is required" }] };
|
|
1557
1564
|
}
|
|
1558
1565
|
try {
|
|
1566
|
+
// First, check if there's an open PR for this branch
|
|
1567
|
+
let prNumber;
|
|
1568
|
+
let prTitle;
|
|
1569
|
+
try {
|
|
1570
|
+
const prInfo = execSync('gh pr view --json number,title,state', {
|
|
1571
|
+
cwd: workspacePath,
|
|
1572
|
+
encoding: 'utf-8',
|
|
1573
|
+
});
|
|
1574
|
+
const parsed = JSON.parse(prInfo);
|
|
1575
|
+
prNumber = parsed.number?.toString();
|
|
1576
|
+
prTitle = parsed.title;
|
|
1577
|
+
// Skip merge if PR is already merged/closed
|
|
1578
|
+
if (parsed.state !== 'OPEN') {
|
|
1579
|
+
prNumber = undefined;
|
|
1580
|
+
}
|
|
1581
|
+
}
|
|
1582
|
+
catch {
|
|
1583
|
+
// No PR found
|
|
1584
|
+
}
|
|
1585
|
+
// Merge the PR if one exists
|
|
1586
|
+
let merged = false;
|
|
1587
|
+
if (prNumber) {
|
|
1588
|
+
const mergeFlag = mergeMethod === 'squash' ? '--squash' : mergeMethod === 'rebase' ? '--rebase' : '--merge';
|
|
1589
|
+
try {
|
|
1590
|
+
execSync(`gh pr merge ${prNumber} ${mergeFlag} --delete-branch`, {
|
|
1591
|
+
cwd: workspacePath,
|
|
1592
|
+
encoding: 'utf-8',
|
|
1593
|
+
stdio: 'pipe',
|
|
1594
|
+
});
|
|
1595
|
+
merged = true;
|
|
1596
|
+
}
|
|
1597
|
+
catch (mergeErr) {
|
|
1598
|
+
return { content: [{ type: "text", text: `❌ Failed to merge PR #${prNumber}: ${mergeErr.message}` }] };
|
|
1599
|
+
}
|
|
1600
|
+
}
|
|
1601
|
+
// Mark workflow as complete
|
|
1559
1602
|
const response = await fetch(`${CLAUDETTE_API}/api/workflow/code-review`, {
|
|
1560
1603
|
method: "POST",
|
|
1561
1604
|
headers: { "Content-Type": "application/json" },
|
|
1562
1605
|
body: JSON.stringify({ path: workspacePath, reviewer }),
|
|
1563
1606
|
});
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1607
|
+
await response.json();
|
|
1608
|
+
// Reset workflow after successful merge
|
|
1609
|
+
await fetch(`${CLAUDETTE_API}/api/workflow/reset`, {
|
|
1610
|
+
method: "POST",
|
|
1611
|
+
headers: { "Content-Type": "application/json" },
|
|
1612
|
+
body: JSON.stringify({ path: workspacePath }),
|
|
1613
|
+
});
|
|
1614
|
+
let output = '';
|
|
1615
|
+
if (merged && prNumber) {
|
|
1616
|
+
output += `✅ PR #${prNumber} merged successfully!\n\n`;
|
|
1617
|
+
output += `Title: ${prTitle}\n`;
|
|
1618
|
+
output += `Method: ${mergeMethod}\n`;
|
|
1619
|
+
output += `Branch deleted: Yes\n`;
|
|
1567
1620
|
}
|
|
1568
1621
|
else {
|
|
1569
|
-
|
|
1622
|
+
output += `✅ Code review approved!\n\n`;
|
|
1570
1623
|
}
|
|
1624
|
+
if (reviewer)
|
|
1625
|
+
output += `Reviewer: ${reviewer}\n`;
|
|
1626
|
+
output += `\nWorkflow complete and reset.`;
|
|
1627
|
+
return { content: [{ type: "text", text: output }] };
|
|
1571
1628
|
}
|
|
1572
1629
|
catch (err) {
|
|
1573
1630
|
return { content: [{ type: "text", text: `Error: ${err.message}` }] };
|
package/package.json
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@azerate/claudette-mcp",
|
|
3
|
-
"version": "1.7.
|
|
4
|
-
"description": "MCP server for Claudette IDE - TypeScript errors, git changes, checkpoints, memory, and script management",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"main": "dist/index.js",
|
|
7
|
-
"bin": {
|
|
8
|
-
"claudette-mcp": "dist/index.js"
|
|
9
|
-
},
|
|
10
|
-
"files": [
|
|
11
|
-
"dist"
|
|
12
|
-
],
|
|
13
|
-
"scripts": {
|
|
14
|
-
"build": "tsc",
|
|
15
|
-
"start": "node dist/index.js",
|
|
16
|
-
"prepublishOnly": "npm run build"
|
|
17
|
-
},
|
|
18
|
-
"keywords": [
|
|
19
|
-
"mcp",
|
|
20
|
-
"claude",
|
|
21
|
-
"claudette",
|
|
22
|
-
"typescript",
|
|
23
|
-
"git",
|
|
24
|
-
"ide"
|
|
25
|
-
],
|
|
26
|
-
"author": "azerate",
|
|
27
|
-
"license": "MIT",
|
|
28
|
-
"repository": {
|
|
29
|
-
"type": "git",
|
|
30
|
-
"url": "https://github.com/azerate/claudette"
|
|
31
|
-
},
|
|
32
|
-
"dependencies": {
|
|
33
|
-
"@modelcontextprotocol/sdk": "^1.0.0"
|
|
34
|
-
},
|
|
35
|
-
"devDependencies": {
|
|
36
|
-
"@types/node": "^22.0.0",
|
|
37
|
-
"typescript": "^5.7.0"
|
|
38
|
-
}
|
|
39
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@azerate/claudette-mcp",
|
|
3
|
+
"version": "1.7.4",
|
|
4
|
+
"description": "MCP server for Claudette IDE - TypeScript errors, git changes, checkpoints, memory, and script management",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"bin": {
|
|
8
|
+
"claudette-mcp": "dist/index.js"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"dist"
|
|
12
|
+
],
|
|
13
|
+
"scripts": {
|
|
14
|
+
"build": "tsc",
|
|
15
|
+
"start": "node dist/index.js",
|
|
16
|
+
"prepublishOnly": "npm run build"
|
|
17
|
+
},
|
|
18
|
+
"keywords": [
|
|
19
|
+
"mcp",
|
|
20
|
+
"claude",
|
|
21
|
+
"claudette",
|
|
22
|
+
"typescript",
|
|
23
|
+
"git",
|
|
24
|
+
"ide"
|
|
25
|
+
],
|
|
26
|
+
"author": "azerate",
|
|
27
|
+
"license": "MIT",
|
|
28
|
+
"repository": {
|
|
29
|
+
"type": "git",
|
|
30
|
+
"url": "https://github.com/azerate/claudette"
|
|
31
|
+
},
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"@modelcontextprotocol/sdk": "^1.0.0"
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"@types/node": "^22.0.0",
|
|
37
|
+
"typescript": "^5.7.0"
|
|
38
|
+
}
|
|
39
|
+
}
|