You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Define custom Lua native MCP servers that run directly in Neovim without external processes. Each server can provide tools, resources, and prompts. Please see [native servers guide](/mcp/native/index) to create MCP Servers in lua.
259
282
283
+
### builtin_tools
284
+
285
+
Default:
286
+
287
+
```lua
288
+
{
289
+
builtin_tools= {
290
+
edit_file= {
291
+
},
292
+
},
293
+
}
294
+
```
295
+
296
+
Configuration options for MCPHub's builtin tools like `edit_file` tool. View complete [Builtin Tools Documentation](/mcp/builtin/neovim) for all available tools and their configuration options.
Once configured, you can interact with MCP Hub within the CodeCompanion chat buffer:
48
+
MCP Hub provides multiple ways to access MCP tools in CodeCompanion, giving you flexibility from broad access to fine-grained control:
39
49
40
-
-**Tool Access:** Type `@mcp` to add available MCP servers to the system prompt, enabling the LLM to use registered MCP tools.
41
-
-**Resources as Variables:** If `make_vars = true`, MCP resources become available as variables prefixed with `#`. You can include these in your prompts (e.g., `Summarize the issues in #mcp:lsp:get_diagnostics`):
50
+
### Tool Access
42
51
43
-
*Example: Accessing LSP diagnostics*:
52
+
#### 1. Universal MCP Access (`@mcp`)
53
+
Adds all available MCP servers to the system prompt and provides LLM with `@mcp` tool group which has `use_mcp_tool` and `access_mcp_resource` tools.
You can add all the enabled tools from a specific server with server groups. Unlike the `@mcp` group where all the running servers are converted and added to the system prompt, the tools added with server groups are pure function tools and hence depend on model support. The available groups depend on your connected MCP servers:
46
60
47
-
**Prompts as Slash Commands:** If `make_slash_commands = true`, MCP prompts are available as slash commands (e.g., `/mcp:prompt_name`). Arguments are handled via `vim.ui.input`.
61
+
```
62
+
@{neovim} Read the main.lua file # All tools from the neovim server will be added as function tools
63
+
@{github} Create an issue
64
+
@{fetch} Get this webpage
65
+
```
48
66
49
-
*Example: Using an MCP prompt via slash command*:
67
+
Server groups are automatically created based on your connected MCP servers when enabled via `make_tools`. Check your MCP Hub UI to see which servers you have connected.
MCPHub includes powerful [builtin servers](/mcp/builtin/neovim) like `@neovim` (file operations, terminal, LSP) and `@mcphub` (server management) that are always available.
You can just provide a single tool from a server for fine-grained functionality. Tool names depend on your connected servers:
73
+
```
74
+
@{neovim__read_file} Show me the config file
75
+
@{fetch__fetch} Get this webpage content
76
+
@{github__create_issue} File a bug report
77
+
```
53
78
79
+
Use the MCP Hub UI or CodeCompanion's tool completion to discover available tools.
54
80
81
+
#### 4. Custom Tool Sets
82
+
Create your own tool combinations by mixing MCP tools with existing CodeCompanion tools:
55
83
56
-
## Auto-Approval
84
+
Example configuration for custom tool groups:
57
85
58
-
By default, whenever codecompanion calls `use_mcp_tool` or `access_mcp_resource` tool, it shows a confirm dialog with tool name, server name and arguments.
- Each MCP tool can be individually auto-approved for fine-grained control (see Auto-Approval section)
131
+
132
+
### Resources as Variables
133
+
If `make_vars = true`, MCP resources become available as variables prefixed with `#`:
65
134
66
-
```lua
67
-
require("mcphub").setup({
68
-
-- This sets vim.g.mcphub_auto_approve to true by default (can also be toggled from the HUB UI with `ga`)
69
-
auto_approve=true,
70
-
})
135
+
```
136
+
Fix diagnostics in the file #{mcp:neovim://diagnostics/buffer}
137
+
Analyze the current buffer #{mcp:neovim:buffer}
71
138
```
72
139
73
-
This also sets `vim.g.mcphub_auto_approve` variable to `true`. You can also toggle this option in the MCP Hub UI with `ga` keymap. You can see the current auto approval status in the Hub UI.
For more control, configure auto-approval per server or per tool in your `servers.json`:
161
+
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.
You can set `auto_approve` to `true` to automatically approve all MCP tool calls without user confirmation:
200
+
201
+
```lua
202
+
require("mcphub").setup({
203
+
-- This sets vim.g.mcphub_auto_approve to true by default (can also be toggled from the HUB UI with `ga`)
204
+
auto_approve=true,
205
+
})
206
+
```
207
+
208
+
This also sets `vim.g.mcphub_auto_approve` variable to `true`. You can also toggle this option in the MCP Hub UI with `ga` keymap. You can see the current auto approval status in the Hub UI.
-**MCPHub Server**: Plugin management utilities, server lifecycle control, and documentation access
92
+
93
+
These servers provide essential functionality without external dependencies and offer deep Neovim integration.
94
+
86
95
### Chat Integrations
87
96
88
97
- MCP Hub provides integrations with popular chat plugins like [Avante](https://github.com/yetone/avante.nvim), [CodeCompanion](https://github.com/olimorris/codecompanion.nvim), [CopilotChat](https://github.com/CopilotC-Nvim/CopilotChat.nvim).
@@ -131,8 +140,3 @@ Just configure them to use MCP Hub's unified endpoint:
131
140
132
141
-[Installation Guide](/installation) - Set up MCPHub in your Neovim
133
142
-[Configuration Guide](/configuration) - Learn about configuring MCP Hub
0 commit comments