Skip to content

fix: MCP stdio server fail to start when passing env property #6648

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

jiashengguo
Copy link

@jiashengguo jiashengguo commented Apr 1, 2025

Summary

The MCP Stdio server fails to start when env property is provided. This issue is due to a bug in the MCP TypeScript SDK.

Change Type

Please delete any irrelevant options.

  • Bug fix (non-breaking change which fixes an issue)

Testing

In the librechat.yaml, add an arbitrary env property for the filesystem MCP server like below:

  filesystem:
    type: stdio
    command: npx
    args:
      - -y
      - '@modelcontextprotocol/server-filesystem'
      - /home/user/LibreChat/
    iconPath: /home/user/LibreChat/client/public/assets/logo.svg
    env:
      testenv: 'dummy'
  • before:
    The filesystem server fails to start with the below error:
    error: [MCP][filesystem] Initialization failed spawn npx ENOENT
  • after:
    The filesystem server successfully started:
    Secure MCP Filesystem Server running on stdio

Checklist

Please delete any irrelevant options.

  • My code adheres to this project's style guidelines
  • I have performed a self-review of my own code
  • I have commented in any complex areas of my code
  • My changes do not introduce new warnings
  • I have written tests demonstrating that my changes are effective or that my feature works
  • Local unit tests pass with my changes
  • Any changes dependent on mine have been merged and published in downstream modules.

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.

1 participant