-
-
Notifications
You must be signed in to change notification settings - Fork 68
Codecompanion: Make MCP Servers into function tools #169
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
Merged
Conversation
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
…access - Split monolithic utils.lua into modular architecture: - core.lua: execution logic and output handling - tools.lua: static/dynamic tool management with conflict detection - variables.lua: MCP resources as variables - slash_commands.lua: MCP prompts as slash commands - Add granular tool access options: - Individual tools: @server__tool_name - Server groups: @server_name - Unique safe naming for servers (handles conflicts like server/one, server:two) - Conflict detection and warnings for existing tools/groups - Add make_tools config option, opt-out of showing all the server tools with `show_server_tools_in_chat` - Update syntax highlighting for new tool structure
Owner
Author
|
There is a bug in codecompanoin for which a PR olimorris/codecompanion.nvim#1693 has been opened. Everything should work fine once it is merged. |
Owner
Author
Useful for tools like edit_file or write_file tools where we already open a interactive buffer. This avoids double confirmations
5 tasks
Contributor
|
Works great for me! |
* feat(codecompanion): add format_tool * fix: docs --------- Co-authored-by: ravitemer <[email protected]>
Owner
Author
fix-issue.mp4 |
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.



Description
This PR introduces a significant improvement to the MCPHub-CodeCompanion integration that addresses previous limitations and provides much more flexibility and control over your MCP tools!
Previous Limitations with
@mcpThe existing
@mcptool worked, but had some drawbacks:✨ New: Granular Tool Access
This PR introduces granular tool access that creates proper CodeCompanion function tools for each MCP server and tool:
🎯 Server Groups
Access all tools from a specific server:
🔧 Individual Tools
Target specific functionality with namespaced tools:
🛠️ Custom Tool Combinations
Create specialized workflows by mixing tools from different servers:
Then use your custom groups:
🎛️ Fine-Grained Auto-Approval
One standout feature is per-tool auto-approval control:
read_multiple_files,search_code) while protecting dangerous ones (delete_items,execute_command)🚀 Benefits
✅ Better Performance
✅ Enhanced Precision
✅ Improved Workflow
Some older OpenAI models have character limits for function descriptions. If you encounter issues:
@mcpfor specific cases🚀 Get Started
Use the
make_toolsbranch:{ "ravitemer/mcphub.nvim", branch = "make-tools", build = "npm i -g mcp-hub@latest", config = function() require("mcphub").setup({}) end },No breaking changes! The traditional
@mcptool continues to work exactly as before. The new granular tools are additive features that enhance your workflow without disrupting existing usage. The following is the default config. Just update your MCPHub plugin and start using the new tool access methods.@completion in CodeCompanion chatshow_server_tools_in_chat = falseif you prefer to see only server groups (@github) in completion, hiding individual tools (@github__create_issue)