Skip to content
Back to skills

Add Mcp Primitive

ASecurity

Add new MCP primitives (Tool, Resource, Prompt). Use when asked to add a new tool, resource, or prompt to the MCP server.

  • 666 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 2, 2026
ai-agentstypescript

Works with

  • mcp

Security analysis

A100/100

Scanned September 2, 2026

npx -y skills add majiayu000/claude-skill-registry --skill add-mcp-primitive --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Add Mcp Primitive?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Add Mcp Primitive
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/majiayu000-add-mcp-primitive-claude-skill-registry/badge)](https://www.skillsdirectory.com/skills/majiayu000-add-mcp-primitive-claude-skill-registry)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: add-mcp-primitive
description: Add new MCP primitives (Tool, Resource, Prompt). Use when asked to add a new tool, resource, or prompt to the MCP server.
---

# Adding MCP Primitives

## Tool

1. Create feature in `src/features/<name>/<name>.ts`
2. Create definition in `src/definitions/tools/<name>.ts`
3. Register in `src/definitions/tools/index.ts`

```typescript
// 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

1. Create definition in `src/definitions/resources/<name>.ts`
2. Register in `src/definitions/resources/index.ts`

```typescript
// 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

1. Create definition in `src/definitions/prompts/<name>.ts`
2. Register in `src/definitions/prompts/index.ts`

```typescript
// 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}` } },
    ],
  }),
});
```

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.