Skip to content

Add --watch flag to test command for continuous monitoring #254

Description

@KryptosAI

Summary

Add a --watch mode to the test command that re-runs scans when the target server's tool list or configuration changes.

Files to modify

  • src/commands/test.ts

What to change

  1. Add a --watch boolean flag to the test command definition.
  2. When --watch is set, after the initial scan completes, use chokidar or fs.watch to monitor the target's config file or stdin input for changes.
  3. On change, re-run the scan and display updated results.
  4. Pressing Ctrl+C should exit cleanly.
  5. Display "Watching for changes..." after the initial scan.

Expected behavior

mcp-observatory test --watch npx -y @modelcontextprotocol/server-memory

Keeps the scan alive and re-runs whenever the server config changes.

Estimated time

~20 minutes

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:cliCLI UX, command surface, and error messaginggood first issueGood for newcomers

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions