Skip to main content
Glama

用于 Antigravity 的 NVM MCP 服务器

一个封装了 NVM (Node Version Manager) 的 MCP 服务器,让 Antigravity 智能体能够完全控制 Node.js 版本,而无需在 $PATH 中预先配置 Node 或 npm。

为什么需要它

Antigravity 智能体在非交互式子进程中运行,且不会加载你 shell 的 .zshrc / .bashrc。由于 NVM 仅在交互式 shell 中将 Node 添加到 $PATH,因此智能体无法找到 nodenpm。此服务器在执行每个命令前直接加载 nvm.sh,从而彻底绕过了 $PATH 问题。


Related MCP server: Pare

要求

  • Python 3.10+

  • NVM 安装在 ~/.nvm(或在配置中设置 NVM_DIR

  • pip install mcp(或 pip install -r requirements.txt


安装

# 1. Clone / copy this folder somewhere permanent
cp -r nvm-mcp-server ~/.nvm-mcp-server

# 2. Install the one dependency
pip install -r ~/.nvm-mcp-server/requirements.txt
# Or, if you prefer a venv:
python3 -m venv ~/.nvm-mcp-server/.venv
~/.nvm-mcp-server/.venv/bin/pip install mcp

Antigravity 配置

打开(或创建)~/.gemini/antigravity/mcp_config.json 并添加:

{
  "mcpServers": {
    "nvm-manager": {
      "command": "python3",
      "args": ["/Users/YOUR_USERNAME/.nvm-mcp-server/nvm_server.py"],
      "env": {
        "NVM_DIR": "/Users/YOUR_USERNAME/.nvm"
      }
    }
  }
}

Venv 用户:"python3" 替换为 venv Python 的绝对路径, 例如 "/Users/YOUR_USERNAME/.nvm-mcp-server/.venv/bin/python3"

保存配置后重启 Antigravity。nvm-manager 服务器将出现在 MCP 服务器列表中。


可用工具

工具

功能

nvm_list

列出所有本地安装的 Node 版本

nvm_list_remote

列出可安装的版本(接受过滤器:'lts''22' 等)

nvm_install

下载并安装一个版本('22''lts''lts/iron''20.11.0'

nvm_use

切换会话激活版本 — 对后续所有调用持久生效

nvm_current

显示当前会话中激活的版本

nvm_alias

设置 NVM 别名,例如将 default 指向一个新版本

node_run

使用激活的(或指定的)版本运行 node <args>

npm_run

使用激活的(或指定的)版本运行 npm <args>

npx_run

使用激活的(或指定的)版本运行 npx <args>

所有三个运行工具都接受一个可选的 version 字段(用于覆盖该次调用的会话激活版本)和一个可选的 cwd 字段。


智能体工作流示例

Agent: nvm_list           → sees v20.11.0 and v22.3.0 installed
Agent: nvm_use "22"       → session set to Node 22
Agent: npm_run "install"  → runs npm install under Node 22
Agent: node_run "index.js" → runs the script under Node 22

# Need a version that isn't installed yet?
Agent: nvm_install "lts"  → downloads latest LTS
Agent: nvm_use "lts"      → switches to it
Agent: nvm_alias "default" "lts"  → makes it the permanent default

自定义 NVM 位置

如果 NVM 安装在 ~/.nvm 之外的位置,请在 mcp_config.jsonenv 块中设置 NVM_DIR

"env": {
  "NVM_DIR": "/opt/homebrew/opt/nvm"
}

故障排除

症状

修复方法

nvm.sh not found

验证 env 块中的 NVM_DIR 是否指向你的 NVM 根目录

nvm_install 超时

增加 nvm_server.py 中的子进程超时时间(默认 300 秒)

未找到版本

运行 nvm_list_remote 以检查确切的版本字符串

服务器未显示

检查 Antigravity → ... → MCP 服务器以查看错误消息

F
license - not found
Not graded
quality - not tested
D
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    B
    quality
    D
    maintenance
    Custom MCP server for n8n automation, providing 27 tools to manage workflows, executions, credentials, variables, and more via the n8n REST API. Designed to fix compatibility issues with Antigravity AI assistant.
    27
    63
    14
    MIT
  • A
    license
    Not graded
    quality
    A
    maintenance
    Provides MCP servers that wrap common developer tools (git, npm, docker, etc.) returning structured JSON output, enabling AI agents to reliably interact with these tools without parsing fragile terminal text.
    4
    137
    MIT
  • A
    license
    A
    quality
    A
    maintenance
    An MCP server that bridges Claude Code with Antigravity CLI using a Swarm Agent architecture to optimize local development workflows and minimize LLM token costs. Includes a web UI for monitoring agent workflows.
    21
    17
    MIT
  • F
    license
    Not graded
    quality
    B
    maintenance
    A lightweight Node.js MCP server with zero dependencies offering 9 built-in tools for system info, web fetching, GitHub search, file operations, shell execution, and key-value memory, enabling AI agents to perform these tasks via the Model Context Protocol.

View all related MCP servers

Related MCP Connectors

  • A MCP server built for developers enabling Git based project management with project and personal…

  • The MCP server for Azure DevOps, bringing the power of Azure DevOps directly to your agents.

  • Personal assistant MCP server with search, execute, packages, jobs, secrets, and integrations.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/realjacoblinder/nvm-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server