Skip to content

Dev Script Requires Manual Restart on Code Changes #288

@gilbertsahumada

Description

@gilbertsahumada

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

  1. Navigate to the MCP server package:

    cd packages/mcp-server
  2. Start the development server:

    yarn dev
  3. Make any change to a TypeScript file (e.g., modify src/index.ts)

  4. 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 tsx package capabilities

Alternative Solutions

  1. Using nodemon (requires additional dependency):

    yarn add -D nodemon
    "dev": "nodemon --exec tsx src/index.ts"
  2. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions