castrel-proxy 0.1.1__tar.gz → 0.1.2__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.
- {castrel_proxy-0.1.1 → castrel_proxy-0.1.2}/PKG-INFO +1 -1
- {castrel_proxy-0.1.1 → castrel_proxy-0.1.2}/pyproject.toml +1 -1
- {castrel_proxy-0.1.1 → castrel_proxy-0.1.2}/src/castrel_proxy/mcp/manager.py +27 -28
- {castrel_proxy-0.1.1 → castrel_proxy-0.1.2}/.gitignore +0 -0
- {castrel_proxy-0.1.1 → castrel_proxy-0.1.2}/CHANGELOG.md +0 -0
- {castrel_proxy-0.1.1 → castrel_proxy-0.1.2}/LICENSE +0 -0
- {castrel_proxy-0.1.1 → castrel_proxy-0.1.2}/README.md +0 -0
- {castrel_proxy-0.1.1 → castrel_proxy-0.1.2}/src/castrel_proxy/__init__.py +0 -0
- {castrel_proxy-0.1.1 → castrel_proxy-0.1.2}/src/castrel_proxy/cli/__init__.py +0 -0
- {castrel_proxy-0.1.1 → castrel_proxy-0.1.2}/src/castrel_proxy/cli/commands.py +0 -0
- {castrel_proxy-0.1.1 → castrel_proxy-0.1.2}/src/castrel_proxy/core/__init__.py +0 -0
- {castrel_proxy-0.1.1 → castrel_proxy-0.1.2}/src/castrel_proxy/core/client_id.py +0 -0
- {castrel_proxy-0.1.1 → castrel_proxy-0.1.2}/src/castrel_proxy/core/config.py +0 -0
- {castrel_proxy-0.1.1 → castrel_proxy-0.1.2}/src/castrel_proxy/core/daemon.py +0 -0
- {castrel_proxy-0.1.1 → castrel_proxy-0.1.2}/src/castrel_proxy/core/executor.py +0 -0
- {castrel_proxy-0.1.1 → castrel_proxy-0.1.2}/src/castrel_proxy/data/__init__.py +0 -0
- {castrel_proxy-0.1.1 → castrel_proxy-0.1.2}/src/castrel_proxy/data/default_whitelist.txt +0 -0
- {castrel_proxy-0.1.1 → castrel_proxy-0.1.2}/src/castrel_proxy/mcp/__init__.py +0 -0
- {castrel_proxy-0.1.1 → castrel_proxy-0.1.2}/src/castrel_proxy/network/__init__.py +0 -0
- {castrel_proxy-0.1.1 → castrel_proxy-0.1.2}/src/castrel_proxy/network/api_client.py +0 -0
- {castrel_proxy-0.1.1 → castrel_proxy-0.1.2}/src/castrel_proxy/network/websocket_client.py +0 -0
- {castrel_proxy-0.1.1 → castrel_proxy-0.1.2}/src/castrel_proxy/operations/__init__.py +0 -0
- {castrel_proxy-0.1.1 → castrel_proxy-0.1.2}/src/castrel_proxy/operations/document.py +0 -0
- {castrel_proxy-0.1.1 → castrel_proxy-0.1.2}/src/castrel_proxy/security/__init__.py +0 -0
- {castrel_proxy-0.1.1 → castrel_proxy-0.1.2}/src/castrel_proxy/security/whitelist.py +0 -0
- {castrel_proxy-0.1.1 → castrel_proxy-0.1.2}/tests/__init__.py +0 -0
- {castrel_proxy-0.1.1 → castrel_proxy-0.1.2}/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.
|
|
3
|
+
Version: 0.1.2
|
|
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
|
|
@@ -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
|
-
|
|
224
|
-
sys.exit(1)
|
|
220
|
+
return {}
|
|
225
221
|
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
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
|
-
|
|
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
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
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
|
-
|
|
252
|
-
|
|
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
|
-
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|