diff --git a/lua/taken/plugins/avante.lua b/lua/taken/plugins/avante.lua index f92edb1..38338b5 100644 --- a/lua/taken/plugins/avante.lua +++ b/lua/taken/plugins/avante.lua @@ -12,6 +12,7 @@ return { "nvim-telescope/telescope.nvim", "nvim-tree/nvim-web-devicons", "zbirenbaum/copilot.lua", + "ravitemer/mcphub.nvim", }, config = function() require("avante").setup({ @@ -23,6 +24,15 @@ return { temperature = 0, max_tokens = 8192, }, + system_prompt = function() + local hub = require("mcphub").get_hub_instance() + return hub:get_active_servers_prompt() + end, + custom_tools = function() + return { + require("mcphub.extensions.avante").mcp_tool(), + } + end, }) end, } diff --git a/lua/taken/plugins/mcphub.lua b/lua/taken/plugins/mcphub.lua new file mode 100644 index 0000000..466c242 --- /dev/null +++ b/lua/taken/plugins/mcphub.lua @@ -0,0 +1,27 @@ +--- @type LazyPluginSpec +return { + "ravitemer/mcphub.nvim", + dependencies = { + "nvim-lua/plenary.nvim", + }, + cmd = "MCPHub", + -- build = "npm install -g mcp-hub@latest", + build = "bundled_build.lua", + init = function() + local mcphublocation = vim.fn.expand("~/.config/mcphub") + + if vim.fn.isdirectory(mcphublocation) == 0 then + vim.fn.system("mkdir -p " .. mcphublocation) + end + end, + config = function() + require("mcphub").setup({ + extensions = { + avante = { + make_slash_commands = true, + }, + }, + use_bundled_binary = true, + }) + end, +}