Skip to content

Commit 781d43d

Browse files
committed
chore(release): v5.2.0
1 parent ea3190a commit 781d43d

File tree

2 files changed

+97
-43
lines changed

2 files changed

+97
-43
lines changed

CHANGELOG.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,27 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
9+
10+
## [5.2.0] - 2025-05-06
11+
12+
### Added
13+
- Support for `$: cmd arg1 arg2` syntax in env config to execute shell commands to resolve env values
14+
- E.g
15+
16+
```json
17+
{
18+
"command": "npx",
19+
"args": [
20+
"-y",
21+
"@modelcontextprotocol/server-everything"
22+
],
23+
"env": {
24+
"MY_ENV_VAR": "$: cmd:op read op://mysecret/myenvvar"
25+
}
26+
}
27+
```
28+
829
## [5.1.0] - 2025-05-06
930

1031
### Changed

doc/mcphub.txt

Lines changed: 76 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
*mcphub.nvim.txt* For NVIM v0.10.0 Last change: 2025 May 03
1+
*mcphub.nvim.txt* For NVIM v0.10.0 Last change: 2025 May 06
22

33
==============================================================================
44
Table of Contents *mcphub.nvim-table-of-contents*
55

66
1. MCP Hub |mcphub.nvim-mcp-hub|
77
- ✨ Features & Support Status|mcphub.nvim-mcp-hub-✨-features-&-support-status|
88
- 📦 Installation |mcphub.nvim-mcp-hub-📦-installation|
9+
- Nix |mcphub.nvim-mcp-hub-nix|
910
- 🚀 Usage |mcphub.nvim-mcp-hub-🚀-usage|
1011
- 🔌 Extensions |mcphub.nvim-mcp-hub-🔌-extensions|
1112
- 🎉Lua Native MCP Servers (detailed guide)|mcphub.nvim-mcp-hub-🎉lua-native-mcp-servers-(detailed-guide)|
@@ -278,12 +279,7 @@ with all available options:
278279
extensions = {
279280
avante = {
280281
make_slash_commands = true, -- make /slash commands from MCP server prompts
281-
},
282-
codecompanion = {
283-
show_result_in_chat = true, -- Show the mcp tool result in the chat buffer
284-
make_vars = true, -- make chat #variables from MCP server resources
285-
make_slash_commands = true, -- make /slash commands from MCP server prompts
286-
},
282+
}
287283
},
288284

289285

@@ -347,6 +343,7 @@ EXAMPLE CONFIGURATION
347343
"env": {
348344
"API_KEY": "", // Falls back to process.env.API_KEY
349345
"SERVER_URL": null, // Falls back to process.env.SERVER_URL
346+
"OP_KEY": "$: cmd:op read op://example/secret", // use $: at the beginning to indicate that this is a command
350347
"AUTH_HEADER": "BEARER ${API_KEY}", // ${API_KEY} is replaced with resolved value of API_KEY in the env field falling back to process.env
351348
"DEBUG": "true" // Direct value, no fallback
352349
}
@@ -373,6 +370,7 @@ MCP SERVERS CONFIG
373370
- `env`: Optional environment variables. Special values:
374371
- `""` (empty string): Falls back to process.env.[VAR_NAME]
375372
- `null`: Falls back to process.env.[VAR_NAME]
373+
- `$:` values that start with `$:` are executed as shell commands e.g to use op cli `$: cmd:op read op://personal/secret`
376374
- `${ENV_VAR}`: Replaces with the resolved value of ENV_VAR in the env field, falling back to process.env
377375
- Any other value is used as-is
378376
- Remote Servers: (Supports `streamable-http`, `sse` with `OAuth`)
@@ -382,6 +380,60 @@ MCP SERVERS CONFIG
382380
- There are other plugin specific options for each server like `disabled`, `disabled_tools`, `custom_instructions` etc which can be easily updated from the UI.
383381

384382

