+
    Q(iv              "          R t ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RI	H
t
 ^ RIHt ^ RIHtHt ^ RIt^ RIt^ RIHt ^ RIHt ^ RIHt ^ RIt^ RIHt ^ R	IHt ^ R
IHtHtH t  ^ RI!H"t" ^ RI#H$t$ ^ RI%H&t& ^ RI'H(t(H)t) ^ RI*H+t+H,t,H-t- ^ RI.H/t/ ^ RI0H1t1 ^ RI2H3t3 ]/! R4      t4]! 4       t5]Pl                  ! RR]Pn                  ]! RJR7      R7      t8R t9R R lt:]
R R l4       t;]8Px                  RR/R R  ll4       t=]Pl                  ! R!R"R#7      t>]>Px                  RKR$RR%RR&RR'RR(RR)RR*RR+RR,R-R.RR/R/R0 R1 lll4       t?]8Px                  RKR2RR3RR4RR5RR6RR7RR)RR%RR+RR*RR8RR9RR,RR.RR:RR/R/R; R< lll4       t]8Px                  RKR=RR>RR)RR%RR+RR*RR9R/R? R@ lll4       t@]Pl                  ! R+RAR#7      tA]APx                  RLRB RC ll4       tB]8Py                  ]>4       ]8Py                  ]A4       ]8Py                  ]$4       ]8Py                  ]&4       ]8Py                  ] RDRE7       ]8Py                  ]RFRE7       ]8Py                  ]RGRE7       ]8Py                  ]"RHRE7       ]8Py                  ]4       ]CRI8X  d
   ]8! 4        R# R# )Mz!FastMCP CLI tools using Cyclopts.N)contextmanagerPath)	AnnotatedLiteral)	Parameter)Console)Table)run)auth_app)call_commanddiscover_commandlist_command)generate_cli_command)install_app)	tasks_app)is_already_in_uv_subprocessload_and_merge_config)InspectFormatformat_infoinspect_fastmcp)
get_logger)MCPServerConfig)check_for_newer_versionclifastmcpzFFastMCP 2.0 - The fast, Pythonic way to build MCP servers and clients.)negative)namehelpversiondefault_parameterc                     \         P                  R8X  d*   R F!  p  \        P                  ! V R.RRR7       V u # 	  R# R#   \        P                   d     KA  i ; i)z5Get the correct npx command for the current platform.win32npxz	--versionT)checkcapture_outputN)znpx.cmdznpx.exer#   )sysplatform
subprocessr
   CalledProcessError)cmds    U/Users/agent/.openclaw/workspace/venv/lib/python3.14/site-packages/fastmcp/cli/cli.py_get_npx_commandr,   1   sY    
||w0C[1dS
 1  00 s   AAAc                R    V ^8  d   QhR\         R\        \         \         3,          /# )   env_varreturn)strtuple)formats   "r+   __annotate__r4   ?   s"     & &C &E#s(O &    c                    RV 9  d,   \         P                  R4       \        P                  ! ^4       V P	                  R^4      w  rVP                  4       VP                  4       3# )z6Parse environment variable string in format KEY=VALUE.=z6Invalid environment variable format. Must be KEY=VALUE)loggererrorr&   exitsplitstrip)r/   keyvalues   &  r+   _parse_env_varr?   ?   sK    
'MNsA&JC99;%%r5   c                H    V ^8  d   QhR\         \        ,          R,          /# )r.   argsN)listr1   )r3   s   "r+   r4   r4   I   s      DI$ r5   c              #     "   V eM   \         P                  R,          p \         P                  ^ ,          .V O\         n        Rx  V\         n        R# Rx  R#   T\         n        i ; i5i)a"  Temporarily replace sys.argv if args provided.

This context manager is used at the CLI boundary to inject
server arguments when needed, without mutating sys.argv deep
in the source loading logic.

Args are provided without the script name, so we preserve sys.argv[0]
and replace the rest.
N:NNN)r&   argv)rA   originals   & r+   	with_argvrF   H   sM      88A;	 +d+CHCH  CHs   A)'A A)A&&A)copyFc                j    V ^8  d   QhR\         \        \        P                  ! RRR7      3,          /# )r.   rG   z--copyz%Copy version information to clipboardr   )r   boolcycloptsr   )r3   s   "r+   r4   r4   `   s6     &K &K
8*QR	T&Kr5   c                R   R\         P                  R\        P                  P	                  R4      R\
        P                  ! 4       R\
        P
                  ! 4       R\        \         P                  ;'       g    R4      P                  4       P                  ^,          /p\        P                  ! RR7      pVP                  R	R
R7       VP                  RRR7       VP                  4        F7  w  r4VP                  VR,           \!        V4      P#                  RR4      4       K9  	  V '       d|   \%        RRRR7      pVP'                  4       ;_uu_ 4       pVP)                  V4       RRR4       \*        P,                  ! XP/                  4       4       \0        P)                  R4       R# \0        P)                  V4       \3        4       ;p'       dE   \0        P)                  4        \0        P)                  RV R24       \0        P)                  R4       R# R#   + '       g   i     L; i)z1Display version information and platform details.zFastMCP versionzMCP versionmcpzPython versionPlatformzFastMCP root path.)paddingboldleft)stylejustifycyanright:
 NF)fileforce_terminallegacy_windowsu:   [green]✓[/green] Version information copied to clipboardu3   [bold]🎉 FastMCP update available:[/bold] [green]z[/green]z-[dim]Run: pip install --upgrade fastmcp[/dim])       )r   __version__	importlibmetadatar   r'   python_versionr   __file__resolveparentsr	   grid
add_columnitemsadd_rowr1   replacer   captureprint	pypercliprG   getconsoler   )rG   infogkvplain_consolerk   newer_versions   $       r+   r   r   _   s    	7..y))11%8(113H%%'T'"2"2"9"9c:BBDLLQOD 	

6"ALLvvL.LLvwL/

			!c'3q6>>$45  T%PUV""$$" %w{{}%RSa 455=5MMOMMEm_T\] MMIJ 6 %$s   HH&	devz!Development tools for MCP serversr   r   with_editablewith_packagesinspector_versionui_portserver_portpythonwith_requirementsprojectreloadT
reload_dirmodulec                   V ^8  d   QhR\         R,          R\        \        \        ,          R,          \        P
                  ! RRR7      3,          R\        \        \         ,          R,          \        P
                  ! RR	R7      3,          R
\        \         R,          \        P
                  ! RRR7      3,          R\        \        R,          \        P
                  ! RRR7      3,          R\        \        R,          \        P
                  ! RRR7      3,          R\        \         R,          \        P
                  ! RRR7      3,          R\        \        R,          \        P
                  ! RRR7      3,          R\        \        R,          \        P
                  ! RRR7      3,          R\        \        \        P
                  ! RRRR 7      3,          R!\        \        \        ,          R,          \        P
                  ! R"R#R7      3,          R$\        \        \        P
                  ! R%R&.R'R(7      3,          R)R/# )*r.   server_specNrx   z--with-editablez\Directory containing pyproject.toml to install in editable mode (can be used multiple times)rI   ry   --with;Additional packages to install (can be used multiple times)rz   z--inspector-versionz#Version of the MCP Inspector to user{   z	--ui-portzPort for the MCP Inspector UIr|   z--server-portz'Port for the MCP Inspector Proxy serverr}   --python(Python version to use (e.g., 3.10, 3.11)r~   --with-requirements.Requirements file to install dependencies fromr   	--project2Run the command within the given project directoryr   --reloadz7Enable auto-reload on file changes (enabled by default)--no-reload)r   r   r   --reload-dir=Directories to watch for changes (default: current directory)r   --module-mMRun a Python module (python -m <module>) instead of importing a server objectrw   r0   )r1   r   rB   r   rK   r   intrJ   )r3   s   "r+   r4   r4      sS     t T
To	
	 S	DX	
	  !d
!6	
	!. d
0	
	/< d
:	
	=J d
;	
	KX !t!A	
	Yf tE	
	gt J"	
	uD T
TP	
	ER d#`	
	S` 
ar5   c                 "    \        T TT;'       g    . TTV'       d   V Uu. uF  p\        V4      NK  	  upMRVR7      w  rV'       g   VP                  P                  p\        P                  RRT RXP                  P                  RTP                  P                  RTRT/R	7        T'       g,   \        P                  R
4       \
        P                  ! ^4       Tf   Q hT'       g#   TP                  P                  4       G Rj  xL
  / pT'       d   \        T4      TR&   T'       d   \        T4      TR&   \        4       pT'       g,   \        P                  R4       \
        P                  ! ^4       RpT'       d   TRT 2,          pRRT R.pT'       d   TP!                  R4       T	'       d?   TP!                  R4       T
'       d&   T
 F  pTP#                  R\        T4      .4       K!  	  TP                  P%                  T4      p\'        \(        P*                  P-                  4       4      T,          RR/,          p\.        P0                  ! TT.TORTR7      p\
        P                  ! TP2                  4       R# u upi   \         d    \
        P                  ! ^4        ELMi ; i EL  \.        P4                   de   p\        P                  RR\        T 4      R\        T4      RTP2                  /R	7       \
        P                  ! TP2                  4        Rp?R# Rp?i\         d=    \        P                  RR\        T 4      /R	7       \
        P                  ! ^4        R# i ; i5i)zRun an MCP server with the MCP Inspector for development.

Args:
    server_spec: Python file to run, optionally with :object suffix, or None to auto-detect fastmcp.json
N)r}   ry   r~   r   editableportzStarting dev serverr   rx   ry   r{   r|   extraNo configuration availableCLIENT_PORTSERVER_PORTzbnpx not found. Please ensure Node.js and npm are properly installed and added to your system PATH.z@modelcontextprotocol/inspector@r   r
   --no-bannerr   r   r   FASTMCP_UV_SPAWNED1Tr$   envzDev server failedrZ   r9   
returncodeznpx not found. Please ensure Node.js and npm are properly installed and added to your system PATH. You may need to restart your terminal after installation.)r   r1   
deploymentr   FileNotFoundErrorr&   r:   r8   debugenvironmentr   dependenciesr9   sourceload_serverr,   appendextendbuild_commanddictosenvironrh   r(   r
   r   r)   )r   rx   ry   rz   r{   r|   r}   r~   r   r   r   r   pconfigenv_varsnpx_cmdinspector_cmdfastmcp_cmddir_pathuv_cmdr   processes   &$$$$$$$$$$$           r+   	inspectorr      s    p3'--2/8Em4mc!fm44
  ++00K
 LL;V//88V//<<w;
  	JLL56HHQK!!! --++---&)'lH]#&)+&6H]# #$LL1 HHQK9q!2 344M !%mD z* z* *H&&H'FG !+ ##11+> 2::##%&15I34OO ..m-f-

 	##$] 5  . .` (( 	K(Qall 	 	
 	 " 3{+,	 	 	
 	s   M8J J J+J #A	M8-J7 58J7 .J7 J4J7 J7 0AJ7 J7 J7 8J7 B4J7 M8J !J1-M80J11M84J7 7M5AL+%M8+M589M51M84M55M8	transporthostr   path	log_level	no_bannerskip_sourceskip_env	statelessc          *      N   V ^8  d   QhR\         R,          R\         R\        \        P                  R,          \        P
                  ! RR.RR7      3,          R	\        \         R,          \        P
                  ! R
RR7      3,          R\        \        R,          \        P
                  ! RR.RR7      3,          R\        \         R,          \        P
                  ! RRR7      3,          R\        \        R=,          R,          \        P
                  ! RR.RR7      3,          R\        \        \        P
                  ! RRR7      3,          R\        \         R,          \        P
                  ! RRR7      3,          R\        \        \         ,          R,          \        P
                  ! RR R7      3,          R!\        \        R,          \        P
                  ! R"R#R7      3,          R$\        \        R,          \        P
                  ! R%R&R7      3,          R'\        \        \        P
                  ! R(R)R7      3,          R*\        \        \        P
                  ! R+R,R7      3,          R-\        \        \        P
                  ! R.R/R0R17      3,          R2\        \        \        ,          R,          \        P
                  ! R3R4R7      3,          R5\        \        \        P
                  ! R6R7R7      3,          R8\        \        \        P
                  ! R9R:.R;R7      3,          R<R/# )>r.   r   Nserver_argsr   --transportz-tzTransport protocol to userw   r   --hostz>Host to bind to when using http transport (default: 127.0.0.1)rI   r   --portz-pz9Port to bind to when using http transport (default: 8000)r   --pathzZThe route path for the server (default: /mcp/ for http transport, /sse/ for sse transport)r   --log-levelz-lz	Log levelr   r   zDon't show the server bannerr}   r   r   ry   r   r   r   r   r   r~   r   r   r   z--skip-sourcezBSkip source preparation step (use when source is already prepared)r   
--skip-envRSkip environment configuration (for internal use when already in a uv environment)r   r   r   z5Enable auto-reload on file changes (development mode))r   r   r   r   r   r   --statelessz>Run in stateless mode (no session, used internally for reload)r   r   r   r   r0   )DEBUGINFOWARNINGERRORCRITICAL)r1   r   
run_moduleTransportTyperK   r   r   r   rJ   rB   r   )r3   s   "r+   r4   r4   Q  s\    s stss   4'&,	
	s d
