+
    wi                     |    R t ^ RIt^ RIHt ^ RIHt ^ RIt^ RIt^ RIH	t	H
t
 ^ RIHt ^ RIHt ]RR R ll4       tR# )	aY  
Stdio Server Transport Module

This module provides functionality for creating an stdio-based transport layer
that can be used to communicate with an MCP client through standard input/output
streams.

Example usage:
```
    async def run_server():
        async with stdio_server() as (read_stream, write_stream):
            # read_stream contains incoming JSONRPCMessages from stdin
            # write_stream allows sending JSONRPCMessages to stdout
            server = await create_my_server()
            await server.run(read_stream, write_stream, init_options)

    anyio.run(run_server)
```
N)asynccontextmanager)TextIOWrapper)MemoryObjectReceiveStreamMemoryObjectSendStream)SessionMessagec                    V ^8  d   QhR\         P                  \        ,          R,          R\         P                  \        ,          R,          /# )   stdinNstdout)anyio	AsyncFilestr)formats   "D/home/ubuntu/.local/lib/python3.14/site-packages/mcp/server/stdio.py__annotate__r   "   s8     6( 6(??3$&6(OOC 4'6(    c                 a aaa"   S '       g;   \         P                  ! \        \        P                  P
                  RRR7      4      o S'       g:   \         P                  ! \        \        P                  P
                  RR7      4      o\         P                  ! ^ 4      w  op\         P                  ! ^ 4      w  poVV 3R lpVV3R lp\         P                  ! 4       ;_uu_4       GRj  xL
 pVP                  V4       VP                  V4       W#35x  RRR4      GRj  xL
  R#  L> L  + GRj  xL 
 '       g   i     R# ; i5i)z
Server transport for stdio: this communicates with an MCP client by reading
from the current process' stdin and writing to stdout.
zutf-8replace)encodingerrors)r   c                  2  <"    S;_uu_4       GR j  xL
  S  R j  xL
  p  \         P                  P                  V 4      p\        T4      pSP	                  T4      G R j  xL
  KP   LV LM  \         d&   pSP	                  T4      G R j  xL 
   R p?K  R p?ii ; i L=DR R R 4      GR j  xL 
  R #   + GR j  xL 
 '       g   i     R # ; i  \        P                   d,    \        P                  P                  4       G R j  xL 
   R # i ; i5i)N)
typesJSONRPCMessagemodel_validate_json	Exceptionsendr   r   ClosedResourceErrorlowlevel
checkpoint)linemessageexcsession_messageread_stream_writerr	   s       r   stdin_reader"stdio_server.<locals>.stdin_reader<   s     	.)))"' C C$!"'"6"6"J"J4"P
 '5W&=O,11/BBB *C % !055c::: !
 C #( *))))) (( 	...++---	.s   DC A*C B7B#A,
B#B7A.B7#B!
$B7*C ,B#.B	9B	BB	B7B	B7#B7$C /B20C 5D7C	=C >
C		C	C DC 6D
DDDDDc                    <"    S;_uu_4       GR j  xL
  S  R j  xL
  p V P                   P                  RRR7      pSP                  VR,           4      G R j  xL
  SP                  4       G R j  xL
  Ka   Lg L^ L" LDcR R R 4      GR j  xL 
  R #   + GR j  xL 
 '       g   i     R # ; i  \        P
                   d,    \        P                  P                  4       G R j  xL 
   R # i ; i5i)NT)by_aliasexclude_none
)r    model_dump_jsonwriteflushr   r   r   r   )r"   jsonr
   write_stream_readers     r   stdout_writer#stdio_server.<locals>.stdout_writerK   s     	.***-@ ) )/*22BBD_cBdD ,,td{333 ,,.((	 +)3( .A +*****
 (( 	...++---	.s   C7B4 A;B4 BBA=
B:BA?
B4B
5B;B4 =B?BBBB4 BB4 C7B1	B 
B1	)B1	+B4 /C71B4 46C4*C-+C40C73C44C7N)
r   	wrap_filer   sysr	   bufferr
   create_memory_object_streamcreate_task_group
start_soon)	r	   r
   read_streamwrite_streamr$   r/   tgr#   r.   s	   ff     @@r   stdio_serverr:   !   s      cii.>.>Yb cdszz/@/@7!ST ',&G&G&J#(-(I(I!(L%L%.. &&(((B
l#
m$'' )(((((sU   A
EBE+D*,E/)D.E#D,$E,E.E	4D75
E	 E		E)NN)__doc__r2   
contextlibr   ior   r   anyio.lowlevelanyio.streams.memoryr   r   	mcp.typesr   mcp.shared.messager   r:    r   r   <module>rC      s8   (  *    R  - 6( 6(r   