Agent skill
add-mcp-primitive
Add new MCP primitives (Tool, Resource, Prompt). Use when asked to add a new tool, resource, or prompt to the MCP server.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/development/add-mcp-primitive
SKILL.md
Adding MCP Primitives
Tool
- Create feature in
src/features/<name>/<name>.ts - Create definition in
src/definitions/tools/<name>.ts - Register in
src/definitions/tools/index.ts
// src/definitions/tools/my-tool.ts
import { defineTool } from "@/definitions/define.ts";
import { z } from "zod";
export const myTool = defineTool({
name: "my-tool",
title: "My Tool",
description: "What this tool does",
inputSchema: {
param: z.string().describe("Parameter description"),
},
handler: async ({ param }) => ({
content: [{ type: "text", text: "Result" }],
}),
});
Resource
- Create definition in
src/definitions/resources/<name>.ts - Register in
src/definitions/resources/index.ts
// src/definitions/resources/my-resource.ts
import { defineResource } from "@/definitions/define.ts";
export const myResource = defineResource({
name: "my-resource",
uri: "my-resource://path",
title: "My Resource",
description: "What this resource provides",
mimeType: "text/plain",
handler: async (uri) => ({
contents: [{ uri: uri.href, mimeType: "text/plain", text: "Content" }],
}),
});
Prompt
- Create definition in
src/definitions/prompts/<name>.ts - Register in
src/definitions/prompts/index.ts
// src/definitions/prompts/my-prompt.ts
import { definePrompt } from "@/definitions/define.ts";
import { z } from "zod";
export const myPrompt = definePrompt({
name: "my-prompt",
title: "My Prompt",
description: "What this prompt does",
argsSchema: {
topic: z.string().describe("Topic to discuss"),
},
handler: ({ topic }) => ({
messages: [
{ role: "user", content: { type: "text", text: `Discuss ${topic}` } },
],
}),
});
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?