Skip to content

[BUG] MCPServer argument ordering is incorrect #2078

Description

@peterj

📋 Prerequisites

  • I have searched the existing issues to avoid creating a duplicate
  • By submitting this issue, you agree to follow our Code of Conduct
  • I am using the latest version of the software
  • I have tried to clear cache/cookies or used incognito mode (if ui-related)
  • I can consistently reproduce this issue

🎯 Affected Service(s)

Multiple services / System-wide issue

🚦 Impact/Severity

No impact (Default)

🐛 Bug Description

I you create an MCP server from the UI - e.g. "npx -y @modelcontextprotocol/something --stdio" the order of arguments isn't respected and you end up with a CRD that looks like this:

apiVersion: kagent.dev/v1alpha1
kind: MCPServer
metadata:
  name: map-server
  namespace: kagent
spec:
  deployment:
    args:
    - -y
    - --stdio
    - '@modelcontextprotocol/server-map'
    cmd: npx
    image: node:24-alpine3.21
    port: 3000
    replicas: 1
  stdioTransport: {}
  timeout: 30s
  transportType: stdio

Note the incorrect position of the --stdio arg. We need to make sure when creating the CRD that we respect the order of arguments (in the UI we do split out the inputs for arguments that go before the npx command and ones that go after it)

🔄 Steps To Reproduce

See above

🤔 Expected Behavior

No response

📱 Actual Behavior

No response

💻 Environment

No response

🔧 CLI Bug Report

No response

🔍 Additional Context

No response

📋 Logs

📷 Screenshots

No response

🙋 Are you willing to contribute?

  • I am willing to submit a PR to fix this issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No fields configured for Bug.

    Projects

    Status
    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions