import{H6 as J,L7 as W,M7 as X,N7 as N,T8 as k,Y8 as A,i_ as x,l_ as H,z6 as V}from"./cli-0.5.3-t65dek0m.mjs";import"./cli-0.5.3-kavpx97n.mjs";import"./cli-0.5.3-9bdwhdys.mjs";import"./cli-0.5.3-ttc72eq3.mjs";import"./cli-0.5.3-g75gdzrp.mjs";import"./cli-0.5.3-1rg2r7n7.mjs";import"./cli-0.5.3-6j2jk6dt.mjs";import"./cli-0.5.3-66650sba.mjs";import"./cli-0.5.3-9vh3vpap.mjs";import"./cli-0.5.3-n3cxyxpg.mjs";import"./cli-0.5.3-kbvzmaax.mjs";import"./cli-0.5.3-7wdgps7z.mjs";import{Fga as b,Lga as y}from"./cli-0.5.3-c8bcrqa4.mjs";import"./cli-0.5.3-qrvd6cmy.mjs";import"./cli-0.5.3-2dk1sk8w.mjs";import"./cli-0.5.3-0df3r78b.mjs";H();y();A();J();N();import{readdir as L,readFile as U,stat as Z}from"fs/promises";import{homedir as _}from"os";import{join as $}from"path";async function F(){let B=X();if(!W.includes(B))throw Error(`Unsupported platform: ${B} - Claude Desktop integration only works on macOS and WSL.`);if(B==="macos")return $(_(),"Library","Application Support","Claude","claude_desktop_config.json");let K=process.env.USERPROFILE?process.env.USERPROFILE.replace(/\\/g,"/"):null;if(K){let q=`/mnt/c${K.replace(/^[A-Z]:/,"")}/AppData/Roaming/Claude/claude_desktop_config.json`;try{return await Z(q),q}catch{}}try{try{let q=await L("/mnt/c/Users",{withFileTypes:!0});for(let z of q){if(z.name==="Public"||z.name==="Default"||z.name==="Default User"||z.name==="All Users")continue;let I=$("/mnt/c/Users",z.name,"AppData","Roaming","Claude","claude_desktop_config.json");try{return await Z(I),I}catch{}}}catch{}}catch(G){V(G)}throw Error("Could not find Claude Desktop config file in Windows. Make sure Claude Desktop is installed on Windows.")}async function h(){if(!W.includes(X()))throw Error("Unsupported platform - Claude Desktop integration only works on macOS and WSL.");try{let B=await F(),K;try{K=await U(B,{encoding:"utf8"})}catch(I){if(b(I)==="ENOENT")return{};throw I}let G=k(K);if(!G||typeof G!=="object")return{};let q=G.mcpServers;if(!q||typeof q!=="object")return{};let z={};for(let[I,Q]of Object.entries(q)){if(!Q||typeof Q!=="object")continue;let Y=x().safeParse(Q);if(Y.success)z[I]=Y.data}return z}catch(B){return V(B),{}}}export{h as readClaudeDesktopMcpServers,F as getClaudeDesktopConfigPath};
