+
    wiK;                     $   R t ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIHt ^ RI	H
t
Ht ^ RIHt ^ RIHt  ^ RIt ^ RIHt ^ RIHt  ^ RIt]! R
4      t]P4                  ! RRRRR7      tR tR R ltR$R R lltR R ltR%R R llt ]PC                  4       R R l4       t"]PC                  4       ]PF                  ! RRR7      R. 3R R ll4       t$]PC                  4       ]PF                  ! RRR7      R3R  R! ll4       t%]PC                  4       ]PF                  ! RRR7      RR. . R3R" R# ll4       t&R#   ] d    ]! R4       ]P&                  ! ^4        EL i ; i  ] d    ]! R	4       ]P&                  ! ^4        EL;i ; i  ] d    Rt ELFi ; i)&zMCP CLI tools.N)Path)	AnnotatedAny)FastMCP)Serverz=Error: typer is required. Install with 'pip install mcp[cli]')claude)
get_loggerz?Error: mcp.server.fastmcp is not installed or not in PYTHONPATHclimcpzMCP development toolsFT)namehelpadd_completionno_args_is_helpc                     \         P                  R8X  d+   R F"  p  \        P                  ! V R.RRRR7       V u # 	  R# R#   \        P                   d     KB  i ; i)z5Get the correct npx command for the current platform.win32npxz	--versionT)checkcapture_outputshellN)znpx.cmdznpx.exer   )sysplatform
subprocessrunCalledProcessError)cmds    ?/home/ubuntu/.local/lib/python3.14/site-packages/mcp/cli/cli.py_get_npx_commandr   *   s\    
||w0C[1dZ^_
 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__r$   8   s"     & &C &E#s(O &    c                    RV 9  d0   \         P                  RV  R24       \        P                  ! ^4       V P	                  R^4      w  rVP                  4       VP                  4       3# )z6Parse environment variable string in format KEY=VALUE.=z%Invalid environment variable format: z. Must be KEY=VALUE)loggererrorr   exitsplitstrip)r   keyvalues   &  r   _parse_env_varr/   8   sU    
'<WIEXYZsA&JC99;%%r%   c          	          V ^8  d   QhR\         R\        R,          R\        \         ,          R,          R\        \         ,          /# )r   	file_specwith_editableNwith_packagesr    )r!   r   list)r#   s   "r   r$   r$   A   sA      $; 9t# 
#Y	r%   c                    R.pVP                  . RO4       V'       d   VP                  R\        V4      .4       V'       d'   V F   pV'       g   K  VP                  RV.4       K"  	  VP                  RRV .4       V# )zABuild the uv run command that runs an MCP server through mcp run.uvr   --withr
   --with-editable)r   r7   r
   )extendr!   )r1   r2   r3   r   pkgs   &&&  r   _build_uv_commandr;   A   sn     &CJJ'(

%s='9:; Cs

