Skip to content

Commit c3fc53b

Browse files
committed
chore: make all
1 parent 60529af commit c3fc53b

2 files changed

Lines changed: 152 additions & 62 deletions

File tree

doc/mcphub.txt

Lines changed: 152 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*mcphub.nvim.txt* For NVIM v0.10.0 Last change: 2025 June 27
1+
*mcphub.nvim.txt* For NVIM v0.10.0 Last change: 2025 July 10
22

33
==============================================================================
44
Table of Contents *mcphub.nvim-table-of-contents*
@@ -103,7 +103,7 @@ Just configure them to use MCP Hub’s unified endpoint:
103103
{
104104
"mcpServers" : {
105105
"Hub": {
106-
"url" : "http://localhost:37373/mcp
106+
"url" : "http://localhost:37373/mcp"
107107
}
108108
}
109109
}
@@ -119,6 +119,17 @@ USAGE ~
119119
- Test tools and resources directly in Neovim
120120

121121

122+
BUILTIN NATIVE SERVERS ~
123+
124+
MCPHub includes two native servers that run directly within Neovim:
125+
126+
- **Neovim Server**: Comprehensive file operations, terminal access, LSP integration, and buffer management
127+
- **MCPHub Server**: Plugin management utilities, server lifecycle control, and documentation access
128+
129+
These servers provide essential functionality without external dependencies and
130+
offer deep Neovim integration.
131+
132+
122133
CHAT INTEGRATIONS ~
123134

124135
- 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>.
@@ -413,7 +424,7 @@ detail.
413424
shutdown_delay = 60 * 10 * 000, -- Delay in ms before shutting down the server when last instance closes (default: 10 minutes)
414425
use_bundled_binary = false, -- Use local `mcp-hub` binary (set this to true when using build = "bundled_build.lua")
415426
mcp_request_timeout = 60000, --Max time allowed for a MCP tool or resource to execute in milliseconds, set longer for long running tasks
416-
427+
417428
---Chat-plugin related options-----------------
418429
auto_approve = false, -- Auto approve mcp tool calls
419430
auto_toggle_mcp_servers = true, -- Let LLMs start and stop MCP servers automatically
@@ -422,9 +433,32 @@ detail.
422433
make_slash_commands = true, -- make /slash commands from MCP server prompts
423434
}
424435
},
425-
436+
426437
--- Plugin specific options-------------------
427438
native_servers = {}, -- add your custom lua native servers here
439+
builtin_tools = {
440+
edit_file = {
441+
parser = {
442+
track_issues = true,
443+
extract_inline_content = true,
444+
},
445+
locator = {
446+
fuzzy_threshold = 0.8,
447+
enable_fuzzy_matching = true,
448+
},
449+
ui = {
450+
go_to_origin_on_complete = true,
451+
keybindings = {
452+
accept = ".",
453+
reject = ",",
454+
next = "n",
455+
prev = "p",
456+
accept_all = "ga",
457+
reject_all = "gr",
458+
},
459+
},
460+
},
461+
},
428462
ui = {
429463
window = {
430464
width = 0.8, -- 0-1 (ratio); "50%" (percentage); 50 (raw number)
@@ -591,25 +625,25 @@ specific tool call:
591625
if params.server_name == "github" and params.tool_name == "get_issue" then
592626
return true -- Auto approve
593627
end
594-
628+
595629
-- Block access to private repos
596630
if params.arguments.repo == "private" then
597631
return "You can't access my private repo" -- Error message
598632
end
599-
633+
600634
-- Auto-approve safe file operations in current project
601635
if params.tool_name == "read_file" then
602636
local path = params.arguments.path or ""
603637
if path:match("^" .. vim.fn.getcwd()) then
604638
return true -- Auto approve
605639
end
606640
end
607-
641+
608642
-- Check if tool is configured for auto-approval in servers.json
609643
if params.is_auto_approved_in_server then
610644
return true -- Respect servers.json configuration
611645
end
612-
646+
613647
return false -- Show confirmation prompt
614648
end,
615649
})
@@ -690,6 +724,24 @@ Please see native servers guide </mcp/native/index> to create MCP Servers in
690724
lua.
691725

692726

727+
BUILTIN_TOOLS ~
728+
729+
Default:
730+
731+
>lua
732+
{
733+
builtin_tools = {
734+
edit_file = {
735+
},
736+
},
737+
}
738+
<
739+
740+
Configuration options for MCPHub’s builtin tools like `edit_file` tool. View
741+
complete Builtin Tools Documentation </mcp/builtin/> for all available tools
742+
and their configuration options.
743+
744+
693745
UI ~
694746

