From 5c1160a8cc21e9e183e421e1f0ced4ea9224b4e4 Mon Sep 17 00:00:00 2001 From: yetone Date: Sun, 4 Oct 2026 06:40:02 +0800 Subject: [PATCH] =?UTF-8?q?library:=20each=20MCP=20server=20in=20the=20Lib?= =?UTF-8?q?rary=20shows=20whether=20it=20works=20=E2=80=94=20a=20dot=20and?= =?UTF-8?q?=20a=20few=20words=20beside=20its=20name=20(12=20tools,=20needs?= =?UTF-8?q?=20sign-in,=20can't=20start:=20uvx=20not=20found,=20exited=20(1?= =?UTF-8?q?),=20no=20answer,=20connection=20refused,=20the=20server's=20HT?= =?UTF-8?q?TP=20status),=20the=20whole=20reason=20(the=20server's=20last?= =?UTF-8?q?=20stderr=20line,=20the=20status=20line)=20in=20the=20tooltip;?= =?UTF-8?q?=20checked=20once=20a=20session=20when=20the=20MCP=20list=20ope?= =?UTF-8?q?ns,=20and=20again=20by=20clicking=20it=20(Discord,=20lc:=20a=20?= =?UTF-8?q?status=20display=20for=20MCP=20servers=20in=20the=20Library=20p?= =?UTF-8?q?age)=20=E2=80=94=20POST=20/api/library/mcp/check=20{names,=20fr?= =?UTF-8?q?esh}=20runs=20library.CheckServers:=20up=20to=20four=20at=20onc?= =?UTF-8?q?e,=2015=20s=20each,=20by=20really=20connecting.=20A=20stdio=20s?= =?UTF-8?q?erver=20is=20started=20with=20its=20command,=20args=20and=20env?= =?UTF-8?q?=20(proc.Command=20+=20StartTree,=20so=20the=20whole=20tree=20i?= =?UTF-8?q?s=20ended=20after,=20Windows=20too),=20sent=20initialize=20(202?= =?UTF-8?q?5-06-18,=20clientInfo=20magpie),=20notifications/initialized=20?= =?UTF-8?q?and=20tools/list=20over=20newline=20JSON;=20a=20missing=20comma?= =?UTF-8?q?nd=20is=20"not=20found",=20an=20exit=20before=20the=20reply=20g?= =?UTF-8?q?ives=20its=20code=20and=20last=20stderr=20line.=20A=20Streamabl?= =?UTF-8?q?e=20HTTP=20server=20is=20POSTed=20the=20same=20with=20Accept:?= =?UTF-8?q?=20application/json,=20text/event-stream,=20a=20JSON=20or=20SSE?= =?UTF-8?q?=20reply=20read,=20Mcp-Session-Id=20and=20the=20negotiated=20MC?= =?UTF-8?q?P-Protocol-Version=20carried,=20magpie's=20own=20sign-in=20toke?= =?UTF-8?q?n=20sent=20when=20it=20has=20one=20and=20the=20session=20DELETE?= =?UTF-8?q?d=20after;=20401/403=20is=20"needs=20sign-in"=20(OAuth=20when?= =?UTF-8?q?=20WWW-Authenticate=20says=20so).=20A=20legacy=20SSE=20server?= =?UTF-8?q?=20is=20read=20through=20its=20endpoint=20event.=20A=20server?= =?UTF-8?q?=20without=20tools/list=20(-32601)=20is=20fine=20with=200=20too?= =?UTF-8?q?ls.=20Results=20are=20kept=20in=20memory=20for=20the=20session,?= =?UTF-8?q?=20keyed=20on=20the=20server's=20definition=20and=20sign-in=20s?= =?UTF-8?q?tate,=20so=20an=20edited=20server=20is=20checked=20again;=20not?= =?UTF-8?q?hing=20is=20written=20to=20any=20agent's=20config.=20The=20GUI?= =?UTF-8?q?=20keeps=20a=20status=20per=20server=20name,=20paints=20it=20on?= =?UTF-8?q?=20the=20row=20(a=20grid=20in=20.who=20so=20.who=20>=20.name=20?= =?UTF-8?q?stays=20as=20other=20tests=20read=20it),=20a=20checking=20state?= =?UTF-8?q?=20pulses,=20the=20click=20stops=20propagation=20so=20it=20neit?= =?UTF-8?q?her=20opens=20the=20server=20nor=20scrolls,=20and=20the=20strin?= =?UTF-8?q?gs=20are=20in=20i18n.js=20(zh).=20TestCheckStdio=20(ok=20with?= =?UTF-8?q?=203=20tools=20after=20a=20junk=20stdout=20line=20and=20a=20not?= =?UTF-8?q?ification,=20exit=203=20with=20its=20stderr,=20not=20found,=20t?= =?UTF-8?q?imeout=20ending=20the=20server=20and=20its=20child),=20TestChec?= =?UTF-8?q?kHTTP=20(JSON=20and=20SSE=20replies=20with=20the=20session=20an?= =?UTF-8?q?d=20token=20carried,=20OAuth=20401,=20key=20403,=20404,=20broke?= =?UTF-8?q?n=20JSON,=20timeout,=20refused),=20TestCheckSSE=20and=20TestChe?= =?UTF-8?q?ckServersOnce=20(cached,=20fresh,=20re-run=20on=20a=20changed?= =?UTF-8?q?=20env,=20no=20file=20under=20HOME=20changed)=20use=20a=20fake?= =?UTF-8?q?=20server=20re-executed=20from=20the=20test=20binary=20and=20ht?= =?UTF-8?q?tptest,=20-race;=20library-mcp-health.test.cjs=20(en=20and=20zh?= =?UTF-8?q?:=20one=20check=20for=20all=20servers=20on=20opening,=20texts,?= =?UTF-8?q?=20tooltips,=20dot=20not=20border,=20row=20height,=20no=20re-ch?= =?UTF-8?q?eck=20on=20returning,=20a=20click=20re-checks=20only=20that=20s?= =?UTF-8?q?erver=20without=20opening=20it=20or=20moving=20the=20page,=20no?= =?UTF-8?q?=20