修复packycode无法测速以及更新滴滴车地址
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>10.15</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>0.1.0</string>
|
||||
<string>1.2.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>Claudia</string>
|
||||
<key>CFBundleDisplayName</key>
|
||||
|
@@ -724,3 +724,75 @@ pub async fn mcp_save_project_config(
|
||||
|
||||
Ok("Project MCP configuration saved".to_string())
|
||||
}
|
||||
|
||||
/// Export configuration for MCP server
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct MCPExportConfig {
|
||||
pub name: String,
|
||||
pub transport: String,
|
||||
pub command: Option<String>,
|
||||
pub args: Vec<String>,
|
||||
pub env: HashMap<String, String>,
|
||||
pub url: Option<String>,
|
||||
pub scope: String,
|
||||
}
|
||||
|
||||
/// Export result
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct MCPExportResult {
|
||||
pub servers: Vec<MCPExportConfig>,
|
||||
pub format: String, // "single" or "multiple"
|
||||
}
|
||||
|
||||
/// Exports all MCP servers configuration
|
||||
#[tauri::command]
|
||||
pub async fn mcp_export_servers(app: AppHandle) -> Result<MCPExportResult, String> {
|
||||
info!("Exporting MCP servers configuration");
|
||||
|
||||
// Get all servers
|
||||
let servers = mcp_list(app.clone()).await?;
|
||||
|
||||
if servers.is_empty() {
|
||||
return Ok(MCPExportResult {
|
||||
servers: vec![],
|
||||
format: "multiple".to_string(),
|
||||
});
|
||||
}
|
||||
|
||||
// Get detailed information for each server
|
||||
let mut export_configs = Vec::new();
|
||||
|
||||
for server in &servers {
|
||||
match mcp_get(app.clone(), server.name.clone()).await {
|
||||
Ok(detailed_server) => {
|
||||
export_configs.push(MCPExportConfig {
|
||||
name: detailed_server.name,
|
||||
transport: detailed_server.transport,
|
||||
command: detailed_server.command,
|
||||
args: detailed_server.args,
|
||||
env: detailed_server.env,
|
||||
url: detailed_server.url,
|
||||
scope: detailed_server.scope,
|
||||
});
|
||||
}
|
||||
Err(e) => {
|
||||
error!("Failed to get details for server {}: {}", server.name, e);
|
||||
// Still include basic information
|
||||
export_configs.push(MCPExportConfig {
|
||||
name: server.name.clone(),
|
||||
transport: server.transport.clone(),
|
||||
command: server.command.clone(),
|
||||
args: server.args.clone(),
|
||||
env: server.env.clone(),
|
||||
url: server.url.clone(),
|
||||
scope: server.scope.clone(),
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Ok(MCPExportResult {
|
||||
format: if export_configs.len() == 1 { "single" } else { "multiple" }.to_string(),
|
||||
servers: export_configs,
|
||||
})
|
||||
}
|
||||
|
@@ -36,7 +36,7 @@ use commands::claude::{
|
||||
use commands::mcp::{
|
||||
mcp_add, mcp_add_from_claude_desktop, mcp_add_json, mcp_get, mcp_get_server_status, mcp_list,
|
||||
mcp_read_project_config, mcp_remove, mcp_reset_project_choices, mcp_save_project_config,
|
||||
mcp_serve, mcp_test_connection,
|
||||
mcp_serve, mcp_test_connection, mcp_export_servers,
|
||||
};
|
||||
|
||||
use commands::usage::{
|
||||
@@ -349,6 +349,7 @@ fn main() {
|
||||
mcp_get_server_status,
|
||||
mcp_read_project_config,
|
||||
mcp_save_project_config,
|
||||
mcp_export_servers,
|
||||
|
||||
// Storage Management
|
||||
storage_list_tables,
|
||||
|
@@ -18,7 +18,7 @@
|
||||
}
|
||||
],
|
||||
"security": {
|
||||
"csp": "default-src 'self'; img-src 'self' asset: https://asset.localhost blob: data:; style-src 'self' 'unsafe-inline' blob: data: asset: https://asset.localhost; style-src-elem 'self' 'unsafe-inline' blob: data: asset: https://asset.localhost; style-src-attr 'self' 'unsafe-inline'; script-src 'self' 'unsafe-eval' https://app.posthog.com https://*.posthog.com https://*.i.posthog.com https://*.assets.i.posthog.com; worker-src 'self' blob: asset: https://asset.localhost; font-src 'self' data: blob: asset: https://asset.localhost; connect-src 'self' ipc: http://ipc.localhost https://ipc.localhost https://app.posthog.com https://*.posthog.com https://*.i.posthog.com",
|
||||
"csp": "default-src 'self'; img-src 'self' asset: https://asset.localhost blob: data:; style-src 'self' 'unsafe-inline' blob: data: asset: https://asset.localhost; style-src-elem 'self' 'unsafe-inline' blob: data: asset: https://asset.localhost; style-src-attr 'self' 'unsafe-inline'; script-src 'self' 'unsafe-eval' https://app.posthog.com https://*.posthog.com https://*.i.posthog.com https://*.assets.i.posthog.com; worker-src 'self' blob: asset: https://asset.localhost; font-src 'self' data: blob: asset: https://asset.localhost; connect-src 'self' ipc: http://ipc.localhost https://ipc.localhost https://app.posthog.com https://*.posthog.com https://*.i.posthog.com https://api.packycode.com https://api-hk-cn2.packycode.com https://api-us-cmin2.packycode.com https://api-us-4837.packycode.com https://api-us-cn2.packycode.com https://api-cf-pro.packycode.com https://share-api.packycode.com https://share-api-cf-pro.packycode.com https://share-api-hk-cn2.packycode.com",
|
||||
"assetProtocol": {
|
||||
"enable": true,
|
||||
"scope": [
|
||||
|
Reference in New Issue
Block a user