feat(mcp): add mcps to avante

This commit is contained in:
2025-06-19 17:32:56 +02:00
parent 44a4fbf4fa
commit 5396444511
2 changed files with 26 additions and 1 deletions

View File

@@ -3,7 +3,6 @@ return {
event = "VeryLazy",
lazy = false,
config = function(_, opts)
-- Let the plugin load first
require("avante").setup(opts)
-- Then remove the default mappings
vim.schedule(function()
@@ -31,6 +30,16 @@ return {
-- max_tokens = 4096,
},
},
system_prompt = function()
local hub = require("mcphub").get_hub_instance()
return hub and hub:get_active_servers_prompt() or ""
end,
-- Using function prevents requiring mcphub before it's loaded
custom_tools = function()
return {
require("mcphub.extensions.avante").mcp_tool(),
}
end,
},
build = "make",
keys = {

View File

@@ -0,0 +1,16 @@
return {
"ravitemer/mcphub.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
},
build = "npm install -g mcp-hub@latest", -- Installs `mcp-hub` node binary globally
config = function()
require("mcphub").setup({
extensions = {
avante = {
make_slash_commands = true,
},
},
})
end,
}