Hc?+ !
 JJui()Jr%   c                `    V ^8  d   QhR\         R\        \        \         R,          3,          /# )r   r1   r    N)r!   r"   r   )r#   s   "r   r$   r$   X   s(     $ $ $dC$J.>(? $r%   c                
   \        V 4      ^8  ;'       d    V ^,          R8H  pRV'       d
   V R,          MT 9   d   V P                  R^4      w  r#MT Rr2\        V4      P                  4       P	                  4       pVP                  4       '       g/   \        P                  RV 24       \        P                  ! ^4       VP                  4       '       g/   \        P                  RV 24       \        P                  ! ^4       WC3# )zParse a file path that may include a server object specification.

Args:
    file_spec: Path to file, optionally with :object suffix

Returns:
    Tuple of (file_path, server_object)
::r   NNNzFile not found: zNot a file: )lenrsplitr   
expanduserresolveexistsr(   r)   r   r*   is_file)r1   has_windows_drivefile_strserver_object	file_paths   &    r   _parse_file_pathrI   X   s     I*BBy|s/B  1y}yA"+"2"23":-"+T- X))+335I'	{34|I;/0##r%   c                >    V ^8  d   QhR\         R\        R,          /# )r   filerG   N)r   r!   )r#   s   "r   r$   r$   w   s"     Y Y YcDj Yr%   c                B   \        V P                  4      pV\        P                  9  d!   \        P                  P	                  ^ V4       \
        P                  P                  RV 4      pV'       d   VP                  '       g9   \        P                  RR\        V 4      /R7       \        P                  ! ^4       \
        P                  P                  V4      pVP                  P                  V4       R R lpV'       g   R F\  p\        WF4      '       g   K  V! \        WF4      V  RV 24      '       g   \        P                  RV  RV R	24       KQ  \        WF4      u # 	  \        P                  R
V  R2R\        V 4      /R7       \        P                  ! ^4       RV9   d9   VP!                  R^4      w  rx \
        P"                  ! V4      p	\        WR4      p
M\        WAR4      p
X
f=   \        P                  RV R2R\        V 4      /R7       \        P                  ! ^4       V! W4      '       g   \        P                  ! ^4       V
#   \$         d@    \        P                  RT R2R\        T 4      /R7       \        P                  ! ^4        Li ; i)zImport an MCP server from a file.

Args:
    file: Path to the file
    server_object: Optional object name in format "module:object" or just "object"

Returns:
    The server object
server_modulezCould not load modulerK   extrac                0    V ^8  d   QhR\         R\        /# )r   rG   object_name)r   r!   )r#   s   "r   r$   $_import_server.<locals>.__annotate__   s      C c r%   c           	         \        V \        4      '       gZ   \        P                  RV R\	        V 4       R\         R24       \        V \
        4      '       d   \        P                  R4       R# R# )zHelper function to check that the server object is supported

Args:
    server_object: The server object to check.

Returns:
    True if it's supported.
zThe server object z is of type z (expecting z).zXNote that only FastMCP server is supported. Low level Server class is not yet supported.FT)
isinstancer   r(   r)   typeLowLevelServerwarning)rG   rQ   s   &&r   _check_server_object,_import_server.<locals>._check_server_object   sa     -11LL-k],tMGZF[[ghogpprst-88n r%   r>   zIgnoring object 'z#' as it's not a valid server objectzNo server object found in a  . Please either:
1. Use a standard variable name (mcp, server, or app)
2. Specify the object name with file:object syntax3. If the server creates the FastMCP object within main()    or another function, refactor the FastMCP object to be a    global variable named mcp, server, or app.NzCould not import module ''zServer object 'z' not found)r
   serverapp)r!   parentr   pathinsert	importlibutilspec_from_file_locationloaderr(   r)   r*   module_from_specexec_modulehasattrgetattrr+   import_moduleImportError)rK   rG   file_dirspecmodulerX   r   module_namerQ   rM   r[   s   &&         r   _import_serverrn   w   s/    4;;Hsxx8$ >>11/4HDt{{{,VSY4GH^^,,T2FKKF#& ,Dv$$+GF,AdV1TFCSTTLL#4TF!D6Ad!efv,, - 	( /< < 3t9% 	 	
 	 m#0#6#6sA#> 	%33K@M]>F 5~m_K83t9% 	 	
 	66M)  	LL+K=:s4y)   HHQK	s   ?"I AJJc                    V ^8  d   QhRR/# )r   r    N )r#   s   "r   r$   r$      s       r%   c                      \         P                  P                  R4      p \        RV  24       R#   \         P                  P                   d&    \        R4       \
        P                  ! ^4        R# i ; i)zShow the MCP version.r
   zMCP version z+MCP version unknown (package not installed)N)r`   metadataversionprintPackageNotFoundErrorr   r*   )rs   s    r   rs   rs      s[    $$,,U3WI&'22 ;<s   -1 A A54A5.z2Python file to run, optionally with :object suffixr   c                    V ^8  d   QhR\         R\        \        R,          \        P                  ! RRRRRRR	7      3,          R
\        \
        \         ,          \        P                  ! RRR7      3,          RR/# )r   r1   r2   Nr8   -e?Directory containing pyproject.toml to install in editable modeTFr   rC   	file_okayresolve_pathr3   r7   Additional packages to installrv   r    )r!   r   r   typerOptionr4   )r#   s   "r   r$   r$      s     O OO
 tR	
	
O  S	1	
	!O. 
/Or%   c                $   \        V 4      w  r4\        P                  RR\        V4      RTRV'       d   \        V4      MRRV/R7        \	        W44      p\        VR4      '       d%   \        \        W%P                  ,           4      4      p\        WV4      p\        4       pV'       g,   \        P                  R	4       \        P                  ! ^4       \        P                  R
8H  p\        P                   ! VR.V,           RV\#        \$        P&                  P)                  4       4      R7      p	\        P                  ! V	P*                  4       R#   \        P,                   de   p
\        P                  RR\        T4      R\        T
4      RT
P*                  /R7       \        P                  ! T
P*                  4        Rp
?
R# Rp
?
i\.         d=    \        P                  RR\        T4      /R7       \        P                  ! ^4        R# i ; i)z)Run an MCP server with the MCP Inspector.zStarting dev serverrK   rG   r2   Nr3   rN   dependencieszbnpx not found. Please ensure Node.js and npm are properly installed and added to your system PATH.r   z@modelcontextprotocol/inspectorT)r   r   envzDev server failedr)   
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.)rI   r(   debugr!   rn   rf   r4   setr   r;   r   r)   r   r*   r   r   r   dictosenvironitemsr   r   FileNotFoundError)r1   r2   r3   rK   rG   r[   uv_cmdnpx_cmdr   processes   &&&        r   devr      s   4 +95D
LLCI]=S/d]	
  *46>** ]5H5H%H!IJM"9]K #$LLt HHQK '..786ARZZ%%'(	
 	##$(( 	D	Qall 	 	
 	 " 3t9%	 	 	
 	s&   
DE H&AGH9HHc                    V ^8  d   QhR\         R\        \         R,          \        P                  ! RRRR7      3,          RR/# )	r   r1   	transportNz--transportz-tz(Transport protocol to use (stdio or sse)rv   r    )r!   r   r~   r   )r#   s   "r   r$   r$   2  sN     5 55
 d
