Skip to content

Feat: add CLI MCP server auto-connect support#350

Merged
matteo8p merged 2 commits into
MCPJam:mainfrom
meAmitPatil:fix-cli-local-server-support
Aug 6, 2025
Merged

Feat: add CLI MCP server auto-connect support#350
matteo8p merged 2 commits into
MCPJam:mainfrom
meAmitPatil:fix-cli-local-server-support

Conversation

@meAmitPatil
Copy link
Copy Markdown
Contributor

Summary

Enables users to automatically connect to MCP servers via CLI arguments.

Users can now run:

npx @mcpjam/inspector node build/index.js arg1 arg2

The server will automatically connect without manual setup, matching Anthropic's MCP Inspector behavior.

Changes

  • Add CLI argument parsing in bin/start.js
  • Add auto-connect logic in client hook
  • Support both development and production modes
  • Add API endpoint for development mode config
Screenshot 2025-08-06 at 2 00 35 PM Screenshot 2025-08-06 at 2 00 59 PM Screenshot 2025-08-06 at 2 01 28 PM

Closes #337

@meAmitPatil
Copy link
Copy Markdown
Contributor Author

@matteo8p
Large diff explanation: Most of the +12,842 lines are from package-lock.json files due to dependency installations during development.

Core changes are small (~100 lines across 4 files):

  • bin/start.js - CLI argument parsing logic (~24 lines)
  • client/src/hooks/use-app-state.ts - Auto-connect logic (~45 lines)
  • server/index.ts - API endpoint + config injection (~33 lines)
  • .gitignore - Next.js entries (~5 lines)

Copy link
Copy Markdown
Contributor

@matteo8p matteo8p left a comment

Choose a reason for hiding this comment

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

Holy you're CRACKED

@matteo8p
Copy link
Copy Markdown
Contributor

matteo8p commented Aug 6, 2025

Gonna merge it and test it out

@matteo8p matteo8p merged commit 15a477b into MCPJam:main Aug 6, 2025
khandrew1 pushed a commit that referenced this pull request Nov 15, 2025
* fix: add Next.js entries to gitignore

* feat: add CLI MCP server auto-connect support
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.

Improve CLI to open up local MCP server in command line

2 participants