MCP_SERVER_RESTART.md•3.31 kB
# MCP Server Configuration & Restart Guide
This guide covers the proper way to configure your MCP server globally so it's available across all projects, and how to restart it when making code changes.
## Initial Setup (One-Time)
### Option 1: Using Claude MCP CLI (Recommended)
Add your server globally using the user scope:
```bash
claude mcp add unrestricted-dev --scope user --transport stdio node /home/connor-boetig/proj/mcp2/build/index.js
```
This makes the server available across all projects on your machine.
### Option 2: Manual Configuration
Edit `~/.claude.json` directly for more control:
```json
{
"mcpServers": {
"unrestricted-dev": {
"type": "stdio",
"command": "node",
"args": [
"/home/connor-boetig/proj/mcp2/build/index.js"
]
}
}
}
```
**Important**: Use absolute paths in the configuration.
## Verify Configuration
Check that your server is properly configured:
```bash
# List all configured MCP servers
claude mcp list
# View specific server details
claude mcp get unrestricted-dev
```
## Restarting After Code Changes
When you make changes to your MCP server code, follow these steps:
### Step 1: Rebuild the Project
```bash
cd /home/connor-boetig/proj/mcp2
npm run build
```
### Step 2: Restart Claude Code
The MCP server is automatically launched by Claude Code based on your configuration. Simply restart Claude Code to pick up the new changes:
- Quit Claude Code completely
- Relaunch Claude Code
The server will automatically start with the new code.
### Step 3: Verify Connection
Inside Claude Code, check server status:
```
/mcp
```
You should see:
```
⎿ • unrestricted-dev: connected
```
## Development Workflow Tips
### Quick Rebuild Script
Create a build script for faster iterations:
```bash
#!/bin/bash
cd /home/connor-boetig/proj/mcp2
npm run build
echo "Build complete. Restart Claude Code to load changes."
```
### Using the MCP Inspector for Testing
For testing without Claude Code restarts, use the MCP Inspector:
```bash
npx @modelcontextprotocol/inspector node build/index.js
```
This opens a web interface for testing your MCP server tools interactively.
## Troubleshooting
### Server Not Showing in /mcp List
- Check that the config file syntax is correct in `~/.claude.json`
- Verify the path to `build/index.js` is absolute and correct
- Ensure the project has been built (`npm run build`)
### Server Shows as Disconnected
- Check that Node.js is installed and accessible
- Verify there are no syntax errors in your server code
- Check Claude Code logs for error messages
### Changes Not Appearing
- Ensure you ran `npm run build` after code changes
- Verify you completely quit and restarted Claude Code (not just closed the window)
- Check that you're editing the correct server instance if you have multiple configured
### Removing a Server
```bash
claude mcp remove unrestricted-dev
```
Then reconfigure using the setup steps above.
## Configuration Scopes Explained
- **user scope** (recommended): Available across all projects, private to your user account
- **local scope**: Project-specific, not shared with team
- **project scope**: Shared with team via `.mcp.json` in the project directory
For development servers, use **user scope** for maximum flexibility.