MCPcopy
hub / github.com/codeaashu/claude-code / extractMcpResourceMentions

Function extractMcpResourceMentions

src/utils/attachments.ts:2792–2800  ·  view source on GitHub ↗
(content: string)

Source from the content-addressed store, hash-verified

2790}
2791
2792export function extractMcpResourceMentions(content: string): string[] {
2793 // Extract MCP resources mentioned with @ symbol in format @server:uri
2794 // Example: "@server1:resource/path" would extract "server1:resource/path"
2795 const atMentionRegex = /(^|\s)@([^\s]+:[^\s]+)\b/g
2796 const matches = content.match(atMentionRegex) || []
2797
2798 // Remove the prefix (everything before @) from each match
2799 return uniq(matches.map(match => match.slice(match.indexOf('@') + 1)))
2800}
2801
2802export function extractAgentMentions(content: string): string[] {
2803 // Extract agent mentions in two formats:

Callers 1

Calls 1

uniqFunction · 0.85

Tested by

no test coverage detected