All checks were successful
Build App / build-macos (push) Successful in 2m20s
Build App / build-windows (push) Successful in 3m21s
Build App / build-linux (push) Successful in 5m8s
Build Container / build-container (push) Successful in 1m4s
Sync Release to GitHub / sync-release (release) Successful in 2s
Add Model Context Protocol (MCP) server configuration support. Users can define MCP servers globally (new sidebar tab) and enable them per-project. Enabled servers are injected into containers as MCP_SERVERS_JSON env var and merged into ~/.claude.json by the entrypoint. Backend: McpServer model, McpStore (JSON + atomic writes), 4 CRUD commands, container injection with fingerprint-based recreation detection. Frontend: MCP sidebar tab, McpPanel/McpServerCard components, useMcpServers hook, per-project MCP checkboxes in ProjectCard config. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
39 lines
908 B
Rust
39 lines
908 B
Rust
use tauri::State;
|
|
|
|
use crate::models::McpServer;
|
|
use crate::AppState;
|
|
|
|
#[tauri::command]
|
|
pub async fn list_mcp_servers(state: State<'_, AppState>) -> Result<Vec<McpServer>, String> {
|
|
Ok(state.mcp_store.list())
|
|
}
|
|
|
|
#[tauri::command]
|
|
pub async fn add_mcp_server(
|
|
name: String,
|
|
state: State<'_, AppState>,
|
|
) -> Result<McpServer, String> {
|
|
let name = name.trim().to_string();
|
|
if name.is_empty() {
|
|
return Err("MCP server name cannot be empty.".to_string());
|
|
}
|
|
let server = McpServer::new(name);
|
|
state.mcp_store.add(server)
|
|
}
|
|
|
|
#[tauri::command]
|
|
pub async fn update_mcp_server(
|
|
server: McpServer,
|
|
state: State<'_, AppState>,
|
|
) -> Result<McpServer, String> {
|
|
state.mcp_store.update(server)
|
|
}
|
|
|
|
#[tauri::command]
|
|
pub async fn remove_mcp_server(
|
|
server_id: String,
|
|
state: State<'_, AppState>,
|
|
) -> Result<(), String> {
|
|
state.mcp_store.remove(&server_id)
|
|
}
|