Skip to content

Server lifecycle management: eliminate boilerplate bash scripts from SDK repos #114

@maxisbey

Description

@maxisbey

Problem

Every SDK repo that runs server conformance tests needs a bash script that does the same thing:

  1. Start the server process in the background
  2. Poll until healthy (curl loop with retries)
  3. Run npx @modelcontextprotocol/conformance server --url <url>
  4. Trap + kill the server on exit

Here are the current scripts:

These are nearly identical — the only SDK-specific part is the command to start the server. The health-check loop, process management, and cleanup are pure boilerplate that gets copy-pasted across repos.

This creates maintenance burden: if we want to change the health-check behavior (e.g., longer timeout, different readiness check), every SDK repo needs updating. It also means each SDK has to figure out the bash incantation independently.

Context

The client subcommand already manages process lifecycle — it takes a --command flag, spawns the client, and handles cleanup. The server subcommand currently only connects to an already-running server via --url.

With the GitHub Action (#99, PR #113), server workflows still require a separate "start server and wait" step before invoking the action. This is the last piece of per-repo boilerplate that could be eliminated.

Desired outcome

A single SDK-specific value (the command to start the server) should be all that's needed. The conformance tool should handle spawning, health-checking, and cleanup — the same way it already does for client testing.

Suggestion

Adding --command support to the server subcommand (symmetric with how client already works) seems like the natural fit. The action could then wire it through for server mode as well.

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