@skilljack/mcp
Advanced tools
@@ -7,2 +7,3 @@ /** | ||
| */ | ||
| import type { Annotations } from "@modelcontextprotocol/sdk/types.js"; | ||
| /** | ||
@@ -110,4 +111,13 @@ * Source information for a skill. | ||
| export declare function getUserInvocableSkills(skills: SkillMetadata[]): SkillMetadata[]; | ||
| /** | ||
| * Compute MCP resource annotations for a skill. | ||
| * Derives audience from effective invocation flags and sets default priority. | ||
| * | ||
| * @param skill - The skill metadata | ||
| * @param priority - Priority hint (0.0 = least important, 1.0 = most important, default 0.5) | ||
| * @returns Annotations object for use on MCP resources | ||
| */ | ||
| export declare function getResourceAnnotations(skill: SkillMetadata, priority?: number): Annotations; | ||
| export declare const SKILL_COUNT_WARNING_THRESHOLD = 50; | ||
| export declare function warnLargeSkillCount(skillCount: number): void; | ||
| export {}; |
@@ -324,2 +324,31 @@ /** | ||
| } | ||
| /** | ||
| * Compute MCP resource annotations for a skill. | ||
| * Derives audience from effective invocation flags and sets default priority. | ||
| * | ||
| * @param skill - The skill metadata | ||
| * @param priority - Priority hint (0.0 = least important, 1.0 = most important, default 0.5) | ||
| * @returns Annotations object for use on MCP resources | ||
| */ | ||
| export function getResourceAnnotations(skill, priority = 0.5) { | ||
| const clampedPriority = Number.isFinite(priority) | ||
| ? Math.max(0, Math.min(1, priority)) | ||
| : 0.5; | ||
| const audience = []; | ||
| if (skill.effectiveAssistantInvocable) { | ||
| audience.push("assistant"); | ||
| } | ||
| if (skill.effectiveUserInvocable) { | ||
| audience.push("user"); | ||
| } | ||
| const annotations = { audience, priority: clampedPriority }; | ||
| try { | ||
| const stat = fs.statSync(skill.path); | ||
| annotations.lastModified = stat.mtime.toISOString(); | ||
| } | ||
| catch { | ||
| // Skip lastModified if file cannot be stat'd | ||
| } | ||
| return annotations; | ||
| } | ||
| export const SKILL_COUNT_WARNING_THRESHOLD = 50; | ||
@@ -326,0 +355,0 @@ export function warnLargeSkillCount(skillCount) { |
@@ -21,3 +21,3 @@ /** | ||
| import { ResourceTemplate } from "@modelcontextprotocol/sdk/server/mcp.js"; | ||
| import { loadSkillContent } from "./skill-discovery.js"; | ||
| import { loadSkillContent, getResourceAnnotations } from "./skill-discovery.js"; | ||
| import { isPathWithinBase, listSkillFiles, MAX_FILE_SIZE } from "./skill-tool.js"; | ||
@@ -82,2 +82,3 @@ /** | ||
| description: `All files in ${name} skill directory`, | ||
| annotations: getResourceAnnotations(skill), | ||
| }; | ||
@@ -165,2 +166,3 @@ if (skill.metadata) { | ||
| description: skill.description, | ||
| annotations: getResourceAnnotations(skill), | ||
| }; | ||
@@ -167,0 +169,0 @@ if (skill.metadata) { |
+1
-1
| { | ||
| "name": "@skilljack/mcp", | ||
| "version": "0.8.0", | ||
| "version": "0.9.0", | ||
| "description": "MCP server that discovers and serves Agent Skills. I know kung fu.", | ||
@@ -5,0 +5,0 @@ "type": "module", |
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
996810
0.16%5376
0.77%