Skip to content

Commit 68382a1

Browse files
YorizelUzaaft
andauthored
feat(editing-support): Add mcphub.nvim (#1401)
* Create init.lua * Create README.md * Update README.md * Update init.lua * Update init.lua * Update lua/astrocommunity/editing-support/mcphub-nvim/README.md * Update lua/astrocommunity/editing-support/mcphub-nvim/init.lua * Update lua/astrocommunity/editing-support/mcphub-nvim/init.lua * Update lua/astrocommunity/editing-support/mcphub-nvim/README.md * feat: Move over to opts syntax, and format code * Making sure it loads on file enter --------- Co-authored-by: Uzair Aftab <[email protected]>
1 parent 581fae4 commit 68382a1

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Mcphub.nvim
2+
3+
A powerful Neovim plugin for managing MCP (Model Context Protocol) servers
4+
5+
_Note_: This plugin requires [mcp-hub](https://www.npmjs.com/package/mcp-hub) to be installed. This can be done with `npm`, `bun`, `yarn`, or `pnpm`.
6+
7+
**Repository:** <https://github.com/ravitemer/mcphub.nvim/tree/main>
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
return {
2+
"ravitemer/mcphub.nvim",
3+
dependencies = {
4+
"nvim-lua/plenary.nvim", -- Required for Job and HTTP requests
5+
},
6+
event = "User AstroFile",
7+
cmd = "MCPHub",
8+
opts = {
9+
port = 3000,
10+
config = vim.fn.expand "~/mcpservers.json",
11+
log = {
12+
level = vim.log.levels.WARN,
13+
to_file = false,
14+
file_path = nil,
15+
prefix = "MCPHub",
16+
},
17+
},
18+
specs = {
19+
{
20+
"yetone/avante.nvim",
21+
optional = true,
22+
opts = {
23+
system_prompt = function()
24+
local hub = require("mcphub").get_hub_instance()
25+
return hub:get_active_servers_prompt()
26+
end,
27+
-- The custom_tools type supports both a list and a function that returns a list. Using a function here prevents requiring mcphub before it's loaded
28+
custom_tools = function()
29+
return {
30+
require("mcphub.extensions.avante").mcp_tool(),
31+
}
32+
end,
33+
},
34+
},
35+
},
36+
}

0 commit comments

Comments
 (0)