695747
Default:
@@ -788,12 +840,9 @@ FROM MARKETPLACE
788840
BROWSE, SORT, FILTER , SEARCH FROM AVAILABLE MCP SERVERS.
789841

790842

791-
ONE CLICK AI INSTALL WITH AVANTE AND CODECOMPANION
792-
793-
794-
OR SIMPLE COPY PASTE MCPSERVERS JSON BLOCK IN THE README
795-
843+
ONE CLICK INSTALL/UNINSTALL
796844

845+
Choose from different install options:
797846

798847

799848
FROM HUB VIEW
@@ -840,7 +889,8 @@ LOCAL (STDIO) SERVERS
840889
"DB_URL": "postgresql://user:${DB_PASSWORD}@localhost/myapp",
841890
"DB_PASSWORD": "password123",
842891
"FALLBACK_VAR": null
843-
}
892+
},
893+
"cwd": "/home/ubuntu/server-dir/"
844894
}
845895
}
846896
}
@@ -856,6 +906,7 @@ OPTIONAL FIELDS:
856906

857907
- `args`: Array of command arguments (supports `${VARIABLE}` and `${cmd: command}` placeholders)
858908
- `env`: Environment variables with placeholder resolution and system fallback
909+
- `cwd`: The current working directory for the MCP server process (supports `${VARIABLE}` and `${cmd: command}` placeholders)
859910
- `dev`: Development mode configuration for auto-restart on file changes
860911
- `name`: Display name that will be shown in the UI
861912
- `description`: Short description about the server (useful when the server is disabled and `auto_toggle_mcp_servers` is `true`)
@@ -890,6 +941,35 @@ Given `API_KEY=secret` in the environment:
890941
⚠️ **Legacy Syntax**: `$VAR` (args) and `$: command` (env) are deprecated
891942
but still supported with warnings. Use `${VAR}` and `${cmd: command}` instead.
892943

944+
CWD EXAMPLE:
945+
946+
The `cwd` field is particularly useful when your MCP server needs to run in a
947+
specific directory context. Here’s a practical example:
948+
949+
>json
950+
{
951+
"mcpServers": {
952+
"project-server": {
953+
"command": "npm",
954+
"args": ["start"],
955+
"cwd": "/home/ubuntu/my-mcp-project/",
956+
"env": {
957+
"NODE_ENV": "development"
958+
}
959+
}
960+
}
961+
}
962+
<
963+
964+
**Use cases for cwd:** - When the MCP server needs to access relative files in
965+
its project directory - When using npm/yarn scripts that depend on being in the
966+
project root
967+
968+
969+
**Note**: The top-level `cwd` field sets the working directory for the server
970+
process itself, while `dev.cwd` (used in development mode) sets the directory
971+
for file watching. These serve different purposes and can be used together.
972+
893973
DEV DEVELOPMENT MODE
894974

895975
The `dev` field enables automatic server restarts when files change during
@@ -2181,7 +2261,7 @@ Here’s a simple chat prompt:
21812261
<
21822262

21832263

2184-
REAL EXAMPLE: NEOVIM'S PARROT PROMPT
2264+
REAL EXAMPLE: NEOVIMS PARROT PROMPT
21852265

21862266
Here’s how the built-in Neovim server implements a fun parrot prompt:
21872267

@@ -2684,7 +2764,7 @@ FEATURES ~
26842764
- **Server Groups**: Access all tools from a specific server (e.g., `@neovim`, `@github`, `@tree_sitter`)
26852765
- **Individual Tools**: Use specific tools with clear namespacing (e.g., `@neovim__read_file`, `@github__create_issue`)
26862766
- **Custom Tool Groups**: Create your own tool combinations for specific workflows
2687-
- **Resource Variables**: Utilize MCP resources as context variables using the `#` prefix (e.g., `#resource_name`)
2767+
- **Resource Variables**: Utilize MCP resources as context variables using the `#` prefix (e.g., `#mcp:resource_name`)
26882768
- **Slash Commands**: Execute MCP prompts directly using `/mcp:prompt_name` slash commands
26892769
- **Rich Media Support**: Supports 🖼 images and other media types as shown in the demo
26902770
- **Real-time Updates**: Automatic updates in CodeCompanion when MCP servers change
@@ -2700,10 +2780,14 @@ Register MCP Hub as an extension in your CodeCompanion configuration:
27002780
mcphub = {
27012781
callback = "mcphub.extensions.codecompanion",
27022782
opts = {
2703-
make_tools = true, -- Enable individual tools (@server__tool) and server groups (@server)
2783+
-- MCP Tools
2784+
make_tools = true, -- Make individual tools (@server__tool) and server groups (@server) from MCP servers
27042785
show_server_tools_in_chat = true, -- Show individual tools in chat completion (when make_tools=true)
2786+
add_mcp_prefix_to_tool_names = false, -- Add mcp__ prefix (e.g `@mcp__github`, `@mcp__neovim__list_issues`)
27052787
show_result_in_chat = true, -- Show tool results directly in chat buffer
2788+
-- MCP Resources
27062789
make_vars = true, -- Convert MCP resources to #variables for prompts
2790+
-- MCP Prompts
27072791
make_slash_commands = true, -- Add MCP prompts as /slash commands
27082792
}
27092793
}
@@ -2724,37 +2808,45 @@ TOOL ACCESS
27242808
1. UNIVERSAL MCP ACCESS (@MCP)
27252809

