You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

向VS Code添加MCP服务器时遇"Cannot read properties of undefined (reading 'inputs')"错误

解决VS Code安装MCP服务器时出现「Cannot read properties of undefined (reading 'inputs')」错误

问题场景

  • 访问VS Code MCP服务器页面,选择任意一款服务器后在VS Code内打开对应页面
  • 点击「安装」按钮,随即弹出错误提示:Cannot read properties of undefined (reading 'inputs')
  • 官网提供的所有MCP服务器均存在此问题,且VS Code用户目录与工作区中的mcp.json文件均为空

修复方案

1. 清理VS Code缓存

关闭VS Code,删除以下缓存目录后重启:

  • Windows:%APPDATA%\Code\Cache、%APPDATA%\Code\CachedData
  • macOS:~/Library/Caches/Code、~/Library/Application Support/Code/CachedData
  • Linux:~/.cache/Code、~/.config/Code/CachedData

2. 手动初始化mcp.json文件

在VS Code用户配置目录(Windows:%APPDATA%\Code\User;macOS:~/Library/Application Support/Code/User;Linux:~/.config/Code/User)或当前工作区根目录,创建/编辑mcp.json文件,写入基础结构:

{
  "servers": []
}

保存后重启VS Code,再尝试安装MCP服务器。

3. 更新VS Code至最新版本

通过「帮助」-「检查更新」安装VS Code最新版本,旧版本可能存在MCP模块的兼容性问题。

4. 排查扩展冲突

临时禁用所有第三方扩展(扩展面板右上角选择「禁用所有已安装扩展」),重启VS Code后重试安装操作,确认是否是第三方扩展干扰导致的错误。

内容的提问来源于stack exchange,提问作者Ian Vaughan

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.12 16:19:54