Q	
	s" d
D!L	
	#s0 d
m	
	1s> ?@4G&	
	?sL =/MN	PMsT d
;	
	Usb S	DX	
	csn tE	
	os| !t!A	
	}sJ U	
	KsX e	
	Ysf "H	
	gsv T
TP	
	wsD Q	
	EsR d#`	
	Ss` 
asr5   c               t  "   V'       Ed    V f,   \         P                  R4       \        P                  ! ^4       . pV'       d   VP	                  R4       V'       d   VP	                  R4       V'       d   VP	                  R4       V'       d   VP	                  R4       V'       d)   \         P                  RRP                  V4       R	24       RpV'       gR   \        4       '       gB   ^ R
IH	p T! TT;'       g    RV
V	R7      pR.pVP                  V4      V8w  d   VP                  pV'       d   RRV RR.pV'       d   VP                  RV.4       V'       d   VP	                  R4       Ve   VP	                  R4       V'       d#   VP	                  R4       VP                  V4       Ve	   V! V4      p\        P                  ! VVRR7      G Rj  xL
  R# \        P                  ! T TV'       d   \        V4      MRR7       R# V'       g   \        4       '       d   Rp \!        T TT;'       g    . T
T	TTTTTV'       d   \        V4      MRR7      w  pp T;'       g    XP$                  P&                  pT;'       g    XP$                  P(                  pT;'       g    XP$                  P*                  pT;'       g    XP$                  P,                  pT;'       g    XP$                  P.                  pT;'       g    XP$                  P0                  pV'       d   TM\2        P4                  P6                  '       * p\         P9                  RRT RTRTRTRTRTR V'       d   \        V4      M. /R!7       V'       Ed   VR"8X  d   \         P                  R#4       EMRRV .pV'       d   VP                  RV.4       VR$8w  d[   V'       d   VP                  RV.4       V'       d   VP                  R\;        V4      .4       V'       d   VP                  RV.4       V'       d   VP                  RV.4       V'       d   VP	                  R4       VP	                  R4       VP	                  R%4       R.pXP<                  P                  V4      V8g  ;'       d    V'       * p V '       d   VP	                  R4       V'       d#   VP	                  R4       VP                  V4       V '       d   VP<                  P                  V4      pVR/9   p!\        P                  ! VVV!R7      G Rj  xL
  R# R.pXP<                  P                  V4      V8g  ;'       d    V'       * p V '       Ed   RRV .p"V'       d   V"P                  RV.4       VR$8w  d[   V'       d   V"P                  RV.4       V'       d   V"P                  R\;        V4      .4       V'       d   V"P                  RV.4       V'       d   V"P                  RV.4       V'       d   V"P	                  R4       V"P	                  R4       V'       d#   V"P	                  R4       V"P                  V4       VP<                  P                  V"4      p#\>        P@                  R&R'/,          p\         P9                  R(R)P                  V#4       24        \B        PD                  ! V#RVR*7      p$\        P                  ! V$PF                  4       R#  \        PL                  ! T TTTTTV'       d   \        V4      M. V'       * VVR.7
      G Rj  xL
  R#  ELf  \"         d    \        P                  ! ^4        ELi ; i EL5  \B        PH                   d_   p%\         PK                  R+T% 2RT R,\;        T%4      R-T%PF                  /R!7       \        P                  ! T%PF                  4        Rp%?%R# Rp%?%ii ; i L  \N         dI   p%\         PK                  R+T% 2RT R,\;        T%4      /R!7       \        P                  ! ^4        Rp%?%R# Rp%?%ii ; i5i)0ay  Run an MCP server or connect to a remote one.

The server can be specified in several ways:
1. Module approach: "server.py" - runs the module directly, looking for an object named 'mcp', 'server', or 'app'
2. Import approach: "server.py:app" - imports and runs the specified server object
3. URL approach: "http://server-url" - connects to a remote server and creates a proxy
4. MCPConfig file: "mcp.json" - runs as a proxy server for the MCP Servers in the MCPConfig file
5. FastMCP config: "fastmcp.json" - runs server using FastMCP configuration
6. No argument: looks for fastmcp.json in current directory
7. Module mode: "-m my_module" - runs the module directly via python -m

Server arguments can be passed after -- :
fastmcp run server.py -- --config config.json --debug

Args:
    server_spec: Python file, object specification (file:obj), config file, URL, or None to auto-detect
Nz2A module name is required when using --module / -mr   r   r   r   zOptions z, zL are ignored in module mode (-m). The module manages its own server startup.)UVEnvironment)r}   r   requirementsr   testr   r
   r   r   r   r   r   z--T)reload_dirsis_stdio)env_command_builder
extra_args)
r}   ry   r~   r   r   r   r   r   r   r   zRunning server or clientr   r   r   r   r   r   r   r   ssez--reload is not supported with SSE transport (sessions are lost on restart). Use streamable-http transport instead, or use --no-reload. Running without reload.stdior   r   r   zRunning command: rY   r   zFailed to run: r9   r   )
r   r   r   r   r   r   r   show_bannerr   r   )r   N)(r8   r9   r&   r:   r   warningjoinr   6fastmcp.utilities.mcp_server_config.v1.environments.uvr   r   r   r   run_with_reloadrun_module_commandrB   r   r   r   r   r   r   r   r   rA   r   settingsshow_server_bannerr   r1   r   r   r   r(   r
   r   r)   	exceptionrun_command	Exception)&r   r   r   r   r   r   r   r}   ry   r   r~   r   r   r   r   r   r   r   ignored_optionsenv_builderr   r   test_cmd
reload_cmdr   final_transport
final_host
final_port
final_pathfinal_log_levelfinal_server_argsfinal_no_bannerneeds_uvr   	inner_cmdr*   r   r   s&   &$$$$$$$$$$$$$$$$*                    r+   r
   r
   P  s<    J vLLMNHHQK &(""=1""8,""8,""8,NN499_56 7C D  ; = =  *22d.	C xH  *h6!//#UK]SJ!!=)"<=!!-0&!!,/!!$'!!+.&(4
,,
T   %% +,7tK(T	

 	 .003'--2/-8[)d
"  >>6#4#4#>#>O//**//J//**//J//**//J>>6#4#4#>#>O#==v'8'8'='= 	(8(8(K(K$K  LL";JJJ6G4 12R
   ve#NN* $UK8J!!=/"BC')%%x&<=%%xZ&AB%%x&<=!!=/"BC!!-0m,m, xH""00:hFWWx<  !!,/ !!$'!!"34#//==jI
&/9H,,
X    xH!!//9XEVVh,Hx{3	 m_=>g%  (J!78  (C
O!<=  (J!78m_=>]+& T"./   ..y9 jj0#66 	(#89	# nnS#>GHHW''(	(('))7HD!23b //'#  O>  V` ,, 		#!!%!;SV !,,   HHQ\\""		#  	!!%!;SV   HHQKK	s  A`8`8`87`8`8)1`8!`8=6`84`8`8-`8A
`8\<`87`8`8&\? 6\? \? `8%`8`8%`8`8%`8`8$A`8*`8*`81!`8`8.#`8`8-`8A`8#`83`8)`86<`82]'3-`8!`82`8?!`8!`8<#`8 `8;`8)`8 A=`8>9]* 7`8:_" _" 5_ 6_" :`8?!]$ `8#]$$`8*_?A_`8_`8 _" "`5-=`0*`80`55`8r3   outputc                   V ^8  d   QhR\         R,          R\        \        R,          \        P                  ! RR.RR7      3,          R\        \
        R,          \        P                  ! R	R
