$npx -y skills add smithery-ai/cli --skill smithery-ai-cliFind, connect, and use MCP tools and skills via the Smithery CLI. Use when the user searches for new tools or skills, wants to discover integrations, connect to an MCP, install a skill, or wants to interact with an external service (email, Slack, Discord, GitHub, Jira, Notion, da
| 1 | # Smithery |
| 2 | |
| 3 | The marketplace for AI agents. Connect to 100K+ tools and skills instantly. |
| 4 | |
| 5 | Use `smithery --help` and `<command> --help` for flags, arguments, and full examples. |
| 6 | This skill focuses on concepts and canonical workflows. |
| 7 | |
| 8 | ## Quick Start |
| 9 | |
| 10 | ```bash |
| 11 | # 1. Install |
| 12 | npm install -g @smithery/cli |
| 13 | |
| 14 | # 2. Authenticate (requires human to confirm in browser) |
| 15 | smithery auth login |
| 16 | |
| 17 | # 3. Search for MCP servers |
| 18 | smithery mcp search "github" |
| 19 | |
| 20 | # 4. Connect to a server (URL or qualified name both work) |
| 21 | smithery mcp add "https://github.run.tools" --id github |
| 22 | |
| 23 | # 5. Browse tools (tree view — drill into groups by passing the prefix) |
| 24 | smithery tool list github |
| 25 | smithery tool list github issues. |
| 26 | |
| 27 | # 6. Inspect tool input/output JSON schema |
| 28 | smithery tool get github issues.create |
| 29 | |
| 30 | # 7. Call a tool |
| 31 | smithery tool call github issues.create '{"repo": "owner/repo", "title": "Bug"}' |
| 32 | ``` |
| 33 | |
| 34 | ## Core Concepts |
| 35 | |
| 36 | ### [Namespaces](https://smithery.ai/docs/concepts/namespaces.md) |
| 37 | |
| 38 | A namespace is the workspace boundary for Smithery resources. Servers, connections, and skills all live in a namespace. |
| 39 | Use one namespace per app/environment (for example, `my-app-dev`, `my-app-prod`), then set it as your active context. |
| 40 | Canonical flow: |
| 41 | |
| 42 | ```bash |
| 43 | smithery namespace list |
| 44 | smithery namespace create my-app-prod |
| 45 | smithery namespace use my-app-prod |
| 46 | ``` |
| 47 | |
| 48 | For namespace-specific flags and overrides, run `smithery namespace --help` and `smithery mcp --help`. |
| 49 | |
| 50 | ### [Connect (MCP Connections)](https://smithery.ai/docs/use/connect.md) |
| 51 | |
| 52 | A connection is a managed, long-lived MCP session. |
| 53 | Smithery Connect handles OAuth flow, credential storage, token refresh, and session lifecycle. |
| 54 | Connection status model: |
| 55 | - `connected`: ready to list/call tools |
| 56 | - `auth_required`: human must open authorization URL |
| 57 | - `error`: inspect details and retry/fix config |
| 58 | |
| 59 | Canonical flow (single user-scoped connection): |
| 60 | |
| 61 | ```bash |
| 62 | smithery mcp add https://github.run.tools \ |
| 63 | --id user-123-github \ |
| 64 | --metadata '{"userId":"user-123"}' |
| 65 | |
| 66 | smithery mcp list --metadata '{"userId":"user-123"}' |
| 67 | smithery tool list user-123-github |
| 68 | ``` |
| 69 | |
| 70 | If CLI shows `auth_required`, tell your human to open the URL and then retry. |
| 71 | |
| 72 | ### [Token Scoping](https://smithery.ai/docs/use/token-scoping.md) |
| 73 | |
| 74 | Service tokens are restricted credentials for browser/mobile/agent usage. |
| 75 | Never pass a full API key to untrusted code. |
| 76 | Policy mental model: |
| 77 | - A token policy is one or more constraints |
| 78 | - In the CLI, pass one JSON object per `--policy` flag |
| 79 | - Fields inside one constraint are AND-ed (more fields = narrower) |
| 80 | - Lists and multiple constraints are OR-ed (more entries = wider) |
| 81 | |
| 82 | Canonical user-scoped token: |
| 83 | |
| 84 | ```bash |
| 85 | smithery auth token --policy '{ |
| 86 | "namespaces": "my-app", |
| 87 | "resources": "connections", |
| 88 | "operations": ["read", "execute"], |
| 89 | "metadata": { "userId": "user-123" }, |
| 90 | "ttl": "1h" |
| 91 | }' |
| 92 | ``` |
| 93 | |
| 94 | ### Request-level Tool Restrictions (`rpcReqMatch`, experimental) |
| 95 | |
| 96 | Use `rpcReqMatch` to restrict specific MCP JSON-RPC requests (regex by request path). |
| 97 | Important: connection IDs are not in the JSON-RPC body, so combine: |
| 98 | - `metadata` for connection-level restriction |
| 99 | - `rpcReqMatch` for method/tool restriction |
| 100 | |
| 101 | Canonical combined restriction: |
| 102 | |
| 103 | ```bash |
| 104 | smithery auth token --policy '{ |
| 105 | "resources": "connections", |
| 106 | "operations": "execute", |
| 107 | "metadata": { "connectionId": "my-github" }, |
| 108 | "rpcReqMatch": { |
| 109 | "method": "tools/call", |
| 110 | "params.name": "^issues\\." |
| 111 | }, |
| 112 | "ttl": "30m" |
| 113 | }' |
| 114 | ``` |
| 115 | |
| 116 | ### Piped Output |
| 117 | |
| 118 | When output is piped, Smithery commands emit JSONL (one JSON object per line): |
| 119 | |
| 120 | ```bash |
| 121 | smithery tool list github --flat --limit 1000 | grep label |
| 122 | ``` |