castrel-proxy 0.1.1__tar.gz → 0.1.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. {castrel_proxy-0.1.1 → castrel_proxy-0.1.3}/PKG-INFO +1 -1
  2. {castrel_proxy-0.1.1 → castrel_proxy-0.1.3}/pyproject.toml +1 -1
  3. {castrel_proxy-0.1.1 → castrel_proxy-0.1.3}/src/castrel_proxy/cli/commands.py +6 -6
  4. {castrel_proxy-0.1.1 → castrel_proxy-0.1.3}/src/castrel_proxy/mcp/manager.py +27 -28
  5. {castrel_proxy-0.1.1 → castrel_proxy-0.1.3}/.gitignore +0 -0
  6. {castrel_proxy-0.1.1 → castrel_proxy-0.1.3}/CHANGELOG.md +0 -0
  7. {castrel_proxy-0.1.1 → castrel_proxy-0.1.3}/LICENSE +0 -0
  8. {castrel_proxy-0.1.1 → castrel_proxy-0.1.3}/README.md +0 -0
  9. {castrel_proxy-0.1.1 → castrel_proxy-0.1.3}/src/castrel_proxy/__init__.py +0 -0
  10. {castrel_proxy-0.1.1 → castrel_proxy-0.1.3}/src/castrel_proxy/cli/__init__.py +0 -0
  11. {castrel_proxy-0.1.1 → castrel_proxy-0.1.3}/src/castrel_proxy/core/__init__.py +0 -0
  12. {castrel_proxy-0.1.1 → castrel_proxy-0.1.3}/src/castrel_proxy/core/client_id.py +0 -0
  13. {castrel_proxy-0.1.1 → castrel_proxy-0.1.3}/src/castrel_proxy/core/config.py +0 -0
  14. {castrel_proxy-0.1.1 → castrel_proxy-0.1.3}/src/castrel_proxy/core/daemon.py +0 -0
  15. {castrel_proxy-0.1.1 → castrel_proxy-0.1.3}/src/castrel_proxy/core/executor.py +0 -0
  16. {castrel_proxy-0.1.1 → castrel_proxy-0.1.3}/src/castrel_proxy/data/__init__.py +0 -0
  17. {castrel_proxy-0.1.1 → castrel_proxy-0.1.3}/src/castrel_proxy/data/default_whitelist.txt +0 -0
  18. {castrel_proxy-0.1.1 → castrel_proxy-0.1.3}/src/castrel_proxy/mcp/__init__.py +0 -0
  19. {castrel_proxy-0.1.1 → castrel_proxy-0.1.3}/src/castrel_proxy/network/__init__.py +0 -0
  20. {castrel_proxy-0.1.1 → castrel_proxy-0.1.3}/src/castrel_proxy/network/api_client.py +0 -0
  21. {castrel_proxy-0.1.1 → castrel_proxy-0.1.3}/src/castrel_proxy/network/websocket_client.py +0 -0
  22. {castrel_proxy-0.1.1 → castrel_proxy-0.1.3}/src/castrel_proxy/operations/__init__.py +0 -0
  23. {castrel_proxy-0.1.1 → castrel_proxy-0.1.3}/src/castrel_proxy/operations/document.py +0 -0
  24. {castrel_proxy-0.1.1 → castrel_proxy-0.1.3}/src/castrel_proxy/security/__init__.py +0 -0
  25. {castrel_proxy-0.1.1 → castrel_proxy-0.1.3}/src/castrel_proxy/security/whitelist.py +0 -0
  26. {castrel_proxy-0.1.1 → castrel_proxy-0.1.3}/tests/__init__.py +0 -0
  27. {castrel_proxy-0.1.1 → castrel_proxy-0.1.3}/tests/test_core.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: castrel-proxy
3
- Version: 0.1.1
3
+ Version: 0.1.3
4
4
  Summary: A lightweight remote command execution bridge client with MCP integration
5
5
  Project-URL: Homepage, https://github.com/castrel-ai/castrel-proxy
6
6
  Project-URL: Documentation, https://github.com/castrel-ai/castrel-proxy#readme
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "castrel-proxy"
3
- version = "0.1.1"
3
+ version = "0.1.3"
4
4
  description = "A lightweight remote command execution bridge client with MCP integration"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.10"
@@ -178,7 +178,7 @@ def pair(
178
178
  @app.command()
179
179
  def start(
180
180
  daemon: bool = typer.Option(
181
- True, "--daemon/--foreground", "-d/-f", help="Run in background (default) or foreground"
181
+ False, "--daemon/--foreground", "-d/-f", help="Run in background or foreground (default)"
182
182
  ),
183
183
  ):
184
184
  """
@@ -186,14 +186,14 @@ def start(
186
186
 
187
187
  Start bridge and connect to paired server.
188
188
 
189
- Run in background (default):
189
+ Run in foreground (default):
190
190
  castrel-proxy start
191
- castrel-proxy start --daemon
192
- castrel-proxy start -d
193
-
194
- Run in foreground:
195
191
  castrel-proxy start --foreground
196
192
  castrel-proxy start -f
193
+
194
+ Run in background:
195
+ castrel-proxy start --daemon
196
+ castrel-proxy start -d
197
197
  """
198
198
  config = get_config()
199
199
 
@@ -213,21 +213,18 @@ class MCPManager:
213
213
  Get tools from all MCP services
214
214
 
215
215
  Returns:
216
- Dict[str, List[Dict]]: All tools list
217
-
218
- Raises:
219
- SystemExit: When MCP client is not initialized or tools retrieval fails
216
+ Dict[str, List[Dict]]: All tools list (may be partial if some servers fail)
220
217
  """
221
218
  if not self.client:
222
219
  logger.error("MCP client not initialized")
223
- logger.error("Exiting due to uninitialized MCP client")
224
- sys.exit(1)
220
+ return {}
225
221
 
226
- try:
227
- # Use MultiServerMCPClient to get all tools
228
- result = {}
229
- count = 0
230
- for server_name in self.server_configs:
222
+ result = {}
223
+ total_count = 0
224
+ failed_servers = []
225
+
226
+ for server_name in self.server_configs:
227
+ try:
231
228
  tools = await self.client.get_tools(server_name=server_name)
232
229
  # Convert to required format
233
230
  formatted_tools = []
@@ -240,27 +237,29 @@ class MCPManager:
240
237
  "mcp_server": getattr(tool, "server_name", "unknown"),
241
238
  }
242
239
  formatted_tools.append(tool_info)
243
- count = count + len(formatted_tools)
240
+ total_count += len(formatted_tools)
244
241
  result[server_name] = formatted_tools
242
+ logger.info(f"Retrieved {len(formatted_tools)} tool(s) from '{server_name}'")
245
243
 
246
- if count == 0:
247
- logger.warning("No tools retrieved from any MCP server")
248
- logger.warning("Exiting due to zero tools retrieved")
249
- sys.exit(1)
244
+ except Exception as e:
245
+ failed_servers.append(server_name)
246
+ # Log error but continue with other servers
247
+ if "Configuration error" in str(e) or "Missing 'transport' key" in str(e):
248
+ logger.error(f"Configuration error for server '{server_name}': {e}")
249
+ else:
250
+ logger.error(f"Failed to get tools from server '{server_name}': {e}")
251
+
252
+ if failed_servers:
253
+ logger.warning(
254
+ f"Failed to retrieve tools from {len(failed_servers)} server(s): {', '.join(failed_servers)}"
255
+ )
250
256
 
251
- logger.info(f"Retrieved {count} tool(s)")
252
- return result
257
+ if total_count == 0:
258
+ logger.warning("No tools retrieved from any MCP server")
259
+ else:
260
+ logger.info(f"Retrieved {total_count} tool(s) from {len(result)} server(s)")
253
261
 
254
- except Exception as e:
255
- # Check if it's a configuration error
256
- if "Configuration error" in str(e) or "Missing 'transport' key" in str(e):
257
- logger.error(f"Configuration error while getting MCP tools: {e}")
258
- logger.error("Exiting due to invalid MCP configuration")
259
- sys.exit(1)
260
- else:
261
- logger.error(f"Failed to get MCP tools: {e}")
262
- logger.error("Exiting due to MCP tools retrieval failure")
263
- sys.exit(1)
262
+ return result
264
263
 
265
264
  async def disconnect_all(self):
266
265
  """Disconnect all MCP connections"""
File without changes
File without changes
File without changes