return { "olimorris/codecompanion.nvim", dependencies = { "nvim-lua/plenary.nvim", "nvim-treesitter/nvim-treesitter", { "ravitemer/mcphub.nvim", dependencies = { "nvim-lua/plenary.nvim", }, build = "npm install -g mcp-hub@latest", config = function() require("mcphub").setup() end, }, }, opts = { opts = { log_level = "DEBUG", -- or "TRACE" }, extensions = { mcphub = { callback = "mcphub.extensions.codecompanion", opts = { make_tools = true, -- Make individual tools (@server__tool) and server groups (@server) from MCP servers show_server_tools_in_chat = true, -- Show individual tools in chat completion (when make_tools=true) add_mcp_prefix_to_tool_names = false, -- Add mcp__ prefix (e.g `@mcp__github`, `@mcp__neovim__list_issues`) show_result_in_chat = true, -- Show tool results directly in chat buffer format_tool = nil, -- function(tool_name:string, tool: CodeCompanion.Agent.Tool) : string Function to format tool names to show in the chat buffer -- MCP Resources make_vars = true, -- Convert MCP resources to #variables for prompts -- MCP Prompts make_slash_commands = true, -- Add MCP prompts as /slash commands }, }, }, strategies = { chat = { adapter = "scbt", tools = { opts = { auto_submit_errors = true, -- Send any errors to the LLM automatically? auto_submit_success = true, -- Send any successful output to the LLM automatically? default_tools = { "full_stack_dev", "mcp", "filesystem", }, }, opts = { system_promt = "Ты полезный ассистент в редакторе neovim в плагине codecompanion. Основной зык программирования - go. Отвечай всегда на русском языке.", }, }, }, inline = { adapter = "scbt", }, }, memory = { opts = { chat = { enabled = true, }, }, }, adapters = { http = { scbt = function() return require("codecompanion.adapters").extend("openai_compatible", { env = { api_key = "cmd: age -d -i ~/.ssh/id_ed25519 ~/.openai-api-key.age", url = "http://localhost:8888/api", }, schema = { model = { default = "qwen3-235b-it", choices = { "qwen3-235b-it", "Qwen3-Coder-30B-A3B-Instruct-FP8", "qwen2-5-coder-1-5b", }, num_ctx = { default = 120000, }, think = { default = true, }, keep_alive = { default = "5m", }, }, }, }) end, }, }, }, }