;	
	5 
5r%   c           	     X   \        V 4      w  r#\        P                  RR\        V4      RVRV/R7        \	        W#4      p/ pV'       d   WR&   VP
                  ! R/ VB  R#   \         d=    \        P                  RR\        T4      /R7       \        P                  ! ^4        R# i ; i)	a  Run an MCP server.

The server can be specified in two ways:

1. Module approach: server.py - runs the module directly, expecting a server.run() call.

2. Import approach: server.py:app - imports and runs the specified server object.



Note: This command runs the server directly. You are responsible for ensuring
all dependencies are available.

For dependency management, use `mcp install` or `mcp dev` instead.
zRunning serverrK   rG   r   rN   zFailed to run serverNrp   )
rI   r(   r   r!   rn   r   	Exception	exceptionr   r*   )r1   r   rK   rG   r[   kwargss   &&    r   r   r   1  s    2 +95D
LLCI]
  4 "+;

V "D	 	 	
 	s   +A" "AB)(B)c                .   V ^8  d   QhR\         R\        \         R,          \        P                  ! RRRR7      3,          R\        \        R,          \        P                  ! R	R
RRRRR7      3,          R\        \
        \         ,          \        P                  ! RRR7      3,          R\        \
        \         ,          \        P                  ! RRRR7      3,          R\        \        R,          \        P                  ! RRRRRRRR7      3,          RR/# )r   r1   server_nameNz--namez-nzMCustom name for the server (defaults to server's name attribute or file name)rv   r2   r8   rx   ry   TFrz   r3   r7   r}   env_varsz	--env-varz-vz)Environment variables in KEY=VALUE formatenv_filez
--env-filez-fz+Load environment variables from a .env file)r   rC   r{   dir_okayr|   r    )r!   r   r~   r   r   r4   )r#   s   "r   r$   r$   k  s-    } }}
 d
`	
	} tR	
	
}0 S	1	
	1}> S	<	
	?}N t>	
		O}f 
g}r%   c                N   \        V 4      w  rg\        P                  RR\        V4      RTRTRV'       d   \        V4      MRRV/R7       \        P
                  ! 4       '       g,   \        P                  R	4       \        P                  ! ^4       TpRp	V'       g    \        Wg4      p	V	P                  pV	'       d   \        V	R. 4      M. pV'       d   \        \!        W;,           4      4      pRpV'       g	   V'       d   / pV'       d   \"        '       dH    T\"        P$                  ! V4      P'                  4        UUu/ uF  w  rVf   K  WbK  	  upp,          pM+\        P                  R4       \        P                  ! ^4       V F  p\/        V4      w  ppVVV&   K  	  \        P0                  ! V VVVVR7      '       d   \        P3                  RV R24       R# \        P                  RV R24       \        P                  ! ^4       R#   \        \        3 d:   p
\        P                  R
R\        T
4      /R7       TP                  p Rp
?
ELRp
?
ii ; iu uppi   \(        \*        3 d0    \        P-                  R4       \        P                  ! ^4        ELi ; i)zInstall an MCP server in the Claude desktop app.

Environment variables are preserved once added and only updated if new values
are explicitly provided.
zInstalling serverrK   r   rG   r2   Nr3   rN   zClaude app not foundzFCould not import server (likely missing dependencies), using file namer)   r   zFailed to load .env filez6python-dotenv is not installed. Cannot load .env file.)r2   r3   r   zSuccessfully installed z in Claude appzFailed to install )rI   r(   r   r!   r   get_claude_config_pathr)   r   r*   rn   r   ri   ModuleNotFoundErrorstemrg   r4   r   dotenvdotenv_valuesr   OSError
ValueErrorr   r/   update_claude_configinfo)r1   r   r2   r3   r   r   rK   rG   r   r[   r   server_dependenciesenv_dictkvr   r-   r.   s   &&&&&&            r   installr   j  s4   t +95D
LLCI;]=S/d]
  	 ((**+, DF	#D8F;;D BH'&."=RS!DEF '+H8v &2F2Fx2P2V2V2X j2X$!\]2X jjH
 UV  G'0JC!HSM   ""##  	-dV>BC)$~>?W 01 	LLXA'   99D	( !k,  $$%?@HHQK sB   H (I$ ?II
I$ I".III$ $<J$#J$)NN)N)'__doc__importlib.metadatar`   importlib.utilr   r   r   pathlibr   typingr   r   
mcp.serverr   r   rV   r~   ri   rt   r*   mcp.clir   $mcp.server.fastmcp.utilities.loggingr   r   r(   Typerr\   r   r/   r;   rI   rn   commandrs   Argumentr   r   r   rp   r%   r   <module>r      s      	  
  !  /
?
 
E	kk		 	&.$>Yx   ^^A 	 	-O Od ^^A 	5 5p ^^A 	 	 	 	 	e} }w
  	
IJHHQK  	
KLHHQK  Fs4   D2 E F 2!EE!E?>E?	FF