Add stdio transport entry point#19
Open
JohnEchevesteMM wants to merge 6 commits into
Open
Conversation
Adds `kolide-mcp-stdio` console script that runs the existing MCP server over stdio, so clients like Claude Desktop and Claude Code can launch it as a subprocess instead of requiring a long-running HTTP server plus the mcp-remote bridge. - server.py: new `main_stdio()` runs `server` via `mcp.server.stdio`, reusing all tool handlers and the reporting-tables registry. Skips MCP_AUTH_TOKEN since stdio inherits the parent process's trust boundary. - logging_config.py: route logs to stderr instead of stdout so they don't corrupt the JSON-RPC channel under stdio transport. - pyproject.toml: register the `kolide-mcp-stdio` script. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Update intro and Features list to reflect dual-transport support - Add side-by-side comparison of HTTP vs stdio mode with guidance on when to choose each - Document the `kolide-mcp-stdio` entry point - Add a Claude Code MCP config example (both `claude mcp add` CLI and JSON config forms) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
cacab
requested changes
May 20, 2026
Contributor
cacab
left a comment
There was a problem hiding this comment.
A few suggestions. Overall this looks awesome!
Co-authored-by: Caitlin Cabrera <46205451+cacab@users.noreply.github.com>
- Set _request_ip to "stdio" in main_stdio so audit logs show a meaningful src field instead of "unknown" for stdio tool calls - Fix MCP_LOG_FILE docs: logs go to stderr (not stdout) in stdio mode Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
cacab
approved these changes
May 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a
kolide-mcp-stdioconsole script that runs the existing MCP server over stdio, alongside the existing HTTP transport. Both modes share the sameServerinstance, tool handlers, and reporting-tables registry — this change is purely additive.Motivation
The current HTTP-only design requires users of stdio-only clients (Claude Desktop, Claude Code, and any MCP client without HTTP support) to keep a long-running HTTP server alive and bridge to it with
mcp-remote. That's two extra moving parts — a background process to supervise plus annpxsubprocess — for a use case the MCP SDK already supports natively.With this change, those clients can launch the server as a subprocess on demand, with no port, no
MCP_AUTH_TOKEN, and nomcp-remotedependency. HTTP mode continues to work exactly as before for Cursor, VS Code, and shared deployments.Changes
src/kolide_mcp/server.py— newmain_stdio()entry point. Reuses the existingserverobject viamcp.server.stdio.stdio_server(), mirrors the HTTP lifespan (loads the reporting-tables registry on startup, closes the HTTP client on shutdown), and validatesKOLIDE_API_VERSIONbefore launch. Skips theMCP_AUTH_TOKENcheck because stdio inherits the parent process's trust boundary — a bearer token on a subprocess pipe would be meaningless.src/kolide_mcp/logging_config.py— route the default log stream from stdout to stderr. Required for stdio correctness (stdout is the JSON-RPC channel); invisible to HTTP clients, which never read the server's stdout. Optional file logging viaMCP_LOG_FILEis unaffected.pyproject.toml— register thekolide-mcp-stdioconsole script.README.md— updated intro and Features list to reflect dual-transport support; added a "Which mode should I use?" comparison table; added a Claude Code config example (bothclaude mcp addand JSON config forms).Compatibility
mcp.server.stdioships with the existingmcprequirement).