ExMCP.StdioLauncher (ex_mcp v0.9.2)
View SourceLauncher module for STDIO servers that handles Mix.install output.
This module provides a clean way to start STDIO servers that need to use Mix.install by handling the startup output problem.
Important Note
While this module minimizes output contamination, Mix.install may still produce some stdout output during dependency resolution that cannot be completely suppressed. The ExMCP STDIO server is designed to gracefully handle and ignore such non-JSON lines during startup.
For production use, consider using pre-compiled releases instead of Mix.install to eliminate all startup output.
Usage
Instead of using Mix.install directly in your script, use:
#!/usr/bin/env elixir
ExMCP.StdioLauncher.start(MyServer, [
{:ex_mcp, "~> 0.1"},
{:jason, "~> 1.4"}
])This will:
- Install dependencies with minimal output
- Configure logging appropriately for STDIO transport
- Start your server with STDIO transport
Summary
Functions
Starts a STDIO server with proper dependency installation.