27262810
Adds all available MCP servers to the system prompt and provides LLM with
2727-
`use_mcp_tool` and `access_mcp_resource` tools.
2811+
`@mcp` tool group which has `use_mcp_tool` and `access_mcp_resource` tools.
27282812

27292813
>
2730-
@mcp What files are in the current directory?
2814+
@{mcp} What files are in the current directory?
27312815
<
27322816

27332817

27342818
2. SERVER GROUPS (WHEN MAKE_TOOLS = TRUE)
27352819

2736-
Access all tools from a specific server. The available groups depend on your
2820+
You can add all the enabled tools from a specific server with server groups.
2821+
Unlike the `@mcp` group where all the running servers are converted and added
2822+
to the system prompt, the tools added with server groups are pure function
2823+
tools and hence depend on model support. The available groups depend on your
27372824
connected MCP servers:
27382825

27392826
>
2740-
@neovim Read the main.lua file # If you have neovim server
2741-
@github Create an issue # If you have github server
2742-
@fetch Get this webpage # If you have fetch server
2827+
@{neovim} Read the main.lua file # All tools from the neovim server will be added as function tools
2828+
@{github} Create an issue
2829+
@{fetch} Get this webpage
27432830
<
27442831

2745-
Server groups are automatically created based on your connected MCP servers.
2746-
Check your MCP Hub UI to see which servers you have connected.
2832+
Server groups are automatically created based on your connected MCP servers
2833+
when enabled via `make_tools`. Check your MCP Hub UI to see which servers you
2834+
have connected.
2835+
2836+
MCPHub includes powerful builtin servers </mcp/builtin/> like `@neovim` (file
2837+
operations, terminal, LSP) and `@mcphub` (server management) that are always
2838+
available.
27472839

27482840

27492841
3. INDIVIDUAL TOOLS (WHEN MAKE_TOOLS = TRUE)
27502842

2751-
Pinpoint specific functionality with namespaced tools. Tool names depend on
2752-
your connected servers:
2843+
You can just provide a single tool from a server for fine-grained
2844+
functionality. Tool names depend on your connected servers:
27532845

27542846
>
2755-
@neovim__read_file Show me the config file
2756-
@fetch__fetch Get this webpage content
2757-
@github__create_issue File a bug report
2847+
@{neovim__read_file} Show me the config file
2848+
@{fetch__fetch} Get this webpage content
2849+
@{github__create_issue} File a bug report
27582850
<
27592851

