-
The use case is: run 2 Neovim in two different project root directories, then ask LLM to run Right now both Neovim instances will share same mcp-hub process, and both will run At a glance there should be a way to either avoid sharing mcp-hub processes for Neovim running in different directories or send Neovim's current working directory to mcp-hub with each request and ensure mcp-hub uses given directory as a current directory for all MCP servers. The last case looks more complicated and anyway will result in running multiple copies of local MCP servers (one per each unique Neovim working directory) to ensure these servers won't act on wrong directory (just in case they do anything with local files). So, how to handle this?
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
Here is a quick workaround. Still possible to get a conflict between directories, but now with 1/1000 probability instead of 1/1 guarantee. 😄 {
'ravitemer/mcphub.nvim',
-- ...
config = function()
-- Try to avoid sharing mcp-hub instance between directories.
local cwd_hash = string.sub(vim.fn.sha256(vim.fn.getcwd()), 1, 4)
require('mcphub').setup {
port = 13000 + tonumber(cwd_hash, 16) % 1000, -- Use ports 13000-13999.
-- ...
}
end,
} |
Beta Was this translation helpful? Give feedback.
-
Working on this! |
Beta Was this translation helpful? Give feedback.
-
@powerman This should be fixed in v6.0.0. Please refer to #206 announcement and https://ravitemer.github.io/mcphub.nvim/workspace.html page Thanks for the suggestions! |
Beta Was this translation helpful? Give feedback.
@powerman This should be fixed in v6.0.0. Please refer to #206 announcement and https://ravitemer.github.io/mcphub.nvim/workspace.html page
Thanks for the suggestions!