﻿---
title: "安装 smart-vs-mcp 插件"
summary: "从 Al3xisDani3l/smart-vs-mcp 添加插件源，安装后自动登记 vs-mcp-smart stdio 服务。指定分支使用 --ref。"
category: mcp
level: starter
surfaces: [cli, app, ide]
tags: ["MCP", "Visual Studio", "插件", "stdio"]
canonical: /tips/smart-vs-mcp-codex-plugin/
---

# 安装 smart-vs-mcp 插件

从 Al3xisDani3l/smart-vs-mcp 添加插件源，安装后自动登记 vs-mcp-smart stdio 服务。指定分支使用 --ref。

smart-vs-mcp 用 marketplace add Al3xisDani3l/smart-vs-mcp，@ 是 marketplace 名不是 npm 标签。源代码仓库给 Codex CLI 单独写了安装页：先登记 marketplace，再装插件。这是把 Visual Studio 的 VS-MCP HTTP 端点收成一台全局 stdio 包装，按当前解去读 `.mcp/mcpserver.settings.json`，不要在 `config.toml` 里写死端口。

```bash
codex plugin marketplace add Al3xisDani3l/smart-vs-mcp
codex plugin add smart-vs-mcp
codex plugin list
```

`.agents/plugins/marketplace.json` 和 `.claude-plugin/marketplace.json` 的 name 都是 `smart-vs-mcp-dev`，插件 name 是 `smart-vs-mcp`。Codex 的 `@` 左边是插件、右边是已经登记过的 marketplace 名，所以 `smart-vs-mcp@smart-vs-mcp-dev` 表示从这份清单装插件，不是 npm dist-tag，也不是 Git 分支。清单快照没刷新时：

```bash
codex plugin marketplace upgrade smart-vs-mcp-dev
codex plugin add smart-vs-mcp --marketplace smart-vs-mcp-dev
```

以 `codex plugin marketplace list` 为准；安装排查页还写过 `Al3xisDani3l-smart-vs-mcp` 这个升级名。

要钉 `smart-vs-mcp-dev` 分支，把 ref 写在 marketplace add 上：

```bash
codex plugin marketplace add Al3xisDani3l/smart-vs-mcp --ref smart-vs-mcp-dev
codex plugin add smart-vs-mcp
```

插件 `.mcp.json` 表名是 `vs-mcp-smart`，命令是 `npx -y @al3xisdani3l/smart-vs-mcp`。已经装了插件就不要再 `mcp add` 重复的服务配置。只要 stdio、不装插件才：

```bash
codex mcp add vs-mcp-smart -- npx -y @al3xisdani3l/smart-vs-mcp
```

```toml
[mcp_servers.vs-mcp-smart]
command = "npx"
args = ["-y", "@al3xisdani3l/smart-vs-mcp"]
```

stdio，不要 `mcp login`。解根放 `.mcp/mcpserver.settings.json`（或 `.mcpserver.settings.json`），示例字段是 `port` / `host` / `scheme`。Visual Studio 和它的 MCP 扩展要先在这个解上跑起来。诊断：

```bash
npx -y @al3xisdani3l/smart-vs-mcp doctor --workspace C:\Repos\YourSolution
```

包装模式诊断打 stderr，stdout 只走 MCP JSON-RPC。连上之后优先用 VS-MCP 的符号和调用图工具，缺工具先 `doctor` 再退回 Grep。

0.154 起可先检查当前会话；未显示插件时再新开会话。桌面改 marketplace 后彻底退出再开。IDE 扩展没有 `/plugins`，用 CLI 加完再到 TUI 或桌面去装。网页 Cloud 不读取本机 `CODEX_HOME`。



## 来源

- [Installing smart-vs-mcp for Codex CLI](https://github.com/Al3xisDani3l/smart-vs-mcp/blob/main/docs/install-codex.md)
- [Al3xisDani3l/smart-vs-mcp](https://github.com/Al3xisDani3l/smart-vs-mcp)
- [smart-vs-mcp skill](https://github.com/Al3xisDani3l/smart-vs-mcp/blob/main/skills/smart-vs-mcp/SKILL.md)