27602852
Use the MCP Hub UI or CodeCompanion’s tool completion to discover available
@@ -3163,9 +3255,9 @@ CUSTOMIZATION EXAMPLES
31633255
{
31643256
require('mcphub.extensions.lualine'),
31653257
colors = {
3166-
connecting = { fg = "#ffff00" }, -- Yellow
3167-
connected = { fg = "#00ff00" }, -- Green
3168-
error = { fg = "#ff0000" }, -- Red
3258+
connecting = { fg = "#ffff00" }, -- Yellow
3259+
connected = { fg = "#00ff00" }, -- Green
3260+
error = { fg = "#ff0000" }, -- Red
31693261
},
31703262
}
31713263
<
@@ -3199,34 +3291,33 @@ doc/other/architecture.md doc/other/troubleshooting.md
31993291
2. *Image*: doc/https:/github.com/user-attachments/assets/201a5804-99b6-4284-9351-348899e62467
32003292
3. *Image*: doc/https:/github.com/user-attachments/assets/64708065-3428-4eb3-82a5-e32d2d1f98c6
32013293
4. *Image*: doc/mcp/https:/github.com/user-attachments/assets/f5c8adfa-601e-4d03-8745-75180a9d3648
3202-
5. *Image*: doc/mcp/https:/github.com/user-attachments/assets/2d0a0d8b-18ca-4ac8-a207-4758d09d359d
3203-
6. *Image*: doc/mcp/https:/github.com/user-attachments/assets/359bc81e-d6fe-47bb-a25b-572bf280851e
3204-
7. *Image*: doc/mcp/https:/github.com/user-attachments/assets/1cb950da-2f7f-46e9-a623-4cc4b00cc3d0
3205-
8. *Image*: doc/mcp/https:/github.com/user-attachments/assets/131bfed2-c4e7-4e2e-ba90-c86e6ca257fd
3206-
9. *Image*: doc/mcp/https:/github.com/user-attachments/assets/befd1d44-bca3-41f6-a99a-3d15c6c8a5f5
3207-
10. *Image*: doc/extensions/https:/github.com/user-attachments/assets/47086587-d10a-4749-a5df-3a562750010e
3208-
11. *Image*: doc/extensions/https:/github.com/user-attachments/assets/dbc0d210-2ccf-49f8-b1f5-58d868dc02c8
3209-
12. *Image*: doc/extensions/https:/github.com/user-attachments/assets/201a5804-99b6-4284-9351-348899e62467
3210-
13. *Image*: doc/extensions/https:/github.com/user-attachments/assets/64708065-3428-4eb3-82a5-e32d2d1f98c6
3211-
14. *Image*: doc/extensions/https:/github.com/user-attachments/assets/131bfed2-c4e7-4e2e-ba90-c86e6ca257fd
3212-
15. *Image*: doc/extensions/https:/github.com/user-attachments/assets/befd1d44-bca3-41f6-a99a-3d15c6c8a5f5
3213-
16. *image*: doc/extensions/https:/github.com/user-attachments/assets/fb04393c-a9da-4704-884b-2810ff69f59a
3214-
17. *image*: doc/extensions/https:/github.com/user-attachments/assets/678a06a5-ada9-4bb5-8f49-6e58549c8f32
3215-
18. *Image*: doc/extensions/https:/github.com/user-attachments/assets/201a5804-99b6-4284-9351-348899e62467
3216-
19. *Image*: doc/extensions/https:/github.com/user-attachments/assets/64708065-3428-4eb3-82a5-e32d2d1f98c6
3217-
20. *Image*: doc/extensions/https:/github.com/user-attachments/assets/131bfed2-c4e7-4e2e-ba90-c86e6ca257fd
3218-
21. *Image*: doc/extensions/https:/github.com/user-attachments/assets/befd1d44-bca3-41f6-a99a-3d15c6c8a5f5
3219-
22. *Image*: doc/extensions/https:/github.com/user-attachments/assets/7c16bc7e-a9df-4afc-9736-2ee6a39919a9
3220-
23. *Image*: doc/extensions/https:/github.com/user-attachments/assets/adc556bb-7d5f-4d22-820a-a7daeb0ac72c
3221-
24. *Image*: doc/extensions/https:/github.com/user-attachments/assets/7f77bf1e-12b7-4745-a87b-40181a619733
3222-
25. *image*: doc/extensions/https:/github.com/user-attachments/assets/f67802fe-6b0c-48a5-9275-bff9f830ce29
3223-
26. *image*: doc/extensions/https:/github.com/user-attachments/assets/f90f7cc4-ff34-4481-9732-a0331a26502b
3224-
27. *image*: doc/extensions/https:/github.com/user-attachments/assets/f6bdeeec-48f7-48de-89a5-22236a52843f
3225-
28. *Image*: doc/extensions/https:/github.com/user-attachments/assets/3f4fd202-d780-441f-a8cf-58d8a8414ab1
3226-
29. *Image*: doc/extensions/https:/github.com/user-attachments/assets/5522b929-d9b1-472c-9bf8-1c14aef36dbe
3227-
30. *Image*: doc/extensions/https:/github.com/user-attachments/assets/9f309871-5fda-458f-967e-e7d3d8b269a5
3228-
31. *Image*: doc/extensions/https:/github.com/user-attachments/assets/e3c16813-2210-4b7c-9f79-2737c19c6c30
3229-
32. *Image*: doc/extensions/https:/github.com/user-attachments/assets/78aea188-59e8-4299-a375-1acc0784c7bf
3294+
5. *Image*: doc/mcp/https:/github.com/user-attachments/assets/560bddda-e48d-488b-a9f8-7b188178914c
3295+
6. *Image*: doc/mcp/https:/github.com/user-attachments/assets/1cb950da-2f7f-46e9-a623-4cc4b00cc3d0
3296+
7. *Image*: doc/mcp/https:/github.com/user-attachments/assets/131bfed2-c4e7-4e2e-ba90-c86e6ca257fd
3297+
8. *Image*: doc/mcp/https:/github.com/user-attachments/assets/befd1d44-bca3-41f6-a99a-3d15c6c8a5f5
3298+
9. *Image*: doc/extensions/https:/github.com/user-attachments/assets/47086587-d10a-4749-a5df-3a562750010e
3299+
10. *Image*: doc/extensions/https:/github.com/user-attachments/assets/dbc0d210-2ccf-49f8-b1f5-58d868dc02c8
3300+
11. *Image*: doc/extensions/https:/github.com/user-attachments/assets/201a5804-99b6-4284-9351-348899e62467
3301+
12. *Image*: doc/extensions/https:/github.com/user-attachments/assets/64708065-3428-4eb3-82a5-e32d2d1f98c6
3302+
13. *Image*: doc/extensions/https:/github.com/user-attachments/assets/131bfed2-c4e7-4e2e-ba90-c86e6ca257fd
3303+
14. *Image*: doc/extensions/https:/github.com/user-attachments/assets/befd1d44-bca3-41f6-a99a-3d15c6c8a5f5
3304+
15. *image*: doc/extensions/https:/github.com/user-attachments/assets/fb04393c-a9da-4704-884b-2810ff69f59a
3305+
16. *image*: doc/extensions/https:/github.com/user-attachments/assets/678a06a5-ada9-4bb5-8f49-6e58549c8f32
3306+
17. *Image*: doc/extensions/https:/github.com/user-attachments/assets/201a5804-99b6-4284-9351-348899e62467
3307+
18. *Image*: doc/extensions/https:/github.com/user-attachments/assets/64708065-3428-4eb3-82a5-e32d2d1f98c6
3308+
19. *Image*: doc/extensions/https:/github.com/user-attachments/assets/131bfed2-c4e7-4e2e-ba90-c86e6ca257fd
3309+
20. *Image*: doc/extensions/https:/github.com/user-attachments/assets/befd1d44-bca3-41f6-a99a-3d15c6c8a5f5
3310+
21. *Image*: doc/extensions/https:/github.com/user-attachments/assets/7c16bc7e-a9df-4afc-9736-2ee6a39919a9
3311+
22. *Image*: doc/extensions/https:/github.com/user-attachments/assets/adc556bb-7d5f-4d22-820a-a7daeb0ac72c
3312+
23. *Image*: doc/extensions/https:/github.com/user-attachments/assets/7f77bf1e-12b7-4745-a87b-40181a619733
3313+
24. *image*: doc/extensions/https:/github.com/user-attachments/assets/f67802fe-6b0c-48a5-9275-bff9f830ce29
3314+
25. *image*: doc/extensions/https:/github.com/user-attachments/assets/f90f7cc4-ff34-4481-9732-a0331a26502b
3315+
26. *image*: doc/extensions/https:/github.com/user-attachments/assets/f6bdeeec-48f7-48de-89a5-22236a52843f
3316+
27. *Image*: doc/extensions/https:/github.com/user-attachments/assets/3f4fd202-d780-441f-a8cf-58d8a8414ab1
3317+
28. *Image*: doc/extensions/https:/github.com/user-attachments/assets/5522b929-d9b1-472c-9bf8-1c14aef36dbe
3318+
29. *Image*: doc/extensions/https:/github.com/user-attachments/assets/9f309871-5fda-458f-967e-e7d3d8b269a5
3319+
30. *Image*: doc/extensions/https:/github.com/user-attachments/assets/e3c16813-2210-4b7c-9f79-2737c19c6c30
3320+
31. *Image*: doc/extensions/https:/github.com/user-attachments/assets/78aea188-59e8-4299-a375-1acc0784c7bf
32303321

32313322
Generated by panvimdoc <https://github.com/kdheepak/panvimdoc>
32323323

lua/mcphub/utils/prompt.lua

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ function M.format_custom_instructions(server_name, header)
2828
local custom_instructions = server_config.custom_instructions or {}
2929

3030
if custom_instructions.text and custom_instructions.text ~= "" and not custom_instructions.disabled then
31-
3231
return string.format(
3332
((header and header ~= "") and header or "\n\n#### Instructions for `%s` server\n\n")
3433
.. custom_instructions.text,

0 commit comments

Comments
 (0)