.RR7      3,          R\        \         R,          \        P                  ! RRR7      3,          R\        \        \         ,          R,          \        P                  ! RRR7      3,          R\        \
        R,          \        P                  ! RRR7      3,          R\        \
        R,          \        P                  ! RRR7      3,          R\        \        \        P                  ! RRR7      3,          RR/	# )r.   r   Nr3   --formatz-fzXOutput format: fastmcp (FastMCP-specific) or mcp (MCP protocol). Required when using -o.rw   r   --outputz-ozbOutput file path for the JSON report. If not specified, outputs to stdout when format is provided.r}   r   r   rI   ry   r   r   r   r   r   r~   r   r   r   r   r   r0   )r1   r   r   rK   r   r   rB   rJ   )r3   s   "r+   r4   r4     s    j jtj d#k	
	j td#u	
	j" d
;	
	#j0 S	DX	
	1j< tE	
	=jJ !t!A	
	KjX e	
	Yjf 
gjr5   c                 "   V'       g   \        4       '       d   Rp \        T TT;'       g    . VVR7      w  rV P                  R4      '       ds   Vfo    \        \	        V 4      4      ;_uu_ 4       p	\
        P                  ! V	4      p
RRR4       RX
9   d,   \        P                  R4       \        P                  ! ^4       R.pXP                  P                  T4      T8g  ;'       d    T'       * pT'       d   RR	T R
.pT'       d   TP                  RTP                   .4       T'       d   TP                  R\#        T4      .4       ^ RIpTP                  P                  T4      p\&        P(                  RR/,          pTP*                  ! TRTR7      p\        P                  ! TP,                  4       \        P/                  RRT RTRT'       d   \#        T4      MR/R7        T'       g,   \        P                  R4       \        P                  ! ^4       Tf   Q hTP0                  P3                  4       G Rj  xL
 p\5        T4      G Rj  xL
 pT'       dI   T'       gA   \6        P9                  R4       \6        P9                  R4       \        P                  ! ^4       TEf   \6        P9                  4        \6        P9                  R4       \6        P9                  RTP:                   24       TP<                  '       d#   \6        P9                  RTP<                   24       TP>                  '       d#   \6        P9                  RTP>                   24       TP@                  '       d,   \6        P9                  R\C        TP@                  4       24       \6        P9                  RTPD                   24       TPF                  '       d#   \6        P9                  RTPF                   24       \6        P9                  4        \6        P9                  R4       \6        P9                  R \C        TPH                  4       24       \6        P9                  R!\C        TPJ                  4       24       \6        P9                  R"\C        TPL                  4       24       \6        P9                  R#\C        TPN                  4       24       \6        P9                  4        \6        P9                  R$4       \6        P9                  R%TPP                   24       \6        P9                  R&TPR                   24       \6        P9                  4        \6        P9                  R'4       R# \U        TTT4      G Rj  xL
 pT'       d   TPV                  PY                  RRR(7       TP                  R)4      ;_uu_ 4       p	T	P[                  T4       RRR4       \        P]                  R*T 24       \6        P9                  R+T R,24       \6        P9                  R-TP:                   R.24       \6        P9                  R/TP                    24       R# \6        P9                  TP_                  R04      4       R#   + '       g   i     EL; i  \
        P                  \        3 d     ELi ; i  \         d    \        P                  ! ^4        EL i ; i EL ELy EL_  + '       g   i     EL; i  \`         da   p\        Pc                  R1T 2RT R2\#        T4      /R7       \6        P9                  R3T 24       \        P                  ! ^4        Rp?R# Rp?ii ; i5i)4a  Inspect an MCP server and display information or generate a JSON report.

