mcp-perforce-server 2.1.0 → 2.1.1

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/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 iPraBhu
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1
+ MIT License
2
+
3
+ Copyright (c) 2026 iPraBhu
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
21
  SOFTWARE.
@@ -1,223 +1,223 @@
1
- # MCP Perforce Server Configuration Examples
2
-
3
- ## Silent Operation Configuration
4
-
5
- To prevent VS Code from asking for approval on every command and to hide terminal execution:
6
-
7
- **Key Settings:**
8
- - `"alwaysAllow": ["p4.*"]` or `"alwaysAllow": true` - Auto-approve all p4 commands
9
- - `"LOG_LEVEL": "error"` - Minimize console output (only show errors)
10
- - `"disabled": false` - Ensure server is enabled
11
-
12
- ## Authentication Configuration
13
-
14
- **Important:** Configure your Perforce credentials using one of these methods:
15
-
16
- 1. **`.p4config` file** (Recommended) - Create in project root:
17
- ```
18
- P4PORT=perforce-server:1666
19
- P4USER=your-username
20
- P4CLIENT=your-workspace-name
21
- P4PASSWD=your-password
22
- ```
23
-
24
- 2. **Environment variables** in MCP config (see examples below)
25
-
26
- The server automatically detects and uses these credentials. Passwords are masked in logs for security.
27
-
28
- ## VS Code with Claude Dev/Cline
29
-
30
- ### Option 1: Using .p4config file (Recommended)
31
- Create a `.p4config` file in your project root, then:
32
- ```json
33
- {
34
- "mcpServers": {
35
- "perforce": {
36
- "command": "mcp-perforce-server",
37
- "args": [],
38
- "env": {
39
- "P4_READONLY_MODE": "false",
40
- "P4_DISABLE_DELETE": "true",
41
- "LOG_LEVEL": "error"
42
- },
43
- "alwaysAllow": ["p4.*"],
44
- "disabled": false
45
- }
46
- }
47
- }
48
- ```
49
-
50
- ### Option 2: Direct configuration in MCP config
51
- ```json
52
- {
53
- "mcpServers": {
54
- "perforce": {
55
- "command": "mcp-perforce-server",
56
- "args": [],
57
- "env": {
58
- "P4PORT": "perforce-server:1666",
59
- "P4USER": "your-username",
60
- "P4CLIENT": "your-workspace-name",
61
- "P4PASSWD": "your-password",
62
- "P4CHARSET": "utf8",
63
- "P4_READONLY_MODE": "false",
64
- "P4_DISABLE_DELETE": "true",
65
- "LOG_LEVEL": "error"
66
- },
67
- "alwaysAllow": ["p4.*"],
68
- "disabled": false
69
- }
70
- }
71
- }
72
- ```
73
-
74
- ## Cursor IDE
75
-
76
- ### Option 1: Using .p4config file (Recommended)
77
- ```json
78
- {
79
- "mcp": {
80
- "servers": {
81
- "perforce": {
82
- "command": "mcp-perforce-server",
83
- "args": [],
84
- "env": {
85
- "P4_READONLY_MODE": "false",
86
- "P4_DISABLE_DELETE": "true",
87
- "LOG_LEVEL": "error"
88
- },
89
- "alwaysAllow": true
90
- }
91
- }
92
- }
93
- }
94
- ```
95
-
96
- ### Option 2: Direct configuration in MCP config
97
- ```json
98
- {
99
- "mcp": {
100
- "servers": {
101
- "perforce": {
102
- "command": "mcp-perforce-server",
103
- "args": [],
104
- "env": {
105
- "P4PORT": "perforce-server:1666",
106
- "P4USER": "your-username",
107
- "P4CLIENT": "your-workspace-name",
108
- "P4PASSWD": "your-password",
109
- "P4_READONLY_MODE": "false",
110
- "P4_DISABLE_DELETE": "true",
111
- "LOG_LEVEL": "error"
112
- },
113
- "alwaysAllow": true
114
- }
115
- }
116
- }
117
- }
118
- ```
119
-
120
- ## Claude Desktop
121
-
122
- ### macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
123
- ### Windows: %APPDATA%\Claude\claude_desktop_config.json
124
-
125
- ### Option 1: Using .p4config file (Recommended)
126
- ```json
127
- {
128
- "mcpServers": {
129
- "perforce": {
130
- "command": "mcp-perforce-server",
131
- "args": [],
132
- "env": {
133
- "P4_READONLY_MODE": "false",
134
- "P4_DISABLE_DELETE": "true",
135
- "LOG_LEVEL": "error"
136
- },
137
- "alwaysAllow": ["p4.*"]
138
- }
139
- }
140
- }
141
- ```
142
-
143
- ### Option 2: Direct configuration in MCP config
144
- ```json
145
- {
146
- "mcpServers": {
147
- "perforce": {
148
- "command": "mcp-perforce-server",
149
- "args": [],
150
- "env": {
151
- "P4PORT": "perforce-server:1666",
152
- "P4USER": "your-username",
153
- "P4CLIENT": "your-workspace-name",
154
- "P4_READONLY_MODE": "false",
155
- "P4_DISABLE_DELETE": "true",
156
- "LOG_LEVEL": "error"
157
- },
158
- "alwaysAllow": ["p4.*"]
159
- }
160
- }
161
- }
162
- ```
163
-
164
- ## Local Development Setup (if not globally installed)
165
-
166
- Replace the "command" field with the full path to your built server:
167
-
168
- ```json
169
- {
170
- "command": "node",
171
- "args": ["/full/path/to/your/mcp-perforce-server/dist/server.js"]
172
- }
173
- ```
174
-
175
- ## Safety Configuration Levels
176
-
177
- ### Maximum Safety (Default)
178
- ```json
179
- {
180
- "env": {
181
- "P4_READONLY_MODE": "true",
182
- "P4_DISABLE_DELETE": "true"
183
- }
184
- }
185
- ```
186
-
187
- ### Write-enabled, Delete Protected
188
- ```json
189
- {
190
- "env": {
191
- "P4_READONLY_MODE": "false",
192
- "P4_DISABLE_DELETE": "true"
193
- }
194
- }
195
- ```
196
-
197
- ## Configuration Notes
198
-
199
- ### Silent Operation
200
- - `"alwaysAllow": ["p4.*"]` - Auto-approves all p4 commands, preventing VS Code approval prompts
201
- - `"alwaysAllow": true` - Auto-approves all commands (Cursor)
202
- - `"LOG_LEVEL": "error"` - Reduces console output to errors only
203
- - `"disabled": false` - Ensures the server is active
204
-
205
- ### Security Levels
206
- - **Safe**: `P4_READONLY_MODE=true, P4_DISABLE_DELETE=true` (read-only)
207
- - **Recommended**: `P4_READONLY_MODE=false, P4_DISABLE_DELETE=true` (write, no delete)
208
- - **Full Access**: `P4_READONLY_MODE=false, P4_DISABLE_DELETE=false` (use with caution)
209
-
210
- ### Troubleshooting
211
- - If commands still show approval prompts, ensure `alwaysAllow` is configured
212
- - If you see terminal output, set `LOG_LEVEL` to `"error"`
213
- - Commands execute silently in the background without terminal windows
214
-
215
- ### Full Access (Use with Caution)
216
- ```json
217
- {
218
- "env": {
219
- "P4_READONLY_MODE": "false",
220
- "P4_DISABLE_DELETE": "false"
221
- }
222
- }
1
+ # MCP Perforce Server Configuration Examples
2
+
3
+ ## Silent Operation Configuration
4
+
5
+ To prevent VS Code from asking for approval on every command and to hide terminal execution:
6
+
7
+ **Key Settings:**
8
+ - `"alwaysAllow": ["p4.*"]` or `"alwaysAllow": true` - Auto-approve all p4 commands
9
+ - `"LOG_LEVEL": "error"` - Minimize console output (only show errors)
10
+ - `"disabled": false` - Ensure server is enabled
11
+
12
+ ## Authentication Configuration
13
+
14
+ **Important:** Configure your Perforce credentials using one of these methods:
15
+
16
+ 1. **`.p4config` file** (Recommended) - Create in project root:
17
+ ```
18
+ P4PORT=perforce-server:1666
19
+ P4USER=your-username
20
+ P4CLIENT=your-workspace-name
21
+ P4PASSWD=your-password
22
+ ```
23
+
24
+ 2. **Environment variables** in MCP config (see examples below)
25
+
26
+ The server automatically detects and uses these credentials. Passwords are masked in logs for security.
27
+
28
+ ## VS Code with Claude Dev/Cline
29
+
30
+ ### Option 1: Using .p4config file (Recommended)
31
+ Create a `.p4config` file in your project root, then:
32
+ ```json
33
+ {
34
+ "mcpServers": {
35
+ "perforce": {
36
+ "command": "mcp-perforce-server",
37
+ "args": [],
38
+ "env": {
39
+ "P4_READONLY_MODE": "false",
40
+ "P4_DISABLE_DELETE": "true",
41
+ "LOG_LEVEL": "error"
42
+ },
43
+ "alwaysAllow": ["p4.*"],
44
+ "disabled": false
45
+ }
46
+ }
47
+ }
48
+ ```
49
+
50
+ ### Option 2: Direct configuration in MCP config
51
+ ```json
52
+ {
53
+ "mcpServers": {
54
+ "perforce": {
55
+ "command": "mcp-perforce-server",
56
+ "args": [],
57
+ "env": {
58
+ "P4PORT": "perforce-server:1666",
59
+ "P4USER": "your-username",
60
+ "P4CLIENT": "your-workspace-name",
61
+ "P4PASSWD": "your-password",
62
+ "P4CHARSET": "utf8",
63
+ "P4_READONLY_MODE": "false",
64
+ "P4_DISABLE_DELETE": "true",
65
+ "LOG_LEVEL": "error"
66
+ },
67
+ "alwaysAllow": ["p4.*"],
68
+ "disabled": false
69
+ }
70
+ }
71
+ }
72
+ ```
73
+
74
+ ## Cursor IDE
75
+
76
+ ### Option 1: Using .p4config file (Recommended)
77
+ ```json
78
+ {
79
+ "mcp": {
80
+ "servers": {
81
+ "perforce": {
82
+ "command": "mcp-perforce-server",
83
+ "args": [],
84
+ "env": {
85
+ "P4_READONLY_MODE": "false",
86
+ "P4_DISABLE_DELETE": "true",
87
+ "LOG_LEVEL": "error"
88
+ },
89
+ "alwaysAllow": true
90
+ }
91
+ }
92
+ }
93
+ }
94
+ ```
95
+
96
+ ### Option 2: Direct configuration in MCP config
97
+ ```json
98
+ {
99
+ "mcp": {
100
+ "servers": {
101
+ "perforce": {
102
+ "command": "mcp-perforce-server",
103
+ "args": [],
104
+ "env": {
105
+ "P4PORT": "perforce-server:1666",
106
+ "P4USER": "your-username",
107
+ "P4CLIENT": "your-workspace-name",
108
+ "P4PASSWD": "your-password",
109
+ "P4_READONLY_MODE": "false",
110
+ "P4_DISABLE_DELETE": "true",
111
+ "LOG_LEVEL": "error"
112
+ },
113
+ "alwaysAllow": true
114
+ }
115
+ }
116
+ }
117
+ }
118
+ ```
119
+
120
+ ## Claude Desktop
121
+
122
+ ### macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
123
+ ### Windows: %APPDATA%\Claude\claude_desktop_config.json
124
+
125
+ ### Option 1: Using .p4config file (Recommended)
126
+ ```json
127
+ {
128
+ "mcpServers": {
129
+ "perforce": {
130
+ "command": "mcp-perforce-server",
131
+ "args": [],
132
+ "env": {
133
+ "P4_READONLY_MODE": "false",
134
+ "P4_DISABLE_DELETE": "true",
135
+ "LOG_LEVEL": "error"
136
+ },
137
+ "alwaysAllow": ["p4.*"]
138
+ }
139
+ }
140
+ }
141
+ ```
142
+
143
+ ### Option 2: Direct configuration in MCP config
144
+ ```json
145
+ {
146
+ "mcpServers": {
147
+ "perforce": {
148
+ "command": "mcp-perforce-server",
149
+ "args": [],
150
+ "env": {
151
+ "P4PORT": "perforce-server:1666",
152
+ "P4USER": "your-username",
153
+ "P4CLIENT": "your-workspace-name",
154
+ "P4_READONLY_MODE": "false",
155
+ "P4_DISABLE_DELETE": "true",
156
+ "LOG_LEVEL": "error"
157
+ },
158
+ "alwaysAllow": ["p4.*"]
159
+ }
160
+ }
161
+ }
162
+ ```
163
+
164
+ ## Local Development Setup (if not globally installed)
165
+
166
+ Replace the "command" field with the full path to your built server:
167
+
168
+ ```json
169
+ {
170
+ "command": "node",
171
+ "args": ["/full/path/to/your/mcp-perforce-server/dist/server.js"]
172
+ }
173
+ ```
174
+
175
+ ## Safety Configuration Levels
176
+
177
+ ### Maximum Safety (Default)
178
+ ```json
179
+ {
180
+ "env": {
181
+ "P4_READONLY_MODE": "true",
182
+ "P4_DISABLE_DELETE": "true"
183
+ }
184
+ }
185
+ ```
186
+
187
+ ### Write-enabled, Delete Protected
188
+ ```json
189
+ {
190
+ "env": {
191
+ "P4_READONLY_MODE": "false",
192
+ "P4_DISABLE_DELETE": "true"
193
+ }
194
+ }
195
+ ```
196
+
197
+ ## Configuration Notes
198
+
199
+ ### Silent Operation
200
+ - `"alwaysAllow": ["p4.*"]` - Auto-approves all p4 commands, preventing VS Code approval prompts
201
+ - `"alwaysAllow": true` - Auto-approves all commands (Cursor)
202
+ - `"LOG_LEVEL": "error"` - Reduces console output to errors only
203
+ - `"disabled": false` - Ensures the server is active
204
+
205
+ ### Security Levels
206
+ - **Safe**: `P4_READONLY_MODE=true, P4_DISABLE_DELETE=true` (read-only)
207
+ - **Recommended**: `P4_READONLY_MODE=false, P4_DISABLE_DELETE=true` (write, no delete)
208
+ - **Full Access**: `P4_READONLY_MODE=false, P4_DISABLE_DELETE=false` (use with caution)
209
+
210
+ ### Troubleshooting
211
+ - If commands still show approval prompts, ensure `alwaysAllow` is configured
212
+ - If you see terminal output, set `LOG_LEVEL` to `"error"`
213
+ - Commands execute silently in the background without terminal windows
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
223
  ```