@azerate/claudette-mcp 1.7.3 → 1.7.5
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 +80 -21
- 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
|
@@ -1563,35 +1563,82 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
1563
1563
|
return { content: [{ type: "text", text: "Error: workspace_path is required" }] };
|
|
1564
1564
|
}
|
|
1565
1565
|
try {
|
|
1566
|
+
// SAFETY CHECK 1: Check for uncommitted changes
|
|
1567
|
+
try {
|
|
1568
|
+
const status = execSync('git status --porcelain', {
|
|
1569
|
+
cwd: workspacePath,
|
|
1570
|
+
encoding: 'utf-8',
|
|
1571
|
+
}).trim();
|
|
1572
|
+
if (status) {
|
|
1573
|
+
return { content: [{ type: "text", text: `❌ BLOCKED: You have uncommitted changes!\n\nUncommitted files:\n${status}\n\nCommit and push these changes before merging to avoid losing code.` }] };
|
|
1574
|
+
}
|
|
1575
|
+
}
|
|
1576
|
+
catch {
|
|
1577
|
+
// Ignore git status errors
|
|
1578
|
+
}
|
|
1579
|
+
// SAFETY CHECK 2: Check if local branch is ahead of remote (unpushed commits)
|
|
1580
|
+
try {
|
|
1581
|
+
const ahead = execSync('git rev-list @{u}..HEAD --count', {
|
|
1582
|
+
cwd: workspacePath,
|
|
1583
|
+
encoding: 'utf-8',
|
|
1584
|
+
}).trim();
|
|
1585
|
+
const aheadCount = parseInt(ahead, 10);
|
|
1586
|
+
if (aheadCount > 0) {
|
|
1587
|
+
return { content: [{ type: "text", text: `❌ BLOCKED: You have ${aheadCount} unpushed commit(s)!\n\nPush your changes before merging to avoid losing code.\nUse approve_push first, then try approve_code_review again.` }] };
|
|
1588
|
+
}
|
|
1589
|
+
}
|
|
1590
|
+
catch {
|
|
1591
|
+
// No upstream or error - continue (might be ok)
|
|
1592
|
+
}
|
|
1593
|
+
// SAFETY CHECK 3: Fetch and verify remote is up to date
|
|
1594
|
+
try {
|
|
1595
|
+
execSync('git fetch', { cwd: workspacePath, stdio: 'pipe', timeout: 10000 });
|
|
1596
|
+
const behind = execSync('git rev-list HEAD..@{u} --count', {
|
|
1597
|
+
cwd: workspacePath,
|
|
1598
|
+
encoding: 'utf-8',
|
|
1599
|
+
}).trim();
|
|
1600
|
+
const behindCount = parseInt(behind, 10);
|
|
1601
|
+
if (behindCount > 0) {
|
|
1602
|
+
return { content: [{ type: "text", text: `❌ BLOCKED: Remote has ${behindCount} commit(s) you don't have locally!\n\nPull the latest changes before merging.` }] };
|
|
1603
|
+
}
|
|
1604
|
+
}
|
|
1605
|
+
catch {
|
|
1606
|
+
// Ignore fetch errors
|
|
1607
|
+
}
|
|
1566
1608
|
// First, check if there's an open PR for this branch
|
|
1567
1609
|
let prNumber;
|
|
1568
1610
|
let prTitle;
|
|
1569
1611
|
try {
|
|
1570
|
-
const prInfo = execSync('gh pr view --json number,title', {
|
|
1612
|
+
const prInfo = execSync('gh pr view --json number,title,state', {
|
|
1571
1613
|
cwd: workspacePath,
|
|
1572
1614
|
encoding: 'utf-8',
|
|
1573
1615
|
});
|
|
1574
1616
|
const parsed = JSON.parse(prInfo);
|
|
1575
1617
|
prNumber = parsed.number?.toString();
|
|
1576
1618
|
prTitle = parsed.title;
|
|
1619
|
+
// Skip merge if PR is already merged/closed
|
|
1620
|
+
if (parsed.state !== 'OPEN') {
|
|
1621
|
+
prNumber = undefined;
|
|
1622
|
+
}
|
|
1577
1623
|
}
|
|
1578
1624
|
catch {
|
|
1579
1625
|
// No PR found
|
|
1580
1626
|
}
|
|
1581
|
-
if
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1627
|
+
// Merge the PR if one exists
|
|
1628
|
+
let merged = false;
|
|
1629
|
+
if (prNumber) {
|
|
1630
|
+
const mergeFlag = mergeMethod === 'squash' ? '--squash' : mergeMethod === 'rebase' ? '--rebase' : '--merge';
|
|
1631
|
+
try {
|
|
1632
|
+
execSync(`gh pr merge ${prNumber} ${mergeFlag} --delete-branch`, {
|
|
1633
|
+
cwd: workspacePath,
|
|
1634
|
+
encoding: 'utf-8',
|
|
1635
|
+
stdio: 'pipe',
|
|
1636
|
+
});
|
|
1637
|
+
merged = true;
|
|
1638
|
+
}
|
|
1639
|
+
catch (mergeErr) {
|
|
1640
|
+
return { content: [{ type: "text", text: `❌ Failed to merge PR #${prNumber}: ${mergeErr.message}` }] };
|
|
1641
|
+
}
|
|
1595
1642
|
}
|
|
1596
1643
|
// Mark workflow as complete
|
|
1597
1644
|
const response = await fetch(`${CLAUDETTE_API}/api/workflow/code-review`, {
|
|
@@ -1599,14 +1646,26 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
1599
1646
|
headers: { "Content-Type": "application/json" },
|
|
1600
1647
|
body: JSON.stringify({ path: workspacePath, reviewer }),
|
|
1601
1648
|
});
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1649
|
+
await response.json();
|
|
1650
|
+
// Reset workflow after successful merge
|
|
1651
|
+
await fetch(`${CLAUDETTE_API}/api/workflow/reset`, {
|
|
1652
|
+
method: "POST",
|
|
1653
|
+
headers: { "Content-Type": "application/json" },
|
|
1654
|
+
body: JSON.stringify({ path: workspacePath }),
|
|
1655
|
+
});
|
|
1656
|
+
let output = '';
|
|
1657
|
+
if (merged && prNumber) {
|
|
1658
|
+
output += `✅ PR #${prNumber} merged successfully!\n\n`;
|
|
1659
|
+
output += `Title: ${prTitle}\n`;
|
|
1660
|
+
output += `Method: ${mergeMethod}\n`;
|
|
1661
|
+
output += `Branch deleted: Yes\n`;
|
|
1662
|
+
}
|
|
1663
|
+
else {
|
|
1664
|
+
output += `✅ Code review approved!\n\n`;
|
|
1665
|
+
}
|
|
1607
1666
|
if (reviewer)
|
|
1608
1667
|
output += `Reviewer: ${reviewer}\n`;
|
|
1609
|
-
output += `\nWorkflow complete.`;
|
|
1668
|
+
output += `\nWorkflow complete and reset.`;
|
|
1610
1669
|
return { content: [{ type: "text", text: output }] };
|
|
1611
1670
|
}
|
|
1612
1671
|
catch (err) {
|
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.5",
|
|
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
|
+
}
|