mirror of
https://git.openapi.site/https://github.com/desirecore/market.git
synced 2026-12-05 21:39:23 +08:00
docs: 自建 MCP 指南的连接测试显式传 timeout / Pass an explicit timeout to MCP connection tests (#281)
## 中文 ### 背景 DesireCore 主仓 [desirecore/desirecore#6228](https://github.com/desirecore/desirecore/pull/6228)(ADR-366)把 stdio MCP 服务端的连接测试期限从 30 秒改为 120 秒:uvx / npx 首次启动要先下载依赖,30 秒常常不够。测试结果要等子进程回收后才返回,最长约 130 秒。 内置技能「自建 Tool 与 MCP」(`tool-mcp-authoring`)的 MCP 服务参考引导 Agent 经 `HttpRequest` 调 `POST /api/mcp/test-connection`,但没有写 `timeout`。`HttpRequest` 缺省 30 秒,会先于服务端测试结束:Agent 只看到「请求超时」,看不到期限说明、stderr 尾部与启动未完成提示。 ### 改动 - `references/mcp-server.zh-CN.md`、`references/mcp-server.md`:test-connection 调用补一句:首次启动可能约两分钟才返回,经 `HttpRequest` 调用时传 `timeout: 150000`。中英两份内容一致。 - 技能版本 1.0.1 → 1.0.2(`SKILL.md` 与 `catalog-metadata.v1.json`),市场版本 1.5.25 → 1.5.26。 旧客户端的连接测试仍是 30 秒,多传 `timeout` 不影响它们。 ### 验证 - `validate-i18n.py`:0 个错误 - `validate_catalog_metadata.py --require-complete`:0 个错误 - `translate.py --check`:退出码 0;技能正文与元数据字符串没有变,翻译哈希仍然有效 - diff 不含凭据,内容与客户无关 主仓的 `defaults/market.zip` 不在本 PR 范围内,合入后再另行运行 `npm run sync-market`。 ## English ### Background DesireCore [desirecore/desirecore#6228](https://github.com/desirecore/desirecore/pull/6228) (ADR-366) raises the connection-test deadline for stdio MCP servers from 30 to 120 seconds, because uvx / npx often need longer than 30 seconds to download dependencies on first launch. The result is returned only after the child process is reclaimed, so it can take about 130 seconds. The MCP server reference of the built-in "Self-authored Tools and MCP" skill (`tool-mcp-authoring`) tells the Agent to call `POST /api/mcp/test-connection` through `HttpRequest` without a `timeout`. `HttpRequest` defaults to 30 seconds and gives up before the server-side test finishes. The Agent then sees only "request timed out" and never gets the deadline message, the stderr tail or the startup hint. ### Changes - `references/mcp-server.zh-CN.md` and `references/mcp-server.md`: the test-connection call now says a first launch can take about two minutes and that `HttpRequest` calls should pass `timeout: 150000`. Both languages say the same thing. - Skill version 1.0.1 → 1.0.2 (`SKILL.md` and `catalog-metadata.v1.json`); market version 1.5.25 → 1.5.26. Older clients still use a 30-second connection test; the extra `timeout` does not affect them. ### Validation - `validate-i18n.py`: 0 errors - `validate_catalog_metadata.py --require-complete`: 0 errors - `translate.py --check`: exit code 0; the skill body and metadata strings are unchanged, so translation hashes stay fresh - The diff contains no credentials and stays customer-neutral Updating `defaults/market.zip` in the main repository is out of scope here; `npm run sync-market` runs separately after this merges.
This commit is contained in:
5 files changed
+5
-5
No files matched your search
@@ -4,7 +4,7 @@
|
||||
"description": "Use when the user needs to build, package or modify a custom Tool, MCP Server or device-protocol integration. Reuse existing execution and approval contracts. Requires actual runtimes, drivers/libraries and authorized devices/services; third-party licenses, deployment and costs depend on the chosen dependencies. Report missing prerequisites.",
|
||||
"license": "MIT",
|
||||
"compatibility": "Requires DesireCore 10.0.203 or newer and actually available file/execution/configuration capabilities. Runtimes, third-party drivers/libraries, hardware and hosted services are not bundled by this Skill and require their applicable license, deployment, authorization and costs. Report unavailable prerequisites.",
|
||||
"version": "1.0.1",
|
||||
"version": "1.0.2",
|
||||
"requiredClientVersion": "10.0.203",
|
||||
"type": "procedural",
|
||||
"risk_level": "medium",
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
},
|
||||
"release": {
|
||||
"state": "known",
|
||||
"version": "1.0.1",
|
||||
"version": "1.0.2",
|
||||
"versionScheme": "semver"
|
||||
},
|
||||
"timestamps": {
|
||||
|
||||
@@ -12,7 +12,7 @@ Identify the Agent Service host that accesses the device. A remote server's COM/
|
||||
|
||||
## Attach to your own Agent
|
||||
|
||||
The current McpConnectionRequest/Schema defines the accepted request. Through the current permitted local API path, optionally `POST /api/mcp/test-connection` with `{connection: <connection request>}`, then `POST /api/agents/<own-id>/mcp-servers`, for example:
|
||||
The current McpConnectionRequest/Schema defines the accepted request. Through the current permitted local API path, optionally `POST /api/mcp/test-connection` with `{connection: <connection request>}` (on first launch a stdio server may download dependencies, so the connection test can take about two minutes to return; when calling through `HttpRequest`, pass `timeout: 150000`, because the 30-second default ends before the test and returns no failure details or stderr), then `POST /api/agents/<own-id>/mcp-servers`, for example:
|
||||
|
||||
```json
|
||||
{
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
## 接入自身 Agent
|
||||
|
||||
实际连接请求由当前客户端的 McpConnectionRequest/Schema 决定。通过当前获准且可用的本机 API 路径,可以先 `POST /api/mcp/test-connection`,正文 `{connection: <连接请求>}`;再 `POST /api/agents/<自身 id>/mcp-servers`,正文例如:
|
||||
实际连接请求由当前客户端的 McpConnectionRequest/Schema 决定。通过当前获准且可用的本机 API 路径,可以先 `POST /api/mcp/test-connection`,正文 `{connection: <连接请求>}`(stdio 服务端首次启动要下载依赖时,连接测试可能约两分钟才返回;经 `HttpRequest` 调用时传 `timeout: 150000`,缺省 30 秒会先于测试结束,拿不到失败说明与 stderr);再 `POST /api/agents/<自身 id>/mcp-servers`,正文例如:
|
||||
|
||||
```json
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user