|
| 1 | +--- |
| 2 | +title: "Troubleshooting" |
| 3 | +description: "Resolve common issues and get help with Sei MCP Server setup and configuration" |
| 4 | +icon: "bug" |
| 5 | +--- |
| 6 | + |
| 7 | +## Quick Diagnosis |
| 8 | + |
| 9 | +Most issues are caused by an incorrect Node.js version being used. Start here: |
| 10 | + |
| 11 | +<Steps> |
| 12 | + <Step title="Check Node.js Version"> |
| 13 | + Verify your Node.js version is 18 or higher: |
| 14 | + |
| 15 | + ```bash |
| 16 | + node --version |
| 17 | + ``` |
| 18 | + |
| 19 | + If you see a version below 18, you'll need to upgrade. |
| 20 | + </Step> |
| 21 | + |
| 22 | + <Step title="Check Your PATH"> |
| 23 | + If your Node.js version looks correct but you're still getting errors, check your PATH: |
| 24 | + |
| 25 | + ```bash |
| 26 | + echo $PATH |
| 27 | + ``` |
| 28 | + |
| 29 | + Look for Node.js paths in the output. If you see multiple Node.js versions, the first one in the PATH will be used. You can set the PATH [environment variable](/mcp-server/setup#environment-variables) in your mcp config to override what node version is being used. |
| 30 | + </Step> |
| 31 | + |
| 32 | + <Step title="Verify Environment Variables"> |
| 33 | + Check that your environment variables are set correctly. See the [environment variables](/mcp-server/setup#environment-variables) section for reference. |
| 34 | + </Step> |
| 35 | +</Steps> |
| 36 | + |
| 37 | +## Common Issues |
| 38 | + |
| 39 | +### 'fetch' is not defined errors |
| 40 | + |
| 41 | +This is the most common error and typically indicates a Node.js version issue. If the quick diagnosis above didn't solve your problem, try forcing a specific Node.js version: |
| 42 | + |
| 43 | +<Steps> |
| 44 | + <Step title="Force Node.js Version"> |
| 45 | + You can force the MCP server to use a specific Node.js version by setting the PATH environment variable: |
| 46 | + |
| 47 | + ```json |
| 48 | + { |
| 49 | + "mcpServers": { |
| 50 | + "sei": { |
| 51 | + "command": "npx", |
| 52 | + "args": ["-y", "@sei-js/mcp-server"], |
| 53 | + "env": { |
| 54 | + "PATH": "/path/to/your/node/bin" |
| 55 | + } |
| 56 | + } |
| 57 | + } |
| 58 | + } |
| 59 | + ``` |
| 60 | + |
| 61 | + Replace `/path/to/your/node/bin` with the actual path to your preferred Node.js version. |
| 62 | + |
| 63 | + <Note> |
| 64 | + **Quick Path Finder**: Run `dirname $(which npx)` to get the correct path to use. |
| 65 | + </Note> |
| 66 | + </Step> |
| 67 | +</Steps> |
| 68 | + |
| 69 | +### NVM Version Conflicts |
| 70 | + |
| 71 | +If you're using NVM (Node Version Manager), you might have multiple Node.js versions installed. |
| 72 | + |
| 73 | +<Steps> |
| 74 | + <Step title="Check NVM Versions"> |
| 75 | + Check your installed versions: |
| 76 | + |
| 77 | + ```bash |
| 78 | + nvm list |
| 79 | + ``` |
| 80 | + |
| 81 | + Look for versions below 18 that might be taking precedence. |
| 82 | + </Step> |
| 83 | + |
| 84 | + <Step title="Option 1: Remove Problematic Versions"> |
| 85 | + Uninstall Node.js versions below 18: |
| 86 | + |
| 87 | + ```bash |
| 88 | + nvm uninstall 16.15.0 |
| 89 | + nvm uninstall 14.21.3 |
| 90 | + # ... uninstall other versions below 18 |
| 91 | + ``` |
| 92 | + |
| 93 | + This will prevent conflicts with older versions. |
| 94 | + </Step> |
| 95 | + |
| 96 | + <Step title="Option 2: Force Specific Version"> |
| 97 | + Alternatively, you can force the MCP server to use a specific Node.js version by setting the PATH environment variable: |
| 98 | + |
| 99 | + ```json |
| 100 | + { |
| 101 | + "mcpServers": { |
| 102 | + "sei": { |
| 103 | + "command": "npx", |
| 104 | + "args": ["-y", "@sei-js/mcp-server"], |
| 105 | + "env": { |
| 106 | + "PATH": "/Users/yourname/.nvm/versions/node/v18.18.0/bin:/usr/local/bin:/usr/bin:/bin" |
| 107 | + } |
| 108 | + } |
| 109 | + } |
| 110 | + } |
| 111 | + ``` |
| 112 | + </Step> |
| 113 | +</Steps> |
| 114 | + |
| 115 | +### Environment Variable Issues |
| 116 | + |
| 117 | +Many issues stem from incorrect environment variable configuration. |
| 118 | + |
| 119 | +<Steps> |
| 120 | + <Step title="Check Your Configuration"> |
| 121 | + Verify your environment variables are set correctly. Common issues include: |
| 122 | + |
| 123 | + - **WALLET_MODE**: Should be `"disabled"` or `"private-key"` |
| 124 | + - **PRIVATE_KEY**: Must be 0x-prefixed hex string when using private-key mode |
| 125 | + - **RPC URLs**: Should be valid URLs if you're overriding defaults |
| 126 | + </Step> |
| 127 | + |
| 128 | + <Step title="Test Configuration"> |
| 129 | + Try running with minimal configuration first: |
| 130 | + |
| 131 | + ```json |
| 132 | + { |
| 133 | + "mcpServers": { |
| 134 | + "sei": { |
| 135 | + "command": "npx", |
| 136 | + "args": ["-y", "@sei-js/mcp-server"] |
| 137 | + } |
| 138 | + } |
| 139 | + } |
| 140 | + ``` |
| 141 | + |
| 142 | + If this works, gradually add your environment variables back. |
| 143 | + </Step> |
| 144 | + |
| 145 | + <Step title="Reference Documentation"> |
| 146 | + See the [Environment Variables](/mcp-server/setup#environment-variables) section for complete documentation of all available options. |
| 147 | + </Step> |
| 148 | +</Steps> |
| 149 | + |
| 150 | + |
| 151 | + |
| 152 | +## Error Reference |
| 153 | + |
| 154 | +<CardGroup cols={1}> |
| 155 | + <Card title="'fetch' is not defined" icon="bug"> |
| 156 | + **Cause**: Node.js version below 18 or PATH pointing to wrong Node.js version |
| 157 | + **Solution**: Upgrade Node.js or fix PATH as shown above |
| 158 | + </Card> |
| 159 | + <Card title="'Cannot find module'" icon="package"> |
| 160 | + **Cause**: Package not installed or network issues |
| 161 | + **Solution**: Check internet connection and try reinstalling the package |
| 162 | + </Card> |
| 163 | + <Card title="'Permission denied'" icon="lock"> |
| 164 | + **Cause**: Insufficient permissions to execute npx |
| 165 | + **Solution**: Ensure npx is executable or use full path to Node.js binary |
| 166 | + </Card> |
| 167 | + <Card title="'RPC connection failed'" icon="wifi"> |
| 168 | + **Cause**: Invalid RPC URL or network connectivity issues |
| 169 | + **Solution**: Check your RPC URLs and internet connection |
| 170 | + </Card> |
| 171 | +</CardGroup> |
| 172 | + |
| 173 | +## Getting Help |
| 174 | + |
| 175 | +### Before Reporting an Issue |
| 176 | + |
| 177 | +1. **Check this troubleshooting guide** - Your issue might already be covered |
| 178 | +2. **Verify your environment** - Ensure Node.js 18+ and correct PATH |
| 179 | +3. **Test with minimal config** - Try the basic setup first |
| 180 | +4. **Check environment variables** - Verify all settings are correct |
| 181 | + |
| 182 | +### Reporting Issues |
| 183 | + |
| 184 | +If you're still experiencing problems, please [create an issue on GitHub](https://github.com/sei-protocol/sei-js/issues) with the following information: |
| 185 | + |
| 186 | +<Steps> |
| 187 | + <Step title="Environment Details"> |
| 188 | + Include: |
| 189 | + - Operating system and version |
| 190 | + - Node.js version (`node --version`) |
| 191 | + - MCP client (Cursor, Claude Desktop, etc.) |
| 192 | + - Your PATH (`echo $PATH`) |
| 193 | + </Step> |
| 194 | + |
| 195 | + <Step title="Configuration"> |
| 196 | + Share your MCP configuration (remove private keys): |
| 197 | + |
| 198 | + ```json |
| 199 | + { |
| 200 | + "mcpServers": { |
| 201 | + "sei": { |
| 202 | + "command": "npx", |
| 203 | + "args": ["-y", "@sei-js/mcp-server"], |
| 204 | + "env": { |
| 205 | + "WALLET_MODE": "disabled" |
| 206 | + // ... other env vars (no private keys) |
| 207 | + } |
| 208 | + } |
| 209 | + } |
| 210 | + } |
| 211 | + ``` |
| 212 | + </Step> |
| 213 | + |
| 214 | + <Step title="Error Messages"> |
| 215 | + Include the complete error message and any relevant logs. |
| 216 | + </Step> |
| 217 | + |
| 218 | + <Step title="Steps to Reproduce"> |
| 219 | + Describe exactly what you did to encounter the issue. |
| 220 | + </Step> |
| 221 | +</Steps> |
| 222 | + |
| 223 | +<Note> |
| 224 | +**Security**: Never include private keys or sensitive information when reporting issues. Use placeholder values instead. |
| 225 | +</Note> |
| 226 | + |
| 227 | +### Community Support |
| 228 | + |
| 229 | +- **GitHub Issues**: [Create an issue](https://github.com/sei-protocol/sei-js/issues) |
| 230 | +- **Discord**: Join the [Sei Discord](https://discord.gg/sei) for community help |
| 231 | +- **Documentation**: Check the [main Sei docs](https://docs.sei.io/) for additional resources |
0 commit comments