This command analyzes an MCP server. Without flags, it displays a text summary.
Use --format to output complete JSON data.

Examples:
    # Show text summary
    fastmcp inspect server.py

    # Output FastMCP format JSON to stdout
    fastmcp inspect server.py --format fastmcp

    # Save MCP protocol format to file (format required with -o)
    fastmcp inspect server.py --format mcp -o manifest.json

    # Inspect from fastmcp.json configuration
    fastmcp inspect fastmcp.json
    fastmcp inspect  # auto-detect fastmcp.json

Args:
    server_spec: Python file to inspect, optionally with :object suffix, or fastmcp.json
T)r}   ry   r~   r   z.jsonN
mcpServersz4MCPConfig files are not supported by inspect commandr   r   inspectr   r   r   r   r   r   zInspecting serverr   r3   r   r   r   zG[bold red]Error:[/bold red] --format is required when using -o/--outputzL[dim]Use --format fastmcp or --format mcp to specify the output format[/dim]z[bold]Server[/bold]z  Name:         z  Version:      z  Website:      z  Icons:        z  Generation:   z  Instructions: z[bold]Components[/bold]z  Tools:        z  Prompts:      z  Resources:    z  Templates:    z[bold]Environment[/bold]z  FastMCP:      z  MCP:          z?[dim]Use --format \[fastmcp|mcp] for complete JSON output[/dim])re   exist_okwbz,Server inspection complete. Report saved to u?   [bold green]✓[/bold green] Server inspection saved to: [cyan][/cyan]z  Server: [bold]z[/bold]z
  Format: zutf-8zFailed to inspect server: r9   u3   [bold red]✗[/bold red] Failed to inspect server: )2r   r   endswithopenr   jsonloadr8   r9   r&   r:   JSONDecodeErrorr   r   r   r   r>   r1   r(   r   r   r
   r   r   r   r   r   ro   rl   r   r   website_urliconslenserver_generationinstructionstoolsprompts	resources	templatesfastmcp_versionmcp_versionr   parentmkdirwriterp   decoder   r   )r   r3   r   r}   ry   r   r~   r   r   fdatar   r   inspect_commandr(   r*   r   r   serverrp   formatted_jsonr   s   &$$$$$$$              r+   r   r     s    Z .003'--2/
 ((V^${+,,99Q<D -4'LL!WXHHQK xH!!//9XEVVh,H 	
 ""J#=>""JF#<= 	  ..?jj0#66..Dc:##$
LL;fVc&k
  \LL56HHQK!!!}}0022 %V,, &MMY MM^ HHQK >MMO MM/0MM,TYYK89||| 0?@ 01A1A0BCDzzz 0TZZ0ABCMM,T-C-C,DEF    01B1B0CDEMMO MM34MM,S_,=>?MM,S->,?@AMM,S-@,ABCMM,S-@,ABCMMO MM45MM,T-A-A,BCDMM,T-=-=,>?@MMOMMR   +664@@ MMt< T""a' # KKFvhOP MMQRXQYY`a MM,TYYKw?@MMJv||n56 MM.//89E -,,
 ((*;<   ^ 3 -f A #""  	(,{Q 	 	
 	KA3OP	sN  ]Z 'Z Y= 2Y)	:Y= ']+];]	$].B%]]([$ 0A[$ >[?[$ [
[$ [$ &B![$ 3[$ <3[$ 0A[$ F[$ ][$ .[/[$ ;6[$ 1[A>[$ ]$[$ '])Y:	4	Y= =ZZ ]ZZ ![ ][][$ 
[$ [$ [!		[$ $]/A]
]
]]zManage FastMCP projectsc                (   V ^8  d   QhR\         \        R,          \        P                  ! RR7      3,          R\         \        R,          \        P                  ! RR7      3,          R\         \        \        P                  ! RR7      3,          R	R/# )
r.   config_pathNz'Path to fastmcp.json configuration filerI   
output_dirz1Directory to create the persistent environment inr   z)Skip source preparation (e.g., git clone)r0   )r   r1   rK   r   rJ   )r3   s   "r+   r4   r4     s     T Td
 IJ	LT
 d
 ST	VT  KL	NT 
Tr5   c           	     |  "   ^ RI Hp Vf,   \        P                  R4       \        P
                  ! ^4       V fm   \        P                  ! 4       pV'       d%   \        V4      p \        P                  RV  24       M+\        P                  R4       \        P
                  ! ^4       V f   Q hV! V 4      pVP                  4       '       g/   \        P                  RV  24       \        P
                  ! ^4       Vf   Q hV! V4      p \        P                  ! V4      pVP                  VVR7      G Rj  xL
  \        P                  RV R	V  R
V R24       R#  L%  \         dR   p\        P                  RT 24       \        P                  RT 24       \        P
                  ! ^4        Rp?R# Rp?ii ; i5i)a  Prepare a FastMCP project by creating a persistent uv environment.

This command creates a persistent uv project with all dependencies installed:
- Creates a pyproject.toml with dependencies from the config
- Installs all Python packages into a .venv
- Prepares the source (git clone, download, etc.) unless --skip-source

After running this command, you can use:
fastmcp run <config> --project <output-dir>

This is useful for:
- CI/CD pipelines with separate build and run stages
- Docker images where you prepare during build
- Production deployments where you want fast startup times

Example:
    fastmcp project prepare myserver.json --output-dir ./prepared-env
    fastmcp run myserver.json --project ./prepared-env
r   NzbThe --output-dir parameter is required.
Please specify where to create the persistent environment.zUsing configuration from zxNo configuration file specified and no fastmcp.json found.
Please specify a configuration file or create a fastmcp.json.zConfiguration file not found: )r   r  u>   [bold green]✓[/bold green] Project prepared successfully in z7!
You can now run the server with:
  [cyan]fastmcp run z --project r   zFailed to prepare project: u4   [bold red]✗[/bold red] Failed to prepare project: )pathlibr   r8   r9   r&   r:   r   find_configr1   rp   exists	from_filepreparero   rl   r   )	r  r  r   r   found_configconfig_fileoutput_pathr   r   s	   &&&      r+   r"  r"    s    D  I	
 	 &224l+KKK3K=ABLLP HHQK"""{#K5k]CD!!!z"K **;7 nn#"  
 	
 	

 	L[M Z##.-{:,gO	
	
  21#67LQCPQsP   AF<A2F<<F<	,E 5E6#E F<E F9(AF4.F<4F99F<rB   )r   calldiscoverzgenerate-cli__main__ )N)NNF)D__doc__importlib.metadatar`   importlib.utilr  r   r'   r(   r&   
contextlibr   r  r   typingr   r   rK   rm   r   rich.consoler   
rich.tabler	   r   fastmcp.clir
   r   fastmcp.cli.authr   fastmcp.cli.clientr   r   r   fastmcp.cli.generater   fastmcp.cli.installr   fastmcp.cli.tasksr   fastmcp.utilities.clir   r   fastmcp.utilities.inspectr   r   r   fastmcp.utilities.loggingr   #fastmcp.utilities.mcp_server_configr   fastmcp.utilities.version_checkr   r8   ro   Appr_   appr,   r?   rF   commandr   dev_appr   r   project_appr"  __name__r)  r5   r+   <module>rB     s   '    	   
 %  %        ) % K K 5 + ' T 
 1 ? C	E	
)ll		Q,&  , &K
 	&K &KT ,,E(K
L 	 	 	, 	-: 	;H 	IV 	Wd 	er 	sB 	CP 	Q^ 	_ D s 	s  	!s. 	/s< 	=sJ 	KsR 	Ss` 	asl 	msz 	{sH 	IsV 	Wsd 	est 	usB 	CsP 	Qs^ 	_s sl j 	j  	!j. 	/j: 	;jH 	IjV 	Wjd 	ej j\ ll	0IJ T Tp G  K  K  I  Lv & Lv & : .  ~ 6 H  zE r5   