383+
NIX *mcphub.nvim-mcp-hub-nix*
384+
385+
Nixpkgs install ~
386+
387+
388+
coming…
389+
Flake install ~
390+
391+
Just add it to your NixOS flake.nix or home-manager:
392+
393+
>nix
394+
inputs = {
395+
mcphub-nvim.url = "github:ravitemer/mcphub.nvim";
396+
...
397+
}
398+
<
399+
400+
To integrate mcphub.nvim to your NixOS/Home Manager nvim configs, add the
401+
following to your neovim.plugins
402+
<https://nixos.wiki/wiki/Neovim#Installing_Plugins> or your neovim.packages
403+
<https://nixos.wiki/wiki/Neovim#System-wide_2>
404+
405+
>nix
406+
inputs.mcphub-nvim.packages."${system}".default
407+
<
408+
409+
and add the setup function in lua code
410+
<https://nixos.wiki/wiki/Neovim#Note_on_Lua_plugins>
411+
412+
413+
NIXVIM EXAMPLE ~
414+
415+
Nixvim <https://github.com/nix-community/nixvim> example:
416+
417+
>nix
418+
{ mcphub-nvim, ... }:
419+
{
420+
extraPlugins = [mcphub-nvim];
421+
extraConfigLua = ''
422+
require("mcphub").setup()
423+
'';
424+
}
425+
426+
# where
427+
{
428+
# For nixpkgs (not available yet)
429+
# ...
430+
431+
# For flakes
432+
mcphub-nvim = inputs.mcphub-nvim.packages."${system}".default;
433+
}
434+
<
435+
436+
385437
🚀 USAGE *mcphub.nvim-mcp-hub-🚀-usage*
386438

387439
Open the MCPHub UI to manage servers, test tools and monitor status:
@@ -507,58 +559,39 @@ Add MCP capabilities to CodeCompanion.
507559

508560
Set `config.auto_approve = true` or `vim.g.mcphub_auto_approve = true` to
509561
automatically approve tool requests.
562+
- Type @mcp in the chat (once submitted, it will add available MCP Servers to the system prompts and adds a tool so that the LLM can call tools, resources on MCP Servers etc)
563+
510564

511565
Set `make_vars = true` to show resources as #variables in the chat buffer
512566

513567
Set `make_slash_commands = true` to show prompts as /slash_commands in the chat
514568
buffer
515-
- Type @mcp in the chat (once submitted, it will add available MCP Servers to the
516-
system prompts and adds a tool so that the LLM can call tools, resources on MCP
517-
Servers etc)
518-
- Server prompts become available as `/mcp:prompt_name` slash commands in chat
519-
(_Currently very few servers provide prompts, but you can add your own using
520-
mcphub.add_prompt_)
521-
- Prompts with arguments are handled using vim.ui.input (cancelling input for
522-
required arguments will abort the slash command)
523-
- If the last message from the `/mcp:prompt_name` message is of `user` role, it
524-
will be added to the chat buffer.
525-
- Whenever the servers are updated, the variables and slash_commands will also be
526-
updated in realtime
527-
- E.g LSP current file diagnostics
569+
- Server prompts become available as `/mcp:prompt_name` slash commands in chat (_Currently very few servers provide prompts, but you can add your own using mcphub.add_prompt_)
570+
- Prompts with arguments are handled using vim.ui.input (cancelling input for required arguments will abort the slash command)
571+
- If the last message from the `/mcp:prompt_name` message is of `user` role, it will be added to the chat buffer.
528572

529573

530574
Set `show_result_in_chat = true` to view the mcp tool call result in the chat
531575
buffer.
532-
>lua
533-
534-
require("mcphub").setup({
535-
extensions = {
536-
codecompanion = {
537-
-- Show the mcp tool result in the chat buffer
538-
show_result_in_chat = true,
539-
make_vars = true, -- make chat #variables from MCP server resources
540-
make_slash_commands = true, -- make /slash_commands from MCP server prompts
541-
},
542-
}
543-
})
544-
<
545-
546576
>lua
547577
require("codecompanion").setup({
548-
strategies = {
549-
chat = {
550-
tools = {
551-
["mcp"] = {
552-
-- calling it in a function would prevent mcphub from being loaded before it's needed
553-
callback = function() return require("mcphub.extensions.codecompanion") end,
554-
description = "Call tools and resources from the MCP Servers",
555-
}
556-
}
578+
extensions = {
579+
mcphub = {
580+
callback = "mcphub.extensions.codecompanion",
581+
opts = {
582+
show_result_in_chat = true, -- Show the mcp tool result in the chat buffer
583+
make_vars = true, -- make chat #variables from MCP server resources
584+
make_slash_commands = true, -- make /slash_commands from MCP server prompts
585+
},
557586
}
558587
}
559588
})
560589
<
561590

591+
- Whenever the servers are updated, the variables and slash_commands will also be
592+
updated in realtime
593+
- E.g LSP current file diagnostics
594+
562595

563596
LUALINE ~
564597

0 commit comments

Comments
 (0)