Skip to content

Commit 0dc6342

Browse files
feat: adding symlink instructions to README.md
1 parent 270eeba commit 0dc6342

1 file changed

Lines changed: 80 additions & 12 deletions

File tree

README.md

Lines changed: 80 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,58 +7,126 @@ This repo is the public repo for installing the "Snyk Secure at Inception" Power
77
## How to Use
88

99
### Prerequisites
10-
1110
- **Kiro IDE** (Free tier available at [kiro.ai](https://kiro.ai)). Snyk currently doesn't have any of the paid tiers for Kiro, so use the free tier for now. It comes with 50 tokens.
1211
- **Node.js** installed on your machine with npm/npx
1312

1413
### Installation
1514

16-
1. **Install the Power in Kiro:**
15+
1. **Set up Node.js System Links (Required for MCP Server):**
16+
17+
The Snyk Power uses an MCP (Model Context Protocol) server that requires `node` and `npx` to be available in the system PATH. If you're using a Node.js version manager like nvm, fnm, or volta, you'll need to create system-wide symlinks.
18+
19+
**For nvm users:**
20+
```bash
21+
# Find your current Node.js path
22+
which node
23+
which npx
24+
25+
# Create symlinks (replace the path with your actual Node.js path)
26+
sudo ln -sf $(which node) /usr/local/bin/node
27+
sudo ln -sf $(which npx) /usr/local/bin/npx
28+
```
29+
30+
**For Homebrew users:**
31+
```bash
32+
# If you don't have Node.js via Homebrew, install it:
33+
brew install node
34+
# Homebrew automatically creates the necessary symlinks
35+
```
36+
37+
**Verify the setup:**
38+
```bash
39+
/usr/local/bin/node --version
40+
/usr/local/bin/npx --version
41+
```
42+
43+
2. **Install the Power in Kiro:**
1744
- Open Kiro IDE
1845
- Access the Powers panel (Ctrl/Cmd + Shift + P → "Configure Powers", or clicking on the ghost with a lightning bolt next to it in the left menu)
1946
- Click on "Add Custom Power"
2047
- Select the "Import power from Github" option
2148
- Use the link to the snyk-power folder inside this repo as the power: https://github.com/snyk/kiro-power-snyk/tree/598bab69c81607c17445fbeefa9c75c405e91ec3/snyk-power
49+
2250
**IMPORTANT:** make sure to specifically use that link above which includes the snyk-power folder; if you try to use the overall repo link the installation will fail due to having extra folders/files in the repo.
2351
- The power will be installed and ready to use
2452

25-
2. **Authenticate with Snyk:**
53+
3. **Authenticate with Snyk:**
2654
In your terminal in Kiro run
2755
```
2856
npx snyk auth
2957
```
3058
This opens your browser for one-time Snyk authentication.
3159

3260
## Using once Installed
61+
3362
Once the Snyk Power is installed in the Kiro IDE, you'll be able to use all of the Snyk MCP commands inside Kiro. In your chat with the Kiro agent, you can reference any of the snyk-fix commands, as defined in the snyk-fix.md file in this repo (kiro-power-snyk/snyk-power/steering/snyk-fix.md).
3463

3564
## Configuration
3665

37-
The power automatically configures the Snyk MCP server. If you encounter connection issues, ensure:
66+
The power automatically configures the Snyk MCP server to use the system-wide Node.js installation at `/usr/local/bin/npx`. This approach ensures compatibility across different Node.js installation methods.
67+
68+
### Troubleshooting
69+
70+
#### MCP Connection Issues
3871

39-
1. **npx is available** in your PATH
40-
2. **Node.js environment** is properly set up
41-
3. **Snyk authentication** is completed
72+
If you see `spawn npx ENOENT` errors, it means the MCP server can't find `npx`. This usually happens when:
4273

43-
### Troubleshooting MCP Connection
74+
1. **Node.js symlinks are missing** - Follow step 1 in the installation guide above
75+
2. **Node.js is not installed** - Install Node.js via Homebrew (`brew install node`) or download from [nodejs.org](https://nodejs.org)
4476

45-
If you see `spawn npx ENOENT` errors:
77+
#### Verifying Your Setup
4678

79+
Run these commands to verify everything is working:
80+
81+
```bash
82+
# Check if symlinks exist and work
83+
ls -la /usr/local/bin/node /usr/local/bin/npx
84+
/usr/local/bin/node --version
85+
/usr/local/bin/npx --version
86+
87+
# Test Snyk CLI
88+
npx snyk --version
89+
npx snyk auth --check
90+
```
91+
92+
#### Alternative Configuration (Advanced Users)
93+
94+
If you prefer not to create system symlinks, you can manually configure the MCP server path in `~/.kiro/settings/mcp.json`:
95+
96+
**Steps:**
4797
1. Find your npx path: `which npx`
48-
2. Update your MCP configuration in `~/.kiro/settings/mcp.json`:
98+
2. Open `~/.kiro/settings/mcp.json` in a text editor
99+
3. Navigate to `powers``mcpServers``power-snyk-secure-at-inception-Snyk`
100+
4. Update the `command` field with your full npx path
101+
5. Update the `PATH` in the `env` field to include your Node.js bin directory
102+
6. Save the file and restart Kiro IDE
49103

104+
**Example for nvm users:**
50105
```json
51106
{
52107
"powers": {
53108
"mcpServers": {
54109
"power-snyk-secure-at-inception-Snyk": {
55-
"command": "/full/path/to/npx",
110+
"command": "/Users/yourusername/.nvm/versions/node/v20.19.6/bin/npx",
56111
"args": ["-y", "snyk@latest", "mcp", "-t", "stdio"],
57112
"env": {
58-
"PATH": "/your/node/bin:/usr/local/bin:/usr/bin:/bin"
113+
"PATH": "/Users/yourusername/.nvm/versions/node/v20.19.6/bin:/usr/local/bin:/usr/bin:/bin"
59114
}
60115
}
61116
}
62117
}
63118
}
64119
```
120+
121+
#### Common Issues
122+
123+
| Error | Solution |
124+
|-------|----------|
125+
| `spawn npx ENOENT` | Create Node.js symlinks (step 1) or install Node.js |
126+
| `Unauthorized` | Run `npx snyk auth` to authenticate |
127+
| `Command not found: npx` | Install Node.js or check your Node.js installation |
128+
| MCP server won't connect | Restart Kiro IDE after creating symlinks |
129+
130+
#### Why Symlinks?
131+
132+
Node.js version managers (nvm, fnm, volta) install Node.js in user-specific directories that aren't in the system PATH by default. The MCP server process needs access to `npx` from a standard system location (`/usr/local/bin/`) to work reliably across different environments.

0 commit comments

Comments
 (0)