solidworks_mcp.setup.clients¶
solidworks_mcp.setup.clients ¶
The MCP clients setup knows, where each keeps its config, and if it's installed.
Detection only looks at whether folders and files exist; it never reads a
config file (see :mod:.config_file for that).
Attributes¶
Classes¶
Client
dataclass
¶
Client(key: str, name: str, found: bool, config_path: Path | None, section: str = 'mcpServers', stdio_type: bool = False, restart_hint: str = '')
One MCP client and how to register a server with it.
Attributes:
| Name | Type | Description |
|---|---|---|
key |
str
|
The name used with |
name |
str
|
The name shown to the user. |
found |
bool
|
Whether the client looks installed. |
config_path |
Path | None
|
Its JSON config file; |
section |
str
|
The object in the config that holds the servers. |
stdio_type |
bool
|
Whether entries need |
restart_hint |
str
|
What to do after setup so the client loads the server. |
Methods:¶
entry ¶
Build the server entry in the shape this client expects.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
command
|
str
|
The absolute launcher path. |
required |
args
|
list[str]
|
The launcher's arguments. |
required |
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
The JSON entry for the config file. |
Source code in src/solidworks_mcp/setup/clients.py
Functions:¶
claude_desktop_config ¶
Find Claude Desktop's config file.
Claude Desktop has kept its config in three places across releases:
%LOCALAPPDATA%\Claude-Data\claude_<id> (newest), the MSIX package's
LocalCache\Roaming\Claude, and %APPDATA%\Claude (classic). An
existing file wins, newest location first, since that is the one the app
is reading. With no file, it goes in the newest location whose folder
exists, i.e. the install that is present.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
env
|
Mapping[str, str]
|
The environment (for |
required |
Returns:
| Type | Description |
|---|---|
tuple[Path, bool]
|
The config file's path, and whether Claude Desktop was found. |
Source code in src/solidworks_mcp/setup/clients.py
find_clients ¶
find_clients(env: Mapping[str, str] | None = None, which: Callable[[str], str | None] = shutil.which) -> list[Client]
List every supported client, found or not, in the order they are offered.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
env
|
Mapping[str, str] | None
|
The environment; defaults to |
None
|
which
|
Callable[[str], str | None]
|
How to look up a command on the PATH (for |
which
|
Returns:
| Type | Description |
|---|---|
list[Client]
|
The clients, with |