Skip to content

ROX-31475: add stdio support#12

Merged
janisz merged 7 commits intomainfrom
ROX-31475_stdio
Dec 12, 2025
Merged

ROX-31475: add stdio support#12
janisz merged 7 commits intomainfrom
ROX-31475_stdio

Conversation

@janisz
Copy link
Contributor

@janisz janisz commented Dec 2, 2025

Description

This PR adds a configuration option to run stdio mode.

Validation

I run

claude mcp add --transport stdio  test2 --env STACKROX_MCP__SERVER__TYPE=stdio --env STACKROX_MCP__TOOLS__VULNERABILITY__ENABLED=true -- $PWD/stackrox-mcp

and then asked to list cluster cves and got a valid error:

test2 - list_cluster_cves (MCP)(clusterId: "")
  ⎿  Error: list_cluster_cves tool is not yet implemented

@janisz janisz requested a review from mtodor December 2, 2025 13:18
Copy link
Collaborator

@mtodor mtodor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One thing, I'm not sure is - will this work with passthrough auth type?

Signed-off-by: Tomasz Janiszewski <tomek@redhat.com>

# Conflicts:
#	internal/server/server.go
@codecov-commenter
Copy link

codecov-commenter commented Dec 5, 2025

❌ 2 Tests Failed:

Tests completed Failed Passed Skipped
161 2 159 0
View the full list of 2 ❄️ flaky test(s)
github.com/stackrox/stackrox-mcp/internal/testutil::

Flake rate in main: 100.00% (Passed 0 times, Failed 2 times)

Stack Traces | 0s run time
Build error
github.com/stackrox/stackrox-mcp/internal/toolsets/mock::

Flake rate in main: 100.00% (Passed 0 times, Failed 2 times)

Stack Traces | 0s run time
Build error

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

Signed-off-by: Tomasz Janiszewski <tomek@redhat.com>
@janisz
Copy link
Contributor Author

janisz commented Dec 5, 2025

One thing, I'm not sure is - will this work with passthrough auth type?

Good point. Let me add e2e tests and whoami command as the part of startup

Signed-off-by: Tomasz Janiszewski <tomek@redhat.com>
Copy link
Collaborator

@mtodor mtodor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have tested this, and it doesn't work with the passthrough auth flow. What is understandable because there are no request headers for stdio (I guess).

Anyway, it works for a static auth flow. Command looks like this:

claude mcp add --transport stdio  test3 \
	--env STACKROX_MCP__SERVER__TYPE=stdio \
	--env STACKROX_MCP__CENTRAL__AUTH_TYPE=static \
	--env STACKROX_MCP__CENTRAL__API_TOKEN="${ROX_TOKEN}" \
	--env STACKROX_MCP__TOOLS__CONFIG_MANAGER__ENABLED=true  \
	--env STACKROX_MCP__CENTRAL__URL=staging.demo.stackrox.com:443 \
	-- $PWD/stackrox-mcp

Let's make the following changes:

  • document command in the readme (how to use stdio)
  • add config validation if stdio is used, the auth type has to be static

P.S. You can use the config manager tool because that one actually makes requests to the server. And you can create API token on staging demo and test everything against it.

janisz and others added 2 commits December 8, 2025 16:06
Signed-off-by: Tomasz Janiszewski <tomek@redhat.com>
Add documentation for the stdio transport option based on PR feedback:
- Add server.type configuration option to Server Configuration table
- Document stdio transport usage with Claude Code CLI
- Clarify that stdio requires static authentication (passthrough not supported)
- Update HTTP-specific options to note they only apply to HTTP transport

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@janisz janisz requested a review from mtodor December 8, 2025 16:36
Copy link
Collaborator

@mtodor mtodor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! Added a few nitpicks, nothing related to the functionality.

janisz and others added 2 commits December 12, 2025 12:33
Co-authored-by: Mladen Todorovic <mtodor@gmail.com>
- Renamed TestLoadConfig_ValidationPass to TestLoadConfig_ServerTypeValidationPass
- Renamed validYAMLInvalidConfig variable to validYAMLConfig
- Added TestValidate_ServerType_InvalidType to verify invalid server type validation
- Fixed grammar in error message assertion (does require vs does requires)
- Added auth_type: static to test config to satisfy stdio validation requirements

Addresses feedback from https://github.com/stackrox/stackrox-mcp/pull/12/changes#r2602119520

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@janisz janisz merged commit 36a9393 into main Dec 12, 2025
3 checks passed
@janisz janisz deleted the ROX-31475_stdio branch December 12, 2025 12:02
janisz added a commit that referenced this pull request Mar 17, 2026
Remove internal/testutil/command.go which contains the unused
RunCommand function. Verified by searching the codebase - no
actual usage found in any test or production code.

Addresses PR #50 review comment #12

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants