Skip to content

release: 3.8.0#547

Merged
calclavia merged 22 commits intomainfrom
calclavia/cli-wrapper-strategy
Feb 3, 2026
Merged

release: 3.8.0#547
calclavia merged 22 commits intomainfrom
calclavia/cli-wrapper-strategy

Conversation

@calclavia
Copy link
Contributor

@calclavia calclavia commented Feb 3, 2026

Summary

Adds smithery namespace and smithery connect commands for managing cloud-hosted MCP servers via Smithery Connect.

Namespace commands - Kubernetes-style context management

  • namespace list/use/show/create - Set and persist namespace context

Connect commands - Manage MCP server connections

  • connect add/remove/list/auth - Server lifecycle management
  • connect tools/search/call - Tool discovery and invocation

Key Features

  • Auto-namespace creation - First use auto-creates a default namespace
  • Session-based client reuse - ConnectSession caches Smithery and MCP clients within a command
  • MCP SDK Client - Uses @modelcontextprotocol/sdk Client API instead of raw JSON-RPC
  • Pagination support - Automatically fetches all pages when listing connections
  • OAuth flow - Shows auth URL immediately when adding servers that require it
  • Fuzzy search - FlexSearch for intent-based tool discovery

Test plan

  • pnpm build - Builds successfully
  • pnpm test - All 262 tests pass
  • Manual testing with Smithery Connect

🤖 Generated with Claude Code

…ation

Adds a new `smithery tools` command with three subcommands:
- `smithery tools search <query>` - Fuzzy search tools by intent
- `smithery tools call <connection/tool> '<args>'` - Direct tool invocation
- `smithery tools list [connection]` - List connections and tools

Key features:
- Optimized for agent efficiency (2 steps vs 10+ steps)
- Search returns full schema inline (no separate fetch needed)
- Three-tier output handling: small outputs inline, large outputs written
  to temp file with preview (prevents JSON truncation issues)
- Uses Smithery Connect API for MCP tool discovery and invocation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
calclavia and others added 2 commits February 3, 2026 21:58
cross-spawn is marked as external in the esbuild config (to avoid
bundling issues), which means it must be installed at runtime.
Adding it as a direct dependency fixes the "Cannot find package"
error when running the built CLI.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Use SDK types for Connection and ConnectionsListResponse instead of
  defining our own
- Use SDK client for all API calls instead of direct fetch
- Switch from MiniSearch to FlexSearch for consistency with rest of
  codebase
- Remove hardcoded CONNECT_URL (SDK handles base URL)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
## Namespace Commands (cross-cutting context)
- `smithery namespace list` - List available namespaces
- `smithery namespace use <name>` - Set current namespace (persisted)
- `smithery namespace show` - Show current namespace
- `smithery namespace create <name>` - Create and claim a new namespace

## Connect Commands (server-centric)
- `smithery connect add <mcp-url>` - Add an MCP server connection
- `smithery connect list` - List connected servers
- `smithery connect remove <id>` - Remove a server connection
- `smithery connect auth <id>` - Handle OAuth for a server
- `smithery connect tools [server]` - List tools
- `smithery connect search <query>` - Search tools by intent
- `smithery connect call <id> [args]` - Call a tool

The namespace is now persisted in settings and used by all connect
commands, similar to kubectl config context.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
calclavia and others added 2 commits February 3, 2026 23:13
Add documentation for:
- Namespace commands (list, use, show, create)
- Connect commands (add, list, remove, auth, tools, search, call)
- Smithery Connect examples section

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Create shared `createSmitheryClient()` helper in lib/smithery-client.ts
that ensures consistent client configuration across all commands.

The SDK automatically respects SMITHERY_BASE_URL env var for development,
so all commands now properly support pointing to a local/staging API.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@calclavia calclavia force-pushed the calclavia/cli-wrapper-strategy branch from 7ccf1d4 to a22da1a Compare February 3, 2026 15:26
The Smithery SDK automatically handles SMITHERY_BASE_URL env var,
so we don't need to explicitly pass baseURL. This consolidates
all base URL configuration to use the SDK's built-in support.

- Remove explicit baseURL passing in lib/registry.ts and deploy.ts
- Update index.ts login flow to use SMITHERY_BASE_URL
- Update lib/tunnel.ts to use SMITHERY_BASE_URL
- Remove unused _REGISTRY_ENDPOINT from constants.ts

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@calclavia calclavia force-pushed the calclavia/cli-wrapper-strategy branch from a22da1a to 0639978 Compare February 3, 2026 15:28
calclavia and others added 4 commits February 3, 2026 23:29
The SDK has a default base URL, so we no longer need to keep this
env var dynamic at runtime. This simplifies the build configuration.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
When no namespace is set and none exist, automatically create one
using the SDK's namespaces.create() which generates a server-assigned
name. Also persist the namespace selection to settings when falling
back to the first available namespace.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Remove the tool count fetch when adding a server since it adds
unnecessary latency and may fail if the server needs authentication.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Replace raw JSON-RPC calls with the MCP SDK's ergonomic Client API.
Use StreamableHTTPClientTransport directly to avoid type mismatch
issues with pnpm's dependency resolution.

Also upgrades @modelcontextprotocol/sdk from 1.25.1 to 1.25.3.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
calclavia and others added 3 commits February 4, 2026 00:11
When adding a server that requires OAuth, include the authorizationUrl
in the output so users can authenticate immediately.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Introduce ConnectSession class that creates a single Smithery client
and caches MCP clients by connectionId within a command execution.
This avoids redundant client creation when iterating over multiple
connections.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove toolCount from server listing (unnecessary overhead)
- Add cursor-based pagination to listConnections() to fetch all pages
- Remove unused legacy wrapper functions from api.ts

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@calclavia calclavia changed the title feat: add 'smithery tools' command for agent-optimized MCP tool invocation feat: add namespace and connect commands for cloud MCP management Feb 3, 2026
calclavia and others added 3 commits February 4, 2026 00:28
Reduce README from 240 to 85 lines while preserving all key information.
Group commands logically, remove redundant flag descriptions, and
streamline examples to show practical workflows.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Trigger on push to main instead of tags
- Auto-detect version bump from commit message:
  - feat!: or BREAKING CHANGE → major
  - feat: → minor
  - everything else → patch
- Skip release commits to prevent infinite loops
- Bot commits version bump with tag and pushes

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- If PR title contains explicit version (e.g., "v3.8.0"), use it
- Otherwise default to patch bump
- Developers can edit PR title before merge to control version

Examples:
- "feat: add namespace commands v3.8.0" → 3.8.0
- "fix: typo" → patch bump (3.7.1)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Only PRs with title "release: X.Y.Z" will trigger a publish.
Non-release PRs are merged without publishing.

To release:
1. Create PR with title "release: 3.8.0"
2. Merge to main
3. CI bumps version, tags v3.8.0, publishes to npm

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@calclavia calclavia changed the title feat: add namespace and connect commands for cloud MCP management release: 3.8.0 Feb 3, 2026
calclavia and others added 2 commits February 4, 2026 00:47
- Remove `connect auth` command (auth URL shown on `connect add`)
- Skip `listConnections()` when operating on specific server ID
- Remove redundant wrapper functions (createRegistry, createSDKOptions)
- Let SDK handle API key and base URL from env vars
- Remove unused types (StreamableHTTPDeploymentConnection, ValidationResponse)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Replace MCP SDK client with direct HTTP POST for tools/list
- Skip protocol handshake overhead
- Add 5s timeout per connection to fail fast on broken servers

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
calclavia and others added 2 commits February 4, 2026 00:56
SMITHERY_BASE_URL is for the API (api.smithery.ai)
SMITHERY_URL is for the website auth flow (smithery.ai)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add required Accept header for MCP endpoint
- Increase timeout from 5s to 30s (API is slow on cold start)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copy link
Contributor Author

calclavia commented Feb 3, 2026

Merge activity

  • Feb 3, 5:06 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Feb 3, 5:06 PM UTC: @calclavia merged this pull request with Graphite.

@calclavia calclavia merged commit a08bb72 into main Feb 3, 2026
5 checks passed
@calclavia calclavia deleted the calclavia/cli-wrapper-strategy branch February 3, 2026 17:06
Comment on lines +111 to +121
},
body: JSON.stringify({
jsonrpc: "2.0",
id: 1,
method: "tools/list",
params: {},
}),
signal: controller.signal,
})

clearTimeout(timeout)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: If fetch() fails due to a network error, the corresponding clearTimeout() is not called, causing a timer leak that can delay process exit.
Severity: MEDIUM

Suggested Fix

Move the clearTimeout(timeout) call into a finally block associated with the try...catch. This will guarantee that the timeout is cleared whether the fetch operation succeeds or fails.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: src/commands/connect/api.ts#L103-L121

Potential issue: In the `listToolsForConnection` function, a `setTimeout` is used to
create a 30-second timeout for a `fetch` request. If the `fetch` call throws an error,
such as a network failure, the code jumps to the `catch` block, skipping the
`clearTimeout()` call. This causes a resource leak, as the timer remains active in the
event loop. When listing tools from multiple connections, each failed connection will
leave a timer running, which can delay the CLI process from exiting for up to 30 seconds
per failure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant