
    k7i                        S r SSKrSSKrSSKJr  SSKJr  SSKrSSKrSSK	J
r
  SSKJr  SSKJr  SS	KJr  \" \5      rSSSS
SSSS.S\S\S-  S\S\\   S-  S\\   S-  S\\\4   S-  S\S\S-  S\S-  S\S-  S\4S jjrSSSSSS
SSSS.	S\S\\S-  \R0                  " SS/SS94   S\\\   S-  \R0                  " SS S!S"94   S\\\   S-  \R0                  " S#S$S!S"94   S\\\   S-  \R0                  " S%S&S!S"94   S'\\S-  \R0                  " S(S)S*94   S\\\R0                  " S+S,S!S"94   S-\\S-  \R0                  " S.S/S*94   S\\S-  \R0                  " S0S1S*94   S\\S-  \R0                  " S2S3S*94   SS4S4 jjrg)5zEMCP configuration JSON generation for FastMCP install using Cyclopts.    N)Path)	Annotated)print)
get_logger)UVEnvironment   )process_common_argsF)with_editablewith_packagesenv_varscopypython_versionwith_requirementsprojectfileserver_objectnamer
   r   r   r   r   r   r   returnc                    [        UU=(       d    / S/-   UU	US9n
U(       a  U R                  5        SU 3nO[        U R                  5       5      nU
R                  SSU/5      nUS   USS S.nU(       a  X]S	'   X-0n[        R
                  " US
S9nU(       a&  [        R                  " U5        [        SU S35        g[        U5        g! [         a  n[        SU S35         SnAgSnAff = f)a  Generate MCP configuration JSON for manual installation.

Args:
    file: Path to the server file
    server_object: Optional server object name (for :object suffix)
    name: Name for the server in MCP config
    with_editable: Optional list of directories to install in editable mode
    with_packages: Optional list of additional packages to install
    env_vars: Optional dictionary of environment variables
    copy: If True, copy to clipboard instead of printing to stdout
    python_version: Optional Python version to use
    with_requirements: Optional requirements file to install from
    project: Optional project directory to run within

Returns:
    True if generation was successful, False otherwise
fastmcp)pythondependenciesrequirementsr   editable:runr   r   N)commandargsenv   )indentz[green]MCP configuration for 'z' copied to clipboard[/green]Tz+[red]Failed to generate MCP configuration: z[/red]F)
r   resolvestrbuild_commandjsondumps	pyperclipr   r   	Exception)r   r   r   r
   r   r   r   r   r   r   
env_configserver_specfull_commandserver_configconfigjson_outputes                    V/home/james-whalen/.local/lib/python3.13/site-packages/fastmcp/cli/install/mcp_json.pyinstall_mcp_jsonr1      s   <-"!'-2)<*"

 !\\^,Am_=Kdlln-K "//E;0OP $A $
 #+%  & jj2 NN;'24&8UVW
  + ;A3fEFs   B>C C 
C0C++C0)	server_namer
   r   r   env_filer   r   r   r   r*   r2   z--namez-nz(Custom name for the server in MCP config)r   helpz--with-editablezVDirectory with pyproject.toml to install in editable mode (can be used multiple times) )r4   negativez--withz;Additional packages to install (can be used multiple times)z--envzFEnvironment variables in KEY=VALUE format (can be used multiple times)r3   z
--env-filez)Load environment variables from .env file)r4   z--copyz=Copy configuration to clipboard instead of printing to stdoutr   z--pythonz(Python version to use (e.g., 3.10, 3.11)z--with-requirementsz.Requirements file to install dependencies fromz	--projectz2Run the command within the given project directoryc       	            #    U=(       d    / nU=(       d    / nU=(       d    / n[        XX4U5      I Sh  vN u  ppn[        U
UUUUUUUUU	S9
nU(       d  [        R                  " S5        gg N97f)zGenerate MCP configuration JSON for manual installation.

Args:
    server_spec: Python file to install, optionally with :object suffix
N)
r   r   r   r
   r   r   r   r   r   r   r   )r	   r1   sysexit)r*   r2   r
   r   r   r3   r   r   r   r   r   r   r   packagesenv_dictsuccesss                   r0   mcp_json_commandr=   b   s     Z "'RM!'RM~2H:M-8; 51D ##+G  #5s   2A0A.:A0)__doc__r%   r8   pathlibr   typingr   cycloptsr'   richr   fastmcp.utilities.loggingr   6fastmcp.utilities.mcp_server_config.v1.environments.uvr   sharedr	   __name__loggerr#   listdictboolr1   	Parameterr=        r0   <module>rN      s   K  
      0 P '	H	 (,&*&*!%%)K
K:K K
 :$K 9t#K 38nt#K K $JK d{K D[K 
Kn 	 	 	 	 	 	 	 	 	Kbb d
D!;	
	b T
Ti	
	b$ S	DN	
	%b4 S	DY	
	5bD t<	
	EbR P	
	Sbb d
;	
	cbp !t!A	
	qb~ tE	
	bL 
MbrM   