Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,12 @@ MCP Hub is a MCP client for neovim that seamlessly integrates [MCP (Model Contex
| | Headers | ✅ | For API keys/tokens |
| **Chat Integration** ||||
| | [Avante.nvim](https://github.com/yetone/avante.nvim) | ✅ | Tools, resources, resourceTemplates, prompts(as slash_commands) |
| | [CodeCompanion.nvim](https://github.com/olimorris/codecompanion.nvim) | ✅ | Tools, resources, templates, prompts (as slash_commands), 🖼 image responses |
| | [CodeCompanion.nvim](https://github.com/olimorris/codecompanion.nvim) | ✅ | Tools, resources, templates, prompts (as slash_commands), 🖼 image responses, 🔒 tool result review |
| | [CopilotChat.nvim](https://github.com/CopilotC-Nvim/CopilotChat.nvim) | ✅ | Tools, resources, function calling support |
| **Security & Control** ||||
| | Tool Confirmation | ✅ | User confirmation before tool execution |
| | Result Review | ✅ | Inspect & approve/reject tool results before sending to LLM |
| | Granular Auto-Approval | ✅ | Per-server, per-tool, or function-based approval rules |
| **Marketplace** ||||
| | Server Discovery | ✅ | Browse from verified MCP servers |
| | Installation | ✅ | Manual and auto install with AI |
Expand Down
30 changes: 27 additions & 3 deletions doc/extensions/codecompanion.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,30 @@ If `make_slash_commands = true`, MCP prompts are available as slash commands:



## Auto-Approval
## Tool Approval & Review

By default, whenever codecompanion calls `use_mcp_tool` or `access_mcp_resource` tool or a specific tool on some MCP server, it shows a confirm dialog with tool name, server name and arguments.

![Image](https://github.com/user-attachments/assets/201a5804-99b6-4284-9351-348899e62467)

### Review Tool Results

The confirmation dialog now includes a **"Yes & Review"** option, allowing you to inspect tool results before they're sent to the LLM. This is particularly useful for preventing sensitive data leakage when working with tools that access confidential information (JIRA, Confluence, databases, etc.).

**Keyboard shortcuts in confirmation dialog:**
- `y`/`Y` - Yes (execute and auto-send to LLM)
- `r`/`R` - **Yes & Review** (execute, then show review window)
- `n`/`N` - No (don't execute)
- `c`/`C` or `<Esc>` - Cancel

When you select "Yes & Review", the tool executes and then displays a review window where you can:
- Inspect the full result (with scrolling for large outputs)
- Approve to send to LLM (`y`, `a`, or `<CR>` on Approve)
- Reject to prevent data leakage (`n`, `r`, or `<Esc>`)

**See the full documentation**: [Tool Result Review Feature](/other/review-feature)

### Auto-Approval

#### Fine-Grained Auto-Approval

Expand Down Expand Up @@ -239,6 +257,11 @@ require("mcphub").setup({
end
end

-- Execute JIRA/Confluence tools but always review results
if params.server_name == "jira" or params.server_name == "confluence" then
return { approve = true, review = true }
end

-- Check if tool is configured for auto-approval in servers.json
if params.is_auto_approved_in_server then
return true -- Respect servers.json configuration
Expand All @@ -258,8 +281,9 @@ require("mcphub").setup({
- `params.is_auto_approved_in_server` - Boolean indicating if tool is configured for auto-approval in servers.json

**Return values:**
- `true` - Auto-approve the call
- `false` - Show confirmation prompt
- `true` - Auto-approve and execute immediately (no review)
- `false` - Show confirmation prompt (user can choose review)
- `{ approve = true, review = true }` - Execute and force review window
- `string` - Deny with error message
- `nil` - Show confirmation prompt (same as false)

Expand Down
39 changes: 34 additions & 5 deletions doc/mcphub.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*mcphub.nvim.txt* For NVIM v0.10.0 Last change: 2025 December 12
*mcphub.nvim.txt* For NVIM v0.10.0 Last change: 2026 February 17

==============================================================================
Table of Contents *mcphub.nvim-table-of-contents*
Expand Down Expand Up @@ -3295,13 +3295,36 @@ If `make_slash_commands = true`, MCP prompts are available as slash commands:
_Example: Using an MCP prompt via slash command_:


AUTO-APPROVAL ~
TOOL APPROVAL & REVIEW ~

By default, whenever codecompanion calls `use_mcp_tool` or
`access_mcp_resource` tool or a specific tool on some MCP server, it shows a
confirm dialog with tool name, server name and arguments.


REVIEW TOOL RESULTS

The confirmation dialog now includes a **“Yes & Review”** option, allowing
you to inspect tool results before they’re sent to the LLM. This is
particularly useful for preventing sensitive data leakage when working with
tools that access confidential information (JIRA, Confluence, databases, etc.).

**Keyboard shortcuts in confirmation dialog:** - `y`/`Y` - Yes (execute and
auto-send to LLM) - `r`/`R` - **Yes & Review** (execute, then show review
window) - `n`/`N` - No (don’t execute) - `c`/`C` or `<Esc>` - Cancel

When you select "Yes & Review", the tool executes and then displays a review
window where you can: - Inspect the full result (with scrolling for large
outputs) - Approve to send to LLM (`y`, `a`, or `<CR>` on Approve) - Reject to
prevent data leakage (`n`, `r`, or `<Esc>`)

**See the full documentation**: Tool Result Review Feature
</other/review-feature>


AUTO-APPROVAL


FINE-GRAINED AUTO-APPROVAL

For fine-grained control, configure auto-approval per server or per tool in
Expand Down Expand Up @@ -3378,6 +3401,11 @@ specific tool call:
end
end

-- Execute JIRA/Confluence tools but always review results
if params.server_name == "jira" or params.server_name == "confluence" then
return { approve = true, review = true }
end

-- Check if tool is configured for auto-approval in servers.json
if params.is_auto_approved_in_server then
return true -- Respect servers.json configuration
Expand All @@ -3395,9 +3423,10 @@ resources) - `params.arguments` - Table of arguments passed to the tool -
- Resource URI (for resource access) - `params.is_auto_approved_in_server` -
Boolean indicating if tool is configured for auto-approval in servers.json

**Return values:** - `true` - Auto-approve the call - `false` - Show
confirmation prompt - `string` - Deny with error message - `nil` - Show
confirmation prompt (same as false)
**Return values:** - `true` - Auto-approve and execute immediately (no review)
- `false` - Show confirmation prompt (user can choose review) - `{ approve =
true, review = true }` - Execute and force review window - `string` - Deny with
error message - `nil` - Show confirmation prompt (same as false)


AUTO-APPROVAL PRIORITY
Expand Down
Loading