-
Notifications
You must be signed in to change notification settings - Fork 49
Description
Dev Script Requires Manual Restart on Code Changes
Description
The current dev script in the MCP server package (@sei-js/mcp-server) does not automatically restart when code changes are made. Developers need to manually stop and restart the server each time they modify TypeScript files, which significantly slows down the development workflow.
Steps to Reproduce
-
Navigate to the MCP server package:
cd packages/mcp-server -
Start the development server:
yarn dev
-
Make any change to a TypeScript file (e.g., modify
src/index.ts) -
Expected behavior: Server should automatically restart and reflect changes
Actual behavior: Server continues running with old code, requiring manual restart
Current Implementation
The current dev script in package.json:
{
"scripts": {
"dev": "tsx src/index.ts"
}
}Proposed Solution
Update the dev script to use tsx watch mode for automatic file watching and restart:
{
"scripts": {
"dev": "tsx watch src/index.ts"
}
}Benefits
- Improved DX: Automatic restart on file changes
- Faster development: No manual intervention needed
- Consistent behavior: Matches common development server expectations
- No additional dependencies: Uses existing
tsxpackage capabilities
Alternative Solutions
-
Using nodemon (requires additional dependency):
yarn add -D nodemon
"dev": "nodemon --exec tsx src/index.ts"
-
Using tsc-watch (requires additional dependency):
yarn add -D tsc-watch
"dev": "tsc-watch --onSuccess \"node dist/esm/index.js\""
The tsx watch solution is preferred as it doesn't require additional dependencies and provides the cleanest implementation.
Environment
- Package:
@sei-js/mcp-server - Node.js: >= 18.0.0
- Package Manager: Yarn 4.7.0
- TypeScript: ^5.8.3
- tsx: ^4.20.3