Back to MCP directory
publicPublicdnsLocal runtime

cli

Smithery CLI是一个用于管理Model Context Protocol (MCP)服务器的命令行工具,支持多种AI客户端,提供安装、卸载、查看和运行MCP服务器的功能。

article

README

🚀 Smithery CLI

Smithery CLI 是一款用于 Model Context Protocol (MCP) 服务器的注册表安装程序和管理器,它在设计上与客户端无关,能为用户提供便捷的 MCP 服务器管理体验。

🚀 快速开始

要求

  • NodeJS 版本要求:18 或更高

基本使用

npx @smithery/cli <command>

✨ 主要特性

  • 支持多种命令,涵盖安装、卸载、检查、运行服务器等操作。
  • 可指定 AI 客户端,满足不同客户端的使用需求。
  • 能提供 JSON 格式的配置数据,跳过提示步骤。
  • 支持详细日志显示,方便调试。

📦 安装指南

无需额外安装步骤,直接使用 npx 命令调用即可。

💻 使用示例

基础用法

# 安装一个服务器(需要 --client 标志)
npx @smithery/cli install mcp-obsidian --client claude

# 列出可用客户端
npx @smithery/cli list clients

高级用法

# 使用预配置数据安装一个服务器(跳过提示)
npx @smithery/cli install mcp-obsidian --client claude --config '{"vaultPath":"path/to/vault"}'

# 使用配置运行服务器
npx @smithery/cli run mcp-obsidian --config '"{\\"key\\":\\"value\\"}"'

可用命令

| 命令 | 说明 | 参数 | | ---- | ---- | ---- | | install <package> | 安装一个包 | --client <name>:指定 AI 客户端;--config <json>:提供 JSON 格式的配置数据(跳过提示) | | uninstall <package> | 卸载一个包 | --client <name>:指定 AI 客户端 | | inspect <server-id> | 交互式检查服务器 | 无 | | run <server-id> | 运行服务器 | --config <json>:提供服务器配置 | | list clients | 列出可用客户端 | 无 | | list servers --client <name> | 列出特定 AI 客户端的已安装服务器 | --client <name>:指定 AI 客户端 | | --help | 显示帮助信息 | 无 | | --verbose | 显示详细日志以进行调试 | 无 |

重要注意事项

⚠️ 重要提示

  • 安装或卸载服务器后请记得重新启动 AI 客户端。
  • 使用 inspect 命令进行交互式服务器测试。
  • 不带参数运行以显示帮助菜单。
  • 使用 --verbose 标志查看更多调试信息。

📚 详细文档

开发指南

本指南将帮助您开始 @smithery/cli 的开发。

入门

  1. 克隆仓库:

    git clone https://github.com/smithery-ai/cli
    cd cli
    
  2. 安装依赖项:

    npm install
    
  3. 构建项目:

    npm run build
    

开发命令

# 列出所有服务器
npx . list servers

# 检查特定服务器
npx . inspect <server-id>

# 安装一个服务器
npx . install <server-name> --client <client-name>

# 使用详细日志运行
npx . <command> --verbose

🤝 贡献

欢迎贡献!请随时提交 Pull Request。

help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client