From 3f4ec1b6d308fffcfc700febc2b9a61da7f06b46 Mon Sep 17 00:00:00 2001 From: Joao P Dubas Date: Wed, 28 May 2025 18:03:26 +0000 Subject: [PATCH] feat(neovim): enable `mcphub` in `avante` --- config/nvim/lua/custom/plugins/init.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/config/nvim/lua/custom/plugins/init.lua b/config/nvim/lua/custom/plugins/init.lua index 1e26fa9..7c32d34 100644 --- a/config/nvim/lua/custom/plugins/init.lua +++ b/config/nvim/lua/custom/plugins/init.lua @@ -441,8 +441,19 @@ return { reverse_switch_windows = '', }, }, + -- 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 + custom_tools = function() + return { + require('mcphub.extensions.avante').mcp_tool(), + } + end, hints = { enabled = true }, provider = 'gemini-pro', + -- The system_prompt type supports both a string and a function that returns a string. Using a function here allows dynamically updating the prompt with `mcphub` + system_prompt = function() + local hub = require('mcphub').get_hub_instance() + return hub and hub:get_active_servers_prompt() or '' + end, vendors = { ['gemini-pro'] = { __inherited_from = 'gemini',