use crate::adapters::caps::{Caps, FieldSet, ProjectSemantics, Source, TransportSet};
use crate::adapters::detect::Probe;
use crate::adapters::location::Location;
use crate::adapters::mapper::McpServersJson;
use crate::adapters::spec::{AdapterSpec, ContainerPath, McpSpec, Tier, exact_names};
use crate::env::Os;
use crate::formats::Format;
use crate::model::clients::passthrough_of;
pub const ID: &str = "claude-desktop";
const PACKAGES: Location = Location::LocalAppData("Packages");
const CONFIG: Location = Location::AppData("Claude/claude_desktop_config.json");
const MSIX_CONFIG: Location = Location::Glob {
base: &PACKAGES,
pattern: "Claude_*/LocalCache/Roaming/Claude/claude_desktop_config.json",
};
const CAPS: Caps = Caps {
transports: TransportSet::STDIO,
env_ref: None,
env_ref_fields: FieldSet::NONE,
command_ref: None,
native_disable: None,
project_disable: None,
project_semantics: ProjectSemantics::Unknown,
precedence: &[Source::User],
compat_reads: &[],
trust_gate: None,
rewrites_file_at_runtime: true,
restart_required: true,
tool_filter: None,
windows_shell_shim: true,
timeouts: &[],
passthrough_allowlist: passthrough_of(ID),
};
static MAPPER: McpServersJson = McpServersJson {
caps: &CAPS,
type_field: false,
remote_type: false,
cwd: false,
http_aliases: &[],
url_implies_http: false,
valid_name: |name| !name.is_empty(),
};
pub static SPEC: AdapterSpec = AdapterSpec {
id: ID,
display_name: "Claude Desktop",
tier: Tier::A,
detect: &[
Probe::Path(Location::AppData("Claude")),
Probe::UninstallEntry("Claude"),
Probe::MsixPackage(Location::Glob {
base: &PACKAGES,
pattern: "Claude_*",
}),
],
mcp: Some(McpSpec {
oses: &[Os::Windows, Os::MacOs],
read_only: false,
user: &[CONFIG],
user_files: None,
user_mirrors: &[MSIX_CONFIG],
profiles: None,
project: &[],
project_local: &[],
format: Format::Json,
skeleton: "",
container: ContainerPath(&["mcpServers"]),
project_local_container: ContainerPath(&["mcpServers"]),
legacy_containers: &[],
same_name: exact_names,
replaced_by: &[],
mapper: &MAPPER,
caps: CAPS,
}),
};