Commit 1345519
authored
Add public API for MCP server installation (#122)
Add a new public package `pkg/mcpinstall` that exposes MCP server
installation functionality for use by external projects.
Public API:
- Install(opts Options) - Install MCP server config for a client
- SupportedClients() - List available clients with names and IDs
- Options struct - All configuration in one place
- ClientInfo struct - Client display name and identifier
Options fields:
- ClientName (required) - Client identifier (e.g., "claude-code", "cursor")
- ServerName (required) - Name to register the MCP server as
- Command (required) - Path to the MCP server binary
- Args (required) - Arguments to pass to the binary
- CreateBackup (optional) - Create backup before modification
- CustomConfigPath (optional) - Override default config location
Example usage:
err := mcpinstall.Install(mcpinstall.Options{
ClientName: "cursor",
ServerName: "my-mcp-server",
Command: "/usr/local/bin/my-server",
Args: []string{"serve"},
})
Internal changes:
- Refactor InstallMCPForClient to accept configurable options
- Separate Tiger-specific defaults into installTigerMCPForClient
- Fix VSCode buildInstallCommand to marshal entire JSON struct
- Simplify tests to pass values directly1 parent c0cae55 commit 1345519
File tree
4 files changed
+222
-119
lines changed- internal/tiger/cmd
- pkg/mcpinstall
4 files changed
+222
-119
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
110 | | - | |
| 110 | + | |
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
| |||
0 commit comments