Skip to content

Fast Startup: Async Server Loading

Async loading makes the HTTP listener available before configured static MCP servers finish connecting. It does not make every MCP client safe to use an incomplete capability catalog.

Default and Compatibility

Synchronous startup is the default. It waits to publish a complete initial catalog and is the safe choice unless client behavior is known.

Client behaviorRecommended startupReason
Reads the catalog once and never refreshesSynchronous (default)It requires the complete initial catalog.
Handles capability-list change notifications and retries discoveryAsync is suitableIt can reconcile after a new snapshot is published.
Is gated from using the catalog until loading completesAsync is suitableThe deployment gate protects its first catalog read.
Unknown or mixed compatibilitySynchronous (default)Notification support is unverified.

Enable async loading only when early HTTP availability is worth this contract:

bash
npx -y @1mcp/agent --config mcp.json --enable-async-loading

Catalog Publication

In async mode, the early catalog can be empty. 1MCP connects static backends in the background, builds the next capability snapshot, then publishes that snapshot atomically. It does not progressively expose one newly connected server at a time.

Compatible clients must process capability-list change notifications and retry discovery. A client that ignores those notifications can retain the empty or prior catalog until it reconnects.

Client-Facing Status

Use the authenticated /api/v1/inspect endpoint or its CLI equivalent for client-facing status. It lists configured static servers before the first atomic capability snapshot. Known unavailable static servers return a normal inspect result with no tools; unknown names remain not found.

Async loading options

CLI optionDefaultPurpose
--async-batch-notificationsEnabledCoalesces capability-change events into fewer listChanged notifications. Use --no-async-batch-notifications to send each published change immediately.
--async-batch-delay <milliseconds>1000Coalescing window used when notification batching is enabled.
--async-notify-on-snapshotEnabledSends notifications when a completed loading cycle publishes a changed capability snapshot. Global --enable-client-notifications must also remain enabled.
--async-notify-on-readyDeprecated compatibility alias for --async-notify-on-snapshot. If both are supplied, --async-notify-on-snapshot wins.
--async-min-servers, --async-timeoutDeprecated compatibility no-ops. Their ONE_MCP_* environment variables and asyncLoading.minServers / asyncLoading.timeout TOML keys warn when explicitly supplied and will be removed next major.

A longer batch delay reduces notification bursts at the cost of delaying notifications after a changed snapshot is published. It does not delay listener availability or create a readiness gate.

bash
npx -y @1mcp/agent --config mcp.json --enable-async-loading \
  --async-notify-on-snapshot \
  --async-batch-delay 250

Configuration

You can customize the async loading behavior, such as timeouts and retry logic, in the loading section of your JSON configuration file.

For a complete list of options, see the Configuration Deep Dive.

bash
1mcp inspect
1mcp inspect filesystem
1mcp wait
1mcp wait filesystem --timeout 60000

wait only tracks enabled configured static servers. It excludes templates and disabled servers, never cancels background loading, and stops immediately for failed, cancelled, or awaiting_oauth states. run checks this client-facing status before falling back to MCP, so it returns a recovery command while a backend is loading instead of attempting an unsafe early invocation.

StateMeaningAction
pending / loadingStartup is still in progress1mcp wait <server>
failed / cancelledNo usable backend is availableCheck configuration or restart the backend
awaiting_oauthProvider authorization is requiredComplete the OAuth flow shown by inspect
connectedThe backend connection is established; invocation also requires available: trueInspect or run tools after availability is confirmed

Health Endpoints

/health/ready and /health/mcp answer different questions:

  • /health/ready reports whether runtime configuration is ready to accept HTTP traffic. It is not a claim that every MCP backend has completed startup.
  • /health/mcp is the operational backend-progress view, including loading and retry detail.
bash
curl http://localhost:3050/health/ready
curl http://localhost:3050/health/mcp

Use the inspect API or CLI for an authenticated caller deciding whether to invoke a tool. Use health endpoints for monitoring.

Configuration Notes

Async loading remains opt-in. This page describes the runtime contract rather than deprecated-option cleanup; use current command help and the configuration reference for supported options.

Related work: #393 tracks obsolete async option cleanup, and #405 defines the CLI status and wait workflow.

Released under the Apache 2.0 License.