Skip to content

Commit 835010c

Browse files
committed
Fix stan errors
1 parent 39e5289 commit 835010c

File tree

1 file changed

+31
-19
lines changed

1 file changed

+31
-19
lines changed

src/Commands/LoopMcpConfigCommand.php

Lines changed: 31 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -154,18 +154,21 @@ private function generateCursorDeeplink(string $projectPath, ?string $userId, ?s
154154
];
155155

156156
$configJson = json_encode($config, JSON_UNESCAPED_SLASHES);
157-
$configBase64 = base64_encode($configJson);
158-
$deeplink = "cursor://anysphere.cursor-deeplink/mcp/install?name=laravel-loop-mcp&config={$configBase64}";
157+
if ($configJson) {
158+
$configBase64 = base64_encode($configJson);
159+
$deeplink = "cursor://anysphere.cursor-deeplink/mcp/install?name=laravel-loop-mcp&config={$configBase64}";
160+
$this->info('🎯🎯🎯 Cursor Deeplink: 🎯🎯🎯');
159161

160-
$this->info('🎯🎯🎯 Cursor Deeplink: 🎯🎯🎯');
161-
$this->newLine();
162+
$this->newLine();
162163

163-
$this->table([], [[$deeplink]]);
164+
$this->table([], [[$deeplink]]);
165+
166+
$this->newLine();
167+
$this->comment('💡 Click on the link above or copy and paste it into your browser to install the MCP server in Cursor.');
168+
}
164169

165170
$this->newLine();
166-
$this->comment('💡 Click on the link above or copy and paste it into your browser to install the MCP server in Cursor.');
167-
$this->newLine();
168-
$this->comment('📋 Alternatively, you can copy the following JSON configuration manually:');
171+
$this->comment('📋 You can copy the following JSON configuration:');
169172
$this->newLine();
170173

171174
$this->table([], [[
@@ -199,7 +202,9 @@ private function generateJsonConfig(string $projectPath, ?string $userId, ?strin
199202
$this->comment('🎯🎯🎯 Please copy the following JSON configuration to your MCP client configuration file. 🎯🎯🎯');
200203
$this->newLine();
201204

202-
$this->line(json_encode($config, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES));
205+
$this->table([], [[
206+
json_encode($config, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES),
207+
]]);
203208

204209
$this->newLine();
205210
$this->newLine();
@@ -248,18 +253,21 @@ private function generateCursorHttpDeeplink(string $baseUrl, string $ssePath): v
248253
}
249254

250255
$configJson = json_encode($config, JSON_UNESCAPED_SLASHES);
251-
$configBase64 = base64_encode($configJson);
252-
$deeplink = "cursor://anysphere.cursor-deeplink/mcp/install?name=laravel-loop-mcp&config={$configBase64}";
256+
if ($configJson) {
257+
$configBase64 = base64_encode($configJson);
258+
$deeplink = "cursor://anysphere.cursor-deeplink/mcp/install?name=laravel-loop-mcp&config={$configBase64}";
253259

254-
$this->comment('🎯🎯🎯 Cursor HTTP + SSE Deeplink Configuration: 🎯🎯🎯');
255-
$this->newLine();
260+
$this->comment('🎯🎯🎯 Cursor HTTP + SSE Deeplink Configuration: 🎯🎯🎯');
261+
$this->newLine();
256262

257-
$this->table([], [[$deeplink]]);
263+
$this->table([], [[$deeplink]]);
264+
265+
$this->newLine();
266+
$this->comment('💡 Click on the link above or copy and paste it into your browser to install the MCP server in Cursor.');
267+
}
258268

259269
$this->newLine();
260-
$this->comment('💡 Click on the link above or copy and paste it into your browser to install the MCP server in Cursor.');
261-
$this->newLine();
262-
$this->comment('📋 Alternatively, you can copy the following JSON configuration manually:');
270+
$this->comment('📋 You can copy the following JSON configuration:');
263271
$this->newLine();
264272

265273
$this->table([], [[
@@ -353,7 +361,9 @@ private function generateJsonHttpConfigWithProxy(string $baseUrl, array $headers
353361
$this->comment('🎯🎯🎯 Please copy the following JSON configuration to your MCP client configuration file. 🎯🎯🎯');
354362
$this->newLine();
355363

356-
$this->line(json_encode($config, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES));
364+
$this->table([], [[
365+
json_encode($config, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES),
366+
]]);
357367

358368
$this->newLine();
359369
$this->additionalHttpSetupMessages();
@@ -378,7 +388,9 @@ private function generateJsonHttpConfigFirstPartySupport(string $baseUrl, string
378388
$this->comment('🎯🎯🎯 Please copy the following JSON configuration to your MCP client configuration file. 🎯🎯🎯');
379389
$this->newLine();
380390

381-
$this->line(json_encode($config, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES));
391+
$this->table([], [[
392+
json_encode($config, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES),
393+
]]);
382394

383395
$this->newLine();
384396
$this->newLine();

0 commit comments

Comments
 (0)