mcpField
S
Smithery CLI

Smithery CLI

本地服务
smithery.ai开发工具84922 周前更新

关于 Smithery CLI

Smithery CLI 是一个命令行工具,用于从终端连接、搜索和调用 MCP 服务,并管理 Skills 与身份认证。它面向需要在命令行中管理 Agent 所用 MCP 服务的开发者。

主要功能

  1. 01搜索 Smithery 注册表中的 MCP 服务
  2. 02管理 MCP 服务连接
  3. 03查找并调用已连接服务的工具
  4. 04通过 OAuth 登录与令牌管理
  5. 05发布 MCP 服务 URL 或 bundle

适用场景

  1. 01在命令行中添加并调用 GitHub 等 MCP 服务的工具
  2. 02检索已连接服务中符合需求的工具
  3. 03发布自有 MCP 服务到 Smithery 注册表

MCP 相关

Smithery CLI 作为客户端管理 MCP 服务连接,可列出、添加、移除连接,并调用其中的工具。

配置

本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。

mcp.json · 通用配置
{
"mcpServers": {
"cli-smithery-ai": {
"command": "npx",
"args": [
"-y",
"skills"
]
}
}
}
启动命令npx -y skills

本地服务需要在你的电脑上安装运行环境(如 Node.js 18+)。各客户端的配置文件位置不同,请参考客户端文档。

安装包
npmskills

工具

还没有获取到工具列表

本地服务需要在你的电脑上运行后才能读取工具,维护者暂未提供工具列表。

详细介绍

Smithery CLI NPM Version NPM Downloads

Smithery CLI 可直接通过命令行将你的 Agent 连接到数千种技能和 MCP 服务。只需运行 npx skills add smithery/cli 即可开始使用。

安装

npm install -g smithery@latest

需要 Node.js 20+。

命令

MCP 服务
smithery mcp search [term]              # Search the Smithery registry
smithery mcp add <url>                  # Add an MCP server connection
smithery mcp list                       # List your connections
smithery mcp remove <ids...>            # Remove connections
工具

与通过 smithery mcp 连接的 MCP 服务中的工具交互。

smithery tool list [connection]        # List tools from your connected MCP servers
smithery tool find [query]             # Search tools by name or intent
smithery tool get <connection> <tool>  # Show full details for one tool
smithery tool call <connection> <tool> [args]  # Call a tool
技能

浏览 Smithery Skills Registry 中的技能,并使用上游安装程序安装:

npx skills add <skill>   # e.g. npx skills add smithery-ai/cli
身份验证
smithery auth login                     # Login with Smithery (OAuth)
smithery auth logout                    # Log out
smithery auth whoami                    # Check current user
smithery auth token                     # Mint a service token
smithery auth token --policy '<json>'   # Mint a restricted token
命名空间
smithery namespace list                 # List your namespaces
smithery namespace use <name>           # Set current namespace
发布
smithery mcp publish <url> -n <org/server>          # Publish an MCP server URL
smithery mcp publish <bundle.mcpb> -n <org/server>  # Publish an MCP bundle

示例

# Search and connect to an MCP server
smithery mcp search "github"
smithery mcp add github --id github

# Find and call tools from your connected MCP servers
smithery tool find "create issue"
smithery tool call github create_issue '{"title":"Bug fix","body":"..."}'

# Browse and install skills
smithery skill search "frontend" --json --page 2
smithery skill add anthropics/frontend-design --agent claude-code

# Publish your MCP server URL
smithery mcp publish https://my-mcp-server.com -n myorg/my-server

# Publish a built MCP bundle
smithery mcp publish ./server.mcpb -n myorg/my-server

开发

git clone https://github.com/smithery-ai/cli
cd cli && pnpm install && pnpm run build
npx . --help

贡献

欢迎贡献!请提交 Pull Request。

评论

支持 Markdown

第一次接触 MCP?

从协议是什么,到在客户端里装上第一个服务,这几条回答覆盖了大多数入门问题。

一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。