mcp-perforce-server 2.1.0 → 2.1.2
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/MCP_CONFIG_EXAMPLES.md +214 -223
- package/README.md +192 -568
- package/dist/p4/config.d.ts.map +1 -1
- package/dist/p4/config.js +17 -3
- package/dist/p4/config.js.map +1 -1
- package/dist/p4/parse.d.ts +28 -0
- package/dist/p4/parse.d.ts.map +1 -1
- package/dist/p4/parse.js +341 -29
- package/dist/p4/parse.js.map +1 -1
- package/dist/p4/runner.d.ts.map +1 -1
- package/dist/p4/runner.js +223 -14
- package/dist/p4/runner.js.map +1 -1
- package/dist/p4/security.d.ts.map +1 -1
- package/dist/p4/security.js +15 -5
- package/dist/p4/security.js.map +1 -1
- package/dist/server.d.ts +15 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +390 -107
- package/dist/server.js.map +1 -1
- package/dist/tools/basic.d.ts +58 -0
- package/dist/tools/basic.d.ts.map +1 -1
- package/dist/tools/basic.js +450 -52
- package/dist/tools/basic.js.map +1 -1
- package/dist/tools/changelist.d.ts +1 -1
- package/dist/tools/changelist.d.ts.map +1 -1
- package/dist/tools/changelist.js +31 -22
- package/dist/tools/changelist.js.map +1 -1
- package/dist/tools/index.d.ts +1 -1
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +8 -1
- package/dist/tools/index.js.map +1 -1
- package/package.json +1 -1
package/MCP_CONFIG_EXAMPLES.md
CHANGED
|
@@ -1,223 +1,214 @@
|
|
|
1
|
-
# MCP Perforce Server Configuration Examples
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
{
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
"
|
|
83
|
-
"
|
|
84
|
-
"
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
```json
|
|
98
|
-
{
|
|
99
|
-
"mcp": {
|
|
100
|
-
"servers": {
|
|
101
|
-
"perforce": {
|
|
102
|
-
"command": "mcp-perforce-server",
|
|
103
|
-
"args": [],
|
|
104
|
-
"env": {
|
|
105
|
-
"
|
|
106
|
-
"
|
|
107
|
-
"
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
"
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
"
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
```
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
### Full Access (Use with Caution)
|
|
216
|
-
```json
|
|
217
|
-
{
|
|
218
|
-
"env": {
|
|
219
|
-
"P4_READONLY_MODE": "false",
|
|
220
|
-
"P4_DISABLE_DELETE": "false"
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
```
|
|
1
|
+
# MCP Perforce Server Configuration Examples
|
|
2
|
+
|
|
3
|
+
All examples in this document use the default safe profile: read-only enabled and delete disabled.
|
|
4
|
+
|
|
5
|
+
## Client Config Fields
|
|
6
|
+
|
|
7
|
+
| Field | Required | Example | Description |
|
|
8
|
+
|---|---|---|---|
|
|
9
|
+
| `command` | Yes | `"mcp-perforce-server"` | Executable to start the MCP server. |
|
|
10
|
+
| `args` | No | `[]` or `["/path/to/dist/server.js"]` | Command arguments (use for local build path). |
|
|
11
|
+
| `env` | No | `{ "P4_READONLY_MODE": "true" }` | Server environment variables. |
|
|
12
|
+
| `alwaysAllow` | Client-specific | `["p4.*"]` or `true` | Auto-approve tool calls to reduce prompts. |
|
|
13
|
+
| `disabled` | Client-specific | `false` | Enables/disables the server entry. |
|
|
14
|
+
|
|
15
|
+
## Authentication Options
|
|
16
|
+
|
|
17
|
+
| Method | Recommended | How it works |
|
|
18
|
+
|---|---|---|
|
|
19
|
+
| `.p4config` file | Yes | Place Perforce variables in a `.p4config` file in your project/workspace root. |
|
|
20
|
+
| MCP `env` variables | Optional | Put Perforce variables directly in the MCP server config JSON. |
|
|
21
|
+
|
|
22
|
+
`.p4config` example:
|
|
23
|
+
|
|
24
|
+
```ini
|
|
25
|
+
P4PORT=perforce-server:1666
|
|
26
|
+
P4USER=your-username
|
|
27
|
+
P4CLIENT=your-workspace-name
|
|
28
|
+
P4PASSWD=your-password
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Environment Variables Used In Examples
|
|
32
|
+
|
|
33
|
+
| Variable | Example Value | Default | Purpose |
|
|
34
|
+
|---|---|---|---|
|
|
35
|
+
| `P4_READONLY_MODE` | `"true"` | `true` | Keeps server in read-only mode. |
|
|
36
|
+
| `P4_DISABLE_DELETE` | `"true"` | `true` | Keeps delete operations disabled. |
|
|
37
|
+
| `LOG_LEVEL` | `"error"` | `warn` | Keeps console output minimal. |
|
|
38
|
+
| `P4PORT` | `"perforce-server:1666"` | unset | Perforce server address (required if not in `.p4config`). |
|
|
39
|
+
| `P4USER` | `"your-username"` | unset | Perforce user (required if not in `.p4config`). |
|
|
40
|
+
| `P4CLIENT` | `"your-workspace-name"` | unset | Perforce client/workspace (required if not in `.p4config`). |
|
|
41
|
+
| `P4PASSWD` | `"your-password"` | unset | Password/ticket (optional depending on server auth). |
|
|
42
|
+
| `P4CHARSET` | `"utf8"` | unset | Optional Perforce charset. |
|
|
43
|
+
|
|
44
|
+
For the complete server configuration table (all supported env vars), see [README.md](README.md#server-configuration-reference).
|
|
45
|
+
|
|
46
|
+
## VS Code with Claude Dev/Cline
|
|
47
|
+
|
|
48
|
+
### Option 1: Using `.p4config` (Recommended)
|
|
49
|
+
|
|
50
|
+
```json
|
|
51
|
+
{
|
|
52
|
+
"mcpServers": {
|
|
53
|
+
"perforce": {
|
|
54
|
+
"command": "mcp-perforce-server",
|
|
55
|
+
"args": [],
|
|
56
|
+
"env": {
|
|
57
|
+
"P4_READONLY_MODE": "true",
|
|
58
|
+
"P4_DISABLE_DELETE": "true",
|
|
59
|
+
"LOG_LEVEL": "error"
|
|
60
|
+
},
|
|
61
|
+
"alwaysAllow": ["p4.*"],
|
|
62
|
+
"disabled": false
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### Option 2: Direct MCP Env Configuration
|
|
69
|
+
|
|
70
|
+
```json
|
|
71
|
+
{
|
|
72
|
+
"mcpServers": {
|
|
73
|
+
"perforce": {
|
|
74
|
+
"command": "mcp-perforce-server",
|
|
75
|
+
"args": [],
|
|
76
|
+
"env": {
|
|
77
|
+
"P4PORT": "perforce-server:1666",
|
|
78
|
+
"P4USER": "your-username",
|
|
79
|
+
"P4CLIENT": "your-workspace-name",
|
|
80
|
+
"P4PASSWD": "your-password",
|
|
81
|
+
"P4CHARSET": "utf8",
|
|
82
|
+
"P4_READONLY_MODE": "true",
|
|
83
|
+
"P4_DISABLE_DELETE": "true",
|
|
84
|
+
"LOG_LEVEL": "error"
|
|
85
|
+
},
|
|
86
|
+
"alwaysAllow": ["p4.*"],
|
|
87
|
+
"disabled": false
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## Cursor IDE
|
|
94
|
+
|
|
95
|
+
### Option 1: Using `.p4config` (Recommended)
|
|
96
|
+
|
|
97
|
+
```json
|
|
98
|
+
{
|
|
99
|
+
"mcp": {
|
|
100
|
+
"servers": {
|
|
101
|
+
"perforce": {
|
|
102
|
+
"command": "mcp-perforce-server",
|
|
103
|
+
"args": [],
|
|
104
|
+
"env": {
|
|
105
|
+
"P4_READONLY_MODE": "true",
|
|
106
|
+
"P4_DISABLE_DELETE": "true",
|
|
107
|
+
"LOG_LEVEL": "error"
|
|
108
|
+
},
|
|
109
|
+
"alwaysAllow": true
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### Option 2: Direct MCP Env Configuration
|
|
117
|
+
|
|
118
|
+
```json
|
|
119
|
+
{
|
|
120
|
+
"mcp": {
|
|
121
|
+
"servers": {
|
|
122
|
+
"perforce": {
|
|
123
|
+
"command": "mcp-perforce-server",
|
|
124
|
+
"args": [],
|
|
125
|
+
"env": {
|
|
126
|
+
"P4PORT": "perforce-server:1666",
|
|
127
|
+
"P4USER": "your-username",
|
|
128
|
+
"P4CLIENT": "your-workspace-name",
|
|
129
|
+
"P4PASSWD": "your-password",
|
|
130
|
+
"P4_READONLY_MODE": "true",
|
|
131
|
+
"P4_DISABLE_DELETE": "true",
|
|
132
|
+
"LOG_LEVEL": "error"
|
|
133
|
+
},
|
|
134
|
+
"alwaysAllow": true
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
## Claude Desktop
|
|
142
|
+
|
|
143
|
+
Config file paths:
|
|
144
|
+
|
|
145
|
+
| Platform | Path |
|
|
146
|
+
|---|---|
|
|
147
|
+
| macOS | `~/Library/Application Support/Claude/claude_desktop_config.json` |
|
|
148
|
+
| Windows | `%APPDATA%\Claude\claude_desktop_config.json` |
|
|
149
|
+
|
|
150
|
+
### Option 1: Using `.p4config` (Recommended)
|
|
151
|
+
|
|
152
|
+
```json
|
|
153
|
+
{
|
|
154
|
+
"mcpServers": {
|
|
155
|
+
"perforce": {
|
|
156
|
+
"command": "mcp-perforce-server",
|
|
157
|
+
"args": [],
|
|
158
|
+
"env": {
|
|
159
|
+
"P4_READONLY_MODE": "true",
|
|
160
|
+
"P4_DISABLE_DELETE": "true",
|
|
161
|
+
"LOG_LEVEL": "error"
|
|
162
|
+
},
|
|
163
|
+
"alwaysAllow": ["p4.*"]
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
### Option 2: Direct MCP Env Configuration
|
|
170
|
+
|
|
171
|
+
```json
|
|
172
|
+
{
|
|
173
|
+
"mcpServers": {
|
|
174
|
+
"perforce": {
|
|
175
|
+
"command": "mcp-perforce-server",
|
|
176
|
+
"args": [],
|
|
177
|
+
"env": {
|
|
178
|
+
"P4PORT": "perforce-server:1666",
|
|
179
|
+
"P4USER": "your-username",
|
|
180
|
+
"P4CLIENT": "your-workspace-name",
|
|
181
|
+
"P4_READONLY_MODE": "true",
|
|
182
|
+
"P4_DISABLE_DELETE": "true",
|
|
183
|
+
"LOG_LEVEL": "error"
|
|
184
|
+
},
|
|
185
|
+
"alwaysAllow": ["p4.*"]
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
## Local Development Setup (If Not Globally Installed)
|
|
192
|
+
|
|
193
|
+
Replace `command` with `node` and point `args` at your built server:
|
|
194
|
+
|
|
195
|
+
```json
|
|
196
|
+
{
|
|
197
|
+
"command": "node",
|
|
198
|
+
"args": ["/full/path/to/your/mcp-perforce-server/dist/server.js"]
|
|
199
|
+
}
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
## Safety Profile Used In This Document
|
|
203
|
+
|
|
204
|
+
| Profile | `P4_READONLY_MODE` | `P4_DISABLE_DELETE` | Behavior |
|
|
205
|
+
|---|---|---|---|
|
|
206
|
+
| Default safe profile | `true` | `true` | Read-only; write tools and delete operations blocked by default. |
|
|
207
|
+
|
|
208
|
+
## Troubleshooting
|
|
209
|
+
|
|
210
|
+
| Symptom | Check |
|
|
211
|
+
|---|---|
|
|
212
|
+
| Approval prompts still appear | Ensure `alwaysAllow` is configured for your client. |
|
|
213
|
+
| Too much terminal output | Set `LOG_LEVEL` to `"error"`. |
|
|
214
|
+
| Perforce auth/config errors | Verify `P4PORT`, `P4USER`, `P4CLIENT` are set via `.p4config` or MCP `env`. |
|