Skip to content

feat(cli): match MCP resources globally on bare @ and show full references - #5774

Merged
wenshao merged 1 commit into
QwenLM:mainfrom
wenshao:feat/mcp-resource-global-completion
Jun 23, 2026
Merged

feat(cli): match MCP resources globally on bare @ and show full references#5774
wenshao merged 1 commit into
QwenLM:mainfrom
wenshao:feat/mcp-resource-global-completion

Conversation

@wenshao

@wenshao wenshao commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

What this PR does

Two related improvements to @-mention completion for MCP resources.

  1. Global resource matching on a bare @. Previously a resource URI only completed after you typed its server name and a colon (@myserver:…). Now a bare @<partial> with no <server>: prefix matches the partial (case-insensitively) against every discovered resource's URI and friendly name across all connected servers, surfaced alongside the file results and injected as the canonical @server:uri reference. Server-name discovery (@<partial>@server:) and the per-server path are unchanged; global matches are prepended to the file list so they stay visible without hiding files, and the bare @ (empty partial) remains a files-only view.

  2. Full, aligned resource references in the dropdown. An MCP resource row now keeps its complete server:uri reference on a single line; the description column yields the width and truncates instead. References that share a long prefix (e.g. several server:scheme://skills/… URIs) are no longer cut down to an identical , so they stay distinguishable and their descriptions line up.

Why it's needed

Resource references are long (server + scheme://path), and the dropdown previously let the description column dominate the row width, wrapping or truncating the reference so that resources sharing a prefix rendered identically and couldn't be told apart. Separately, requiring the exact server name before any resource would complete made resources hard to discover when you remember a fragment of the URI but not which server hosts it.

Reviewer Test Plan

How to verify

Configure any MCP server that exposes resources — e.g. a small stdio server whose resources/list returns a few entries with long shared-prefix URIs and descriptions. Then in the input box:

  • Type @<servername>: — every resource is listed with its full server:uri reference intact and the descriptions aligned.
  • Type a bare @<fragment> that matches a resource URI/name but is not a server name (e.g. the URI scheme) — the resources appear (prepended above files) and insert as @server:uri.
  • Confirm an unrelated @<path> still lists files, and a bare @ alone still shows files only.

Expected: full references are shown (not truncated to ) and the description truncates instead; the bare fragment surfaces matching resources across servers.

Evidence (Before & After)

Server asys-mcp-http exposing asight://skills/… resources.

Before — the @server: reference is forced to wrap onto a second line, and a bare @asight matched no resources at all:

asys-mcp-http:asight://skills/   Analyze PPU bubble (idle time) from a loaded t…
ppu_bubble_analysis

After — full references on one line with aligned descriptions, and a bare @asight (no server prefix) matches globally:

* @asys-mcp-http:
  asys-mcp-http:asight://skills/hbm_bandwidth_utilization  HBM bandwidth utilization
  asys-mcp-http:asight://skills/ppu_bubble_analysis        PPU bubble analysis
  asys-mcp-http:asight://skills/ppu_operator_performance   PPU operator performance

* @asight
  asys-mcp-http:asight://skills/hbm_bandwidth_utilization  HBM bandwidth utilization
  asys-mcp-http:asight://skills/ppu_bubble_analysis        PPU bubble analysis
  asys-mcp-http:asight://skills/ppu_operator_performance   PPU operator performance

Selecting a row inserts @asys-mcp-http:asight://skills/hbm_bandwidth_utilization.

Tested on

OS Status
🍏 macOS
🪟 Windows ⚠️
🐧 Linux ⚠️

Environment (optional)

Built bundle (npm run bundle) run as node --expose-gc dist/cli.js, against a throwaway stdio MCP server, driven in tmux. Logic covered by vitest unit tests.

Risk & Scope

  • Main risk or tradeoff: global matching scans all discovered resources (in-memory, capped at the slice already used for the per-server path) on each prefix-free @<partial> keystroke and prepends matches before file results, so a very generic short fragment can surface several resources above files. Resource counts are typically small. Ordering (resources before files) and substring-vs-prefix matching are isolated and easy to tune.
  • Not validated / out of scope: Windows/Linux (covered by CI); the per-server @server: path and slash-command completion are behavior-unchanged.
  • Breaking changes / migration notes: none. The injected reference format (@server:uri) is unchanged.

Linked Issues

Follows #5733. Refs #5601.

中文说明

这个 PR 做了什么

对 MCP 资源的 @ 提及补全做了两处相关改进。

  1. @ 的全局资源匹配。 之前资源 URI 只有在先打出服务器名加冒号(@myserver:…)之后才会补全。现在没有 <server>: 前缀的裸 @<partial> 会把这段(不区分大小写)匹配到所有已连接服务器中每个已发现资源的 URI 和友好名称,与文件结果一起呈现,并以规范的 @server:uri 引用注入。服务器名发现(@<partial>@server:)与按服务器路径都保持不变;全局匹配前插到文件列表之前以保证可见、且不隐藏文件,裸 @(空 partial)仍然是只看文件的视图。

  2. 下拉里完整、对齐的资源引用。 MCP 资源行现在把完整的 server:uri 引用保持在一行;改由描述列让出宽度并截断。共享长前缀的引用(例如多个 server:scheme://skills/… URI)不再被切成一模一样的 ,因此可以区分,描述也对齐。

为什么需要

资源引用很长(server + scheme://path),而下拉之前让描述列占据了行宽,把引用换行或截断,导致共享前缀的资源渲染得一模一样、无法区分。另外,要求先打出准确的服务器名才能补全任何资源,使得"只记得 URI 的一个片段、却不知道哪个服务器托管它"时很难发现资源。

评审测试计划

如何验证

配置任意一个暴露资源的 MCP 服务器——例如一个小的 stdio 服务器,其 resources/list 返回几条带长共享前缀 URI 和描述的条目。然后在输入框:

  • @<servername>: —— 每个资源都以完整的 server:uri 引用列出,描述对齐。
  • 打一个匹配资源 URI/名称但不是服务器名的裸 @<fragment>(例如 URI scheme)—— 资源出现(前插在文件之前)并以 @server:uri 注入。
  • 确认无关的 @<path> 仍然列文件,单独一个裸 @ 仍然只显示文件。

预期:显示完整引用(不被截成 ),改为描述截断;裸片段能跨服务器召出匹配的资源。

证据(前后对比)

服务器 asys-mcp-http 暴露 asight://skills/… 资源。

之前 —— @server: 引用被迫换行到第二行,且裸 @asight 完全匹配不到资源:

asys-mcp-http:asight://skills/   Analyze PPU bubble (idle time) from a loaded t…
ppu_bubble_analysis

之后 —— 完整引用一行显示、描述对齐,且裸 @asight(无服务器前缀)能全局匹配:

* @asys-mcp-http:
  asys-mcp-http:asight://skills/hbm_bandwidth_utilization  HBM bandwidth utilization
  asys-mcp-http:asight://skills/ppu_bubble_analysis        PPU bubble analysis
  asys-mcp-http:asight://skills/ppu_operator_performance   PPU operator performance

* @asight
  asys-mcp-http:asight://skills/hbm_bandwidth_utilization  HBM bandwidth utilization
  asys-mcp-http:asight://skills/ppu_bubble_analysis        PPU bubble analysis
  asys-mcp-http:asight://skills/ppu_operator_performance   PPU operator performance

选中某一行会插入 @asys-mcp-http:asight://skills/hbm_bandwidth_utilization

测试平台

OS Status
🍏 macOS
🪟 Windows ⚠️
🐧 Linux ⚠️

环境(可选)

构建后的 bundle(npm run bundle)以 node --expose-gc dist/cli.js 运行,对接一个临时 stdio MCP 服务器,在 tmux 中驱动。逻辑由 vitest 单测覆盖。

风险与范围

  • 主要风险/取舍:全局匹配会在每次无前缀的 @<partial> 键入时扫描所有已发现资源(内存内,沿用按服务器路径已有的 slice 上限),并把匹配前插到文件之前,因此非常宽泛的短片段可能把若干资源排到文件上方。资源数量通常很少。顺序(资源排在文件前)与子串/前缀匹配都是隔离的、易于调整。
  • 未验证/范围外:Windows/Linux(由 CI 覆盖);按服务器的 @server: 路径与斜杠命令补全行为不变。
  • 破坏性变更/迁移说明:无。注入的引用格式(@server:uri)不变。

关联 Issue

Follows #5733. Refs #5601.

…ences

Bare `@<partial>` with no `<server>:` prefix now matches resource URIs and friendly names across all connected MCP servers, surfaced alongside the file results and injected as the canonical `@server:uri` reference — so a user can pull up a resource by a memorable fragment without first recalling which server exposes it.

In the @-mention dropdown, resource rows keep the full `server:uri` reference intact on a single line, aligned, with the description column truncating instead — so resources that share a long URI prefix stay distinguishable.
@qwen-code-ci-bot

Copy link
Copy Markdown
Collaborator

Thanks for the PR!

Template looks good ✓

On direction: solid alignment with the @-mention completion story. Claude Code has iterated extensively on MCP resource autocomplete (fixing stale resources, ranking files above resources, deferring resources/list to first @-mention, etc.), and this PR fills two genuine gaps — global discovery without knowing the server name, and readable dropdown layout for long URIs. Both are real usability problems, not speculative features.

On approach: the scope feels right — two tightly related UX improvements that share test fixtures and rendering context, so splitting would create more overhead than it saves. The refactoring in useAtCompletion.ts is clean: extracting rankResourceMatch and rankResourcesToSuggestions avoids duplicating the ranking/sorting logic between per-server and global paths without over-abstracting. The CompletableResource local type avoids pulling in a core import for a structurally-simple shape — reasonable. The MIN_DESCRIPTION_WIDTH constant in SuggestionsDisplay.tsx is a simple, effective guard against description starvation. No drive-by refactors or scope creep detected.

One minor question for the author to consider (not blocking): the global scan runs on every keystroke for bare @<partial>. Resource counts are typically small as noted, but has a debounce or result-cache been considered for when users connect many MCP servers? The current approach is fine for the typical case.

Moving on to code review. 🔍

中文说明

感谢贡献!

模板完整 ✓

方向:与 @ 补全的发展方向高度一致。Claude Code 在 MCP 资源自动补全上做了大量迭代(修复过期资源、文件优先排序、延迟到首次 @ 才拉取资源列表等),本 PR 填补了两个真实的体验缺口——无需知道服务器名即可全局发现资源,以及长 URI 在下拉中可读。都是真实的可用性问题,不是臆想功能。

方案:范围合理——两个紧密相关的 UX 改进,共享测试夹具和渲染上下文,拆开反而增加开销。useAtCompletion.ts 的重构干净:提取 rankResourceMatchrankResourcesToSuggestions 避免了 per-server 和全局路径间的排序逻辑重复,又没有过度抽象。CompletableResource 本地类型避免了为一个简单结构引入 core 导入——合理。SuggestionsDisplay.tsxMIN_DESCRIPTION_WIDTH 常量简单有效地防止描述列被挤占。未发现顺手重构或范围蔓延。

一个供作者思考的小问题(不阻塞):全局扫描在裸 @<partial> 的每次按键时执行。如文中所述资源数量通常不多,但当连接了很多 MCP 服务器时是否考虑过防抖或结果缓存?当前方案在典型场景下没有问题。

进入代码审查 🔍

Qwen Code · qwen3.7-max

@qwen-code-ci-bot

Copy link
Copy Markdown
Collaborator

Code Review

Independent proposal (before reading the diff): I would have added a getGlobalResourceSuggestions() function that iterates getAllResources(), case-insensitively matches the bare @<partial> against URI and name/title, and prepends results before file suggestions. For the display, I'd make the label column width dynamic based on the longest resource reference, with a minimum description width floor.

Comparison: the PR matches this proposal almost exactly, and does it well. The key design choices are sound:

  • Extracting rankResourceMatch and rankResourcesToSuggestions as shared helpers avoids duplicating the ranking/sort/slice logic between per-server and global paths — the old per-server code had the same inline ranking function that would have been copy-pasted.
  • CompletableResource as a local structural type avoids a cross-package import for a simple shape — reasonable.
  • getGlobalMcpResourceSuggestions returns [] (not null) since these merge alongside file results — correct contract.
  • Empty partial is correctly excluded (pattern.length === 0 returns []) — bare @ stays files-only.
  • isTrustedFolder check prevents leaking resource existence in untrusted folders — matches the existing security pattern in getMcpResourceSuggestions.
  • MIN_DESCRIPTION_WIDTH = 12 in SuggestionsDisplay.tsx is a simple, effective floor.
  • The suggestion.description condition for applying labelColumnWidth correctly scopes the column alignment to described rows (MCP resources/servers), leaving plain file rows unaffected.

Reuse check: the new rankResourcesToSuggestions properly replaces the inline ranking that was in getMcpResourceSuggestions, so no duplication was introduced. buildMcpResourceRef and matchMcpServerPrefix are reused from the existing mcpResourceRef module. No new dependencies added.

No blockers found. The diff is focused and minimal for the stated goals.

Unit Tests

useAtCompletion.test.ts — 32/32 passed (including 5 new "Global MCP resource completion" tests)
SuggestionsDisplay.test.tsx — 5/5 passed (including 1 new "reverse mode" layout test)
TypeScript typecheck — clean (0 errors)
Build + bundle — success

The new tests cover: global URI matching, global name/title matching, resource-before-file ordering, empty @ exclusion, and untrusted-folder exclusion. The display test verifies full references aren't truncated and descriptions yield the width.

Real-Scenario Testing (tmux)

Started the bundled CLI with --mcp-config pointing at a minimal stdio MCP server exposing three asight://skills/… resources.

> @asight

  asight-report.txt

The MCP server (asys-mcp-http) showed as disconnected in the /mcp dialog — my minimal test server's stdio framing didn't fully satisfy the CLI's MCP client handshake (likely a protocol-version or capabilities negotiation detail). This is a test infrastructure limitation, not a PR code issue.

The CLI starts, renders the TUI correctly, and file @-completion works. The unit tests thoroughly cover the new logic paths (ranking, global matching, ordering, trust gating).

中文说明

代码审查

独立方案(读 diff 之前):我会新增一个 getGlobalResourceSuggestions() 函数,遍历 getAllResources(),对裸 @<partial> 做大小写不敏感的 URI 和 name/title 匹配,并将结果前插到文件建议之前。展示方面,根据最长资源引用动态计算标签列宽,设最小描述宽度下限。

对比: PR 与该方案高度一致,且实现质量高。关键设计选择合理:

  • 提取 rankResourceMatchrankResourcesToSuggestions 共享辅助函数,避免 per-server 和全局路径间排序逻辑的重复。
  • CompletableResource 作为本地结构类型,避免跨包导入——合理。
  • 全局函数返回 [](非 null),因为这些结果与文件结果合并——合约正确。
  • 空 partial 被正确排除——裸 @ 仍为纯文件视图。
  • isTrustedFolder 检查防止在非信任文件夹泄露资源存在——与已有安全模式一致。
  • MIN_DESCRIPTION_WIDTH = 12 简单有效地保护描述列。
  • suggestion.description 条件正确地将列宽对齐限定在有描述的行(MCP 资源/服务器),纯文件行不受影响。

复用检查: 新的 rankResourcesToSuggestions 正确替代了原 per-server 中的内联排序逻辑,未引入重复。无新增依赖。

未发现阻塞问题。 Diff 聚焦且对目标来说是最小改动。

单测

useAtCompletion.test.ts — 32/32 通过(含 5 个新"全局 MCP 资源补全"测试)
SuggestionsDisplay.test.tsx — 5/5 通过(含 1 个新"reverse 模式"布局测试)
TypeScript 类型检查 — 0 错误
构建 + 打包 — 成功

新测试覆盖:全局 URI 匹配、全局 name/title 匹配、资源优先于文件排序、空 @ 排除、非信任文件夹排除。展示测试验证完整引用不被截断、描述让出宽度。

真实场景测试 (tmux)

使用 --mcp-config 启动打包后的 CLI,对接一个暴露三个 asight://skills/… 资源的最小 stdio MCP 服务器。

> @asight

  asight-report.txt

MCP 服务器(asys-mcp-http)在 /mcp 管理面板显示为 disconnected ——最小测试服务器的 stdio 帧格式未完全满足 CLI 的 MCP 客户端握手要求(可能是协议版本或能力协商细节)。这是测试基础设施的限制,非 PR 代码问题。

CLI 启动正常、TUI 渲染正确、文件 @ 补全工作正常。单测充分覆盖了新逻辑路径(排序、全局匹配、顺序、信任检查)。

Qwen Code · qwen3.7-max

@qwen-code-ci-bot

Copy link
Copy Markdown
Collaborator

Stepping back to look at the whole picture: this is a clean, well-motivated PR that solves two real UX problems with MCP resource @-mention completion.

The implementation matches what I would have done independently — extract the shared ranking logic, add a global scan over getAllResources(), and fix the display column width. The diff is tight: no drive-by refactors, no speculative features, no unnecessary abstractions. The CompletableResource local type is a pragmatic choice that avoids a cross-package import dependency for a trivial shape.

The test coverage is thorough — 6 new unit tests covering the key behavioral contracts (global matching by URI and name, ordering relative to files, bare @ exclusion, trust gating) plus a display layout test verifying that long references aren't truncated. All 37 tests pass, typecheck is clean, build succeeds.

The one gap in my review is that I couldn't get a real MCP server connected in the CI environment to visually verify the dropdown behavior. The unit tests cover the logic comprehensively though, and the display test validates the rendering contract. The author reports macOS testing with screenshots showing the expected before/after behavior.

Minor note for the maintainer: the global scan runs on every keystroke for bare @<partial>. With typical resource counts (dozens, not thousands) this is negligible. If users start connecting MCP servers with hundreds of resources, a debounce or memoization layer would be a natural follow-up — not needed now.

Approval guardrail: cross-repo PR but feat type (not refactor) — guard is ok.

Approving. ✅

中文说明

从全局来看:这是一个干净、动机明确的 PR,解决了 MCP 资源 @ 补全中的两个真实 UX 问题。

实现与我独立方案高度一致——提取共享排序逻辑、新增对 getAllResources() 的全局扫描、修复展示列宽。Diff 紧凑:无顺手重构、无臆想功能、无不必要的抽象。CompletableResource 本地类型是务实的选择,避免为简单结构引入跨包依赖。

测试覆盖充分——6 个新单测覆盖关键行为合约(全局 URI/name 匹配、相对文件的排序、裸 @ 排除、信任检查),加上一个展示布局测试验证长引用不被截断。37 个测试全部通过,类型检查干净,构建成功。

审查中唯一的缺口是我没能在 CI 环境中让真实 MCP 服务器连上来做可视化验证。不过单测全面覆盖了逻辑,展示测试验证了渲染合约。作者报告了 macOS 上的测试并附了前后对比截图。

给维护者的小提示:全局扫描在每次裸 @<partial> 按键时执行。以典型资源数量(几十而非几千)来看开销可忽略。如果用户开始连接拥有数百资源的 MCP 服务器,防抖或记忆化会是自然的后续——现在不需要。

审批守卫:跨仓库 PR 但类型为 feat(非 refactor)——守卫通过。

批准 ✅

Qwen Code · qwen3.7-max

@qwen-code-ci-bot qwen-code-ci-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, looks ready to ship. ✅

@yiliang114

Copy link
Copy Markdown
Collaborator

Direction looks right — I hit the same two issues from the bare-@ side and independently landed on the same shape, so consider this a confirmation of the approach. The shared rankResourceMatch helper and the MIN_DESCRIPTION_WIDTH floor are cleaner than what I had, so I'm closing my duplicate (#5776) in favor of this one.

A few test cases from my version that might be worth folding in — each exercises a matching path the current global test doesn't:

  • Tail-only substring: @bubbleasight://skills/analyze_ppu_bubble. Confirms substring matches at the end of the URI, not just mid-string.
  • Name-only match on a different scheme: @schemadb://users/schema, where the fragment is in the friendly name and the scheme isn't asight://. Guards the name path and a non-asight resource.
  • Across two servers in one registry: a query that hits resources from two different serverNames, asserting both refs surface — confirms it's truly global, not first-server-only.

Also verified live in tmux against a real stdio MCP server (/mcp ✓ connected): @analyze / @asight / @skill all match by URL substring and mix with file results, and the server: entry no longer wraps its colon. Not blocking — just sharing the extra coverage.

* Resource → suggestion input shape. Structurally satisfied by core's
* `DiscoveredMCPResource` (typed locally to avoid a core import / rebuild).
*/
type CompletableResource = {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Suggestion] The local CompletableResource type is structurally weaker than core's DiscoveredMCPResource (Resource & { serverName }). If core ever adds a required field (e.g. mimeType) or an always-present field the picker should surface, this local shape silently accepts the drift — no compile-time canary.

The rationale in the doc comment ("avoid a core import / rebuild") is already undermined: lines 7-8 import Config, FileSearch, FileSearchFactory, and escapePath from @qwen-code/qwen-code-core, and core's barrel (packages/core/src/index.ts) re-exports * from './tools/mcp-client.js', so DiscoveredMCPResource is reachable from the same package without an extra rebuild trigger.

Suggested change
type CompletableResource = {
import type {
Config,
DiscoveredMCPResource,
FileSearch,
} from '@qwen-code/qwen-code-core';
import { FileSearchFactory, escapePath } from '@qwen-code/qwen-code-core';
import type { Suggestion } from '../components/SuggestionsDisplay.js';
import { MAX_SUGGESTIONS_TO_SHOW } from '../components/SuggestionsDisplay.js';
import { matchMcpServerPrefix, buildMcpResourceRef } from './mcpResourceRef.js';
import { t } from '../../i18n/index.js';
type CompletableResource = DiscoveredMCPResource;

(Or drop the alias entirely and use DiscoveredMCPResource at the two callsites.)

— qwen3.7-max via Qwen Code /review

})
.filter((m) => m.rank !== Infinity)
.sort((a, b) => a.rank - b.rank || a.ref.localeCompare(b.ref))
.slice(0, MAX_SUGGESTIONS_TO_SHOW * 3)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Suggestion] The * 3 headroom on MAX_SUGGESTIONS_TO_SHOW is undocumented. The reason (these candidates merge with file results downstream, and only 8 rows render, so 3× gives ~24 candidates of material) is non-obvious — a future maintainer could trim it to * 1 as an obvious-looking waste and silently degrade merge quality.

Suggested change
.slice(0, MAX_SUGGESTIONS_TO_SHOW * 3)
// 3× headroom: these candidates merge with file results; only
// `MAX_SUGGESTIONS_TO_SHOW` rows render, so the extra material keeps the
// merged top-N useful even when a file flood dominates.
.slice(0, MAX_SUGGESTIONS_TO_SHOW * 3)

— qwen3.7-max via Qwen Code /review

pattern: string,
): Suggestion[] {
if (!config) return [];
if (config.isTrustedFolder?.() === false) return [];

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Suggestion] The isTrustedFolder === false early-return in the new global path is a security boundary (prevents leaking server resource existence in untrusted folders), but unlike the equivalent gate in getMcpResourceSuggestions (lines 104-107), it carries no comment explaining the rationale. The per-server path documents it as: "Don't surface resource URIs in an untrusted folder: the read path is blocked there, so completing them would both mislead and leak the existence of a server's resources."

Mirror that comment here — otherwise a future maintainer removing this check for "consistency" with another code path would inadvertently create a resource-existence leak.

Suggested change
if (config.isTrustedFolder?.() === false) return [];
if (!config) return [];
// Don't surface resource URIs in an untrusted folder: the read path
// (`ToolRegistry.readMcpResource`) is blocked there, so completing them
// would both mislead and leak the existence of a server's resources.
if (config.isTrustedFolder?.() === false) return [];
if (pattern.length === 0) return [];

— qwen3.7-max via Qwen Code /review

@yiliang114 yiliang114 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving — built this branch and ran the full @ completion acceptance live in tmux against a real stdio MCP server (/mcp ✓ connected, 120-col). Everything behaves as intended, including the cases I flagged earlier.

What I verified on this branch's build:

Input Result
@asys-mcp server entry asys-mcp-http: on one line, colon intact (no wrap)
@analyze matches …/analyze_ppu_op + …/analyze_ppu_bubble by mid-URI substring
@asight all asight:// resources by scheme, mixed with files
@skill URI-skills resources + local .qwen/skills/ files together
@bubble tail-only substring → single resource
@schema name-only match on a db:// resource
@communication 80-char ref shown in full and its description still rendered — the MIN_DESCRIPTION_WIDTH floor holds

Real capture:

> @analyze
  asys-mcp-http:asight://skills/analyze_ppu_bubble   Analyze PPU bubble (idle time) ...
  asys-mcp-http:asight://skills/analyze_ppu_op       Analyze PPU operator performance ...

> @asys-mcp
  asys-mcp-http:  MCP resource server          <- colon on one line

> @communication
  asys-mcp-http:asight://skills/analyze_ppu_communication_overlap_and_pipeline_bubble_v2   Long URI ...

Two nice touches confirmed while testing: descriptions align into a column across described rows, and the min-description-width floor keeps the description visible even for an 80-char reference. Accepting a suggestion injects the canonical @server:uri.

Tested on macOS (🍏). Windows/Linux not exercised locally — left to CI.

@wenshao
wenshao merged commit 5aa8bf4 into QwenLM:main Jun 23, 2026
49 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants