You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -221,7 +226,7 @@ Perform the following steps to install the pre-commit hook:
221
226
```yaml
222
227
repos:
223
228
- repo: https://github.com/cycodehq/cycode-cli
224
-
rev: v3.0.0
229
+
rev: v3.1.0
225
230
hooks:
226
231
- id: cycode
227
232
stages:
@@ -233,7 +238,7 @@ Perform the following steps to install the pre-commit hook:
233
238
```yaml
234
239
repos:
235
240
- repo: https://github.com/cycodehq/cycode-cli
236
-
rev: v3.0.0
241
+
rev: v3.1.0
237
242
hooks:
238
243
- id: cycode
239
244
stages:
@@ -281,10 +286,204 @@ The following are the options and commands available with the Cycode CLI applica
281
286
| [auth](#using-the-auth-command) | Authenticate your machine to associate the CLI with your Cycode account. |
282
287
| [configure](#using-the-configure-command) | Initial command to configure your CLI client authentication. |
283
288
| [ignore](#ignoring-scan-results) | Ignores a specific value, path or rule ID. |
289
+
| [mcp](#mcp-command) | Start the Model Context Protocol (MCP) server to enable AI integration with Cycode scanning capabilities. |
284
290
| [scan](#running-a-scan) | Scan the content for Secrets/IaC/SCA/SAST violations. You`ll need to specify which scan type to perform: commit-history/path/repository/etc. |
285
291
| [report](#report-command) | Generate report. You`ll need to specify which report type to perform as SBOM. |
286
292
| status | Show the CLI status and exit. |
287
293
294
+
# MCP Command
295
+
296
+
The Model Context Protocol (MCP) command allows you to start an MCP server that exposes Cycode's scanning capabilities to AI systems and applications. This enables AI models to interact with Cycode CLI tools through a standardized protocol.
297
+
298
+
> [!TIP]
299
+
> For the best experience, install Cycode CLI globally on your system using `pip install cycode` or `brew install cycode`, then authenticate once with `cycode auth`. After global installation and authentication, you won't need to configure `CYCODE_CLIENT_ID` and `CYCODE_CLIENT_SECRET` environment variables in your MCP configuration files.
300
+
301
+
## Starting the MCP Server
302
+
303
+
To start the MCP server, use the following command:
304
+
305
+
```bash
306
+
cycode mcp
307
+
```
308
+
309
+
By default, this starts the server using the `stdio` transport, which is suitable forlocal integrations and AI applications that can spawn subprocess.
|`cycode_secret_scan`| Scan files for hardcoded secrets |
327
+
|`cycode_sca_scan`| Scan files for Software Composition Analysis (SCA) - vulnerabilities and license issues |
328
+
|`cycode_iac_scan`| Scan files for Infrastructure as Code (IaC) misconfigurations |
329
+
|`cycode_sast_scan`| Scan files for Static Application Security Testing (SAST) - code quality and security flaws |
330
+
|`cycode_status`| Get Cycode CLI version, authentication status, and configuration information |
331
+
332
+
### Usage Examples
333
+
334
+
#### Basic Command Examples
335
+
336
+
Start the MCP server with default settings (stdio transport):
337
+
```bash
338
+
cycode mcp
339
+
```
340
+
341
+
Start the MCP server with explicit stdio transport:
342
+
```bash
343
+
cycode mcp -t stdio
344
+
```
345
+
346
+
Start the MCP server with Server-Sent Events (SSE) transport:
347
+
```bash
348
+
cycode mcp -t sse -p 8080
349
+
```
350
+
351
+
Start the MCP server with streamable HTTP transport on custom host and port:
352
+
```bash
353
+
cycode mcp -t streamable-http -H 0.0.0.0 -p 9000
354
+
```
355
+
356
+
Learn more about MCP Transport types in the [MCP Protocol Specification – Transports](https://modelcontextprotocol.io/specification/2025-03-26/basic/transports).
357
+
358
+
#### Configuration Examples
359
+
360
+
##### Using MCP with Cursor/Claude Desktop/etc (mcp.json)
361
+
362
+
> [!NOTE]
363
+
> For EU Cycode environments, make sure to set the appropriate `CYCODE_API_URL` and `CYCODE_APP_URL` values in the environment variables (e.g., `https://api.eu.cycode.com` and `https://app.eu.cycode.com`).
364
+
365
+
For **stdio transport** (direct execution):
366
+
```json
367
+
{
368
+
"mcpServers": {
369
+
"cycode": {
370
+
"command": "cycode",
371
+
"args": ["mcp"],
372
+
"env": {
373
+
"CYCODE_CLIENT_ID": "your-cycode-id",
374
+
"CYCODE_CLIENT_SECRET": "your-cycode-secret-key",
375
+
"CYCODE_API_URL": "https://api.cycode.com",
376
+
"CYCODE_APP_URL": "https://app.cycode.com"
377
+
}
378
+
}
379
+
}
380
+
}
381
+
```
382
+
383
+
For **stdio transport** with `pipx` installation:
384
+
```json
385
+
{
386
+
"mcpServers": {
387
+
"cycode": {
388
+
"command": "pipx",
389
+
"args": ["run", "cycode", "mcp"],
390
+
"env": {
391
+
"CYCODE_CLIENT_ID": "your-cycode-id",
392
+
"CYCODE_CLIENT_SECRET": "your-cycode-secret-key",
393
+
"CYCODE_API_URL": "https://api.cycode.com",
394
+
"CYCODE_APP_URL": "https://app.cycode.com"
395
+
}
396
+
}
397
+
}
398
+
}
399
+
```
400
+
401
+
For **stdio transport** with `uvx` installation:
402
+
```json
403
+
{
404
+
"mcpServers": {
405
+
"cycode": {
406
+
"command": "uvx",
407
+
"args": ["cycode", "mcp"],
408
+
"env": {
409
+
"CYCODE_CLIENT_ID": "your-cycode-id",
410
+
"CYCODE_CLIENT_SECRET": "your-cycode-secret-key",
411
+
"CYCODE_API_URL": "https://api.cycode.com",
412
+
"CYCODE_APP_URL": "https://app.cycode.com"
413
+
}
414
+
}
415
+
}
416
+
}
417
+
```
418
+
419
+
For **SSE transport** (Server-Sent Events):
420
+
```json
421
+
{
422
+
"mcpServers": {
423
+
"cycode": {
424
+
"url": "http://127.0.0.1:8000/sse"
425
+
}
426
+
}
427
+
}
428
+
```
429
+
430
+
For **SSE transport** on custom port:
431
+
```json
432
+
{
433
+
"mcpServers": {
434
+
"cycode": {
435
+
"url": "http://127.0.0.1:8080/sse"
436
+
}
437
+
}
438
+
}
439
+
```
440
+
441
+
For **streamable HTTP transport**:
442
+
```json
443
+
{
444
+
"mcpServers": {
445
+
"cycode": {
446
+
"url": "http://127.0.0.1:8000/mcp"
447
+
}
448
+
}
449
+
}
450
+
```
451
+
452
+
##### Running MCP Server in Background
453
+
454
+
For **SSE transport** (start server first, then configure client):
> The MCP server requires proper Cycode CLI authentication to function. Make sure you have authenticated using `cycode auth` or configured your credentials before starting the MCP server.
0 commit comments