Add automatic connection feature with CLI support#56
Merged
Conversation
- Add --connect CLI option supporting manual/auto/specific target modes - Implement auto_connect_current_project_targets() for project-wide auto-connect - Add auto_connect_single_target() for connecting to specific targets - Export auto-connect functions in public API via lib.rs - Support TCP addresses and socket paths in specific target mode - Find project targets using git root with fallback to current directory - Add comprehensive logging for connection status and failures
- Add comprehensive CLI options documentation for --connect parameter - Document auto-connection workflow in README and instructions - Update CHANGELOG with detailed auto-connection features and behavior - Include project detection and socket pattern matching details - Fix markdown formatting issues with blank lines around code blocks
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds automatic connection functionality to the nvim-mcp server, enabling streamlined workflows through CLI-driven auto-discovery and connection to project-associated Neovim instances.
- Implements automatic connection feature with project-scoped discovery of Neovim instances
- Adds CLI support with
--connectoption supporting manual, auto, and specific target modes - Updates documentation to reflect new automatic connection capabilities
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/server/mod.rs | Changes module visibility from pub(crate) to pub for core module |
| src/server/core.rs | Adds auto-connection functions and project-scoped target discovery |
| src/main.rs | Implements CLI support for connection modes with validation logic |
| src/lib.rs | Exports new auto-connection functions from the core module |
| docs/instructions.md | Documents automatic connection workflow and usage patterns |
| README.md | Updates usage examples and adds auto-connection workflow documentation |
| CLAUDE.md | Updates development documentation with new CLI options |
| CHANGELOG.md | Documents new features and CLI options for automatic connection |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Add proper warning logging for errors in get_current_project_root() and find_targets_for_current_project() functions to help diagnose issues when automatic connection fails to locate project directories or sockets.
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 automatic connection feature to detect and connect to project-associated Neovim instances
• Implements CLI support with
--connect autooption for streamlined workflow• Updates documentation with new automatic connection capabilities