generate-mcp
This skill generates or scaffolds an MCP (Model Context Protocol) server package using the official @modelcontextprotocol/sdk. It should be used when the user asks to create an MCP server, add MCP tools, expose functionality via MCP, build a Model Context Protocol integration, or work inside a packages/mcp directory. It also applies when the user mentions "MCP", "tool for Claude", "tool for AI", "Claude integration", or wants to make core functionality available to LLM agents.
What this skill does
# MCP Server Stack
Generate an MCP server using the **official `@modelcontextprotocol/sdk`** package
running on **Bun**. The server exposes core package functionality as MCP tools.
## Defaults and Deviations
These are **team defaults**. In **execution mode**, follow them unless the project CLAUDE.md
overrides them. In **Plan mode**, suggest alternatives using the deviation protocol from
the `prototyping-skills:team-conventions` skill: state the default, name the alternative,
explain the trade-off, flag the blast radius, let the human decide.
## Team Defaults — Follow Unless Explicitly Overridden
1. **SDK**: `@modelcontextprotocol/sdk`. Not a custom implementation.
2. **Transport**: stdio for local use. Not HTTP/REST (that's what the API package is for).
3. **Runtime**: Bun. Use `Bun.env` not `process.env`.
4. **Business logic**: In `@repo/core`. MCP tool handlers are thin wrappers.
5. **Types**: From `@repo/types`. Never duplicate.
6. **Validation**: Zod schemas with `.describe()` on every parameter.
## Package Setup
```
packages/mcp/
├── src/
│ ├── index.ts # Server entry point, transport setup
│ ├── tools/ # One file per tool or tool group
│ │ └── [tool-name].ts
│ └── lib/ # Shared utilities
├── package.json
└── tsconfig.json
```
**package.json** must include:
```json
{
"type": "module",
"bin": {
"mcp-server": "./src/index.ts"
},
"scripts": {
"dev": "bun --watch src/index.ts",
"start": "bun src/index.ts",
"inspect": "bunx @modelcontextprotocol/inspector bun src/index.ts"
},
"dependencies": {
"@modelcontextprotocol/sdk": "^1",
"zod": "^3",
"@repo/types": "workspace:*",
"@repo/core": "workspace:*"
}
}
```
## Server Setup Pattern
```typescript
// src/index.ts
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
import { registerItemTools } from "./tools/items";
const server = new McpServer({
name: "my-prototype-mcp",
version: "0.1.0",
});
registerItemTools(server);
const transport = new StdioServerTransport();
await server.connect(transport);
```
## Tool Definition Pattern
Each tool file registers tools on the server instance using Zod schemas for input validation:
```typescript
// src/tools/items.ts
import { z } from "zod";
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { getItem, listItems, createItem } from "@repo/core";
export function registerItemTools(server: McpServer) {
server.tool(
"list-items",
"List all items, optionally filtered by status",
{
status: z.enum(["active", "archived"]).optional()
.describe("Filter by item status"),
limit: z.number().min(1).max(100).default(20)
.describe("Maximum number of items to return"),
},
async ({ status, limit }) => {
const items = await listItems({ status, limit });
return {
content: [{ type: "text", text: JSON.stringify(items, null, 2) }],
};
}
);
server.tool(
"get-item",
"Get a single item by its ID",
{
id: z.string().describe("The item ID to retrieve"),
},
async ({ id }) => {
const item = await getItem(id);
if (!item) {
return {
content: [{ type: "text", text: `Item not found: ${id}` }],
isError: true,
};
}
return {
content: [{ type: "text", text: JSON.stringify(item, null, 2) }],
};
}
);
server.tool(
"create-item",
"Create a new item with the given name and optional description",
{
name: z.string().min(1).describe("Name for the new item"),
description: z.string().optional().describe("Optional description"),
},
async ({ name, description }) => {
const item = await createItem({ name, description });
return {
content: [{ type: "text", text: JSON.stringify(item, null, 2) }],
};
}
);
}
```
## Resource Definition Pattern (for exposing readable data)
```typescript
server.resource(
"config",
"config://app",
"Current application configuration",
async (uri) => ({
contents: [
{
uri: uri.href,
mimeType: "application/json",
text: JSON.stringify(getConfig(), null, 2),
},
],
})
);
```
## Actor Pattern — Critical Rules
When using the actor pattern in `@repo/core` (e.g., domain entities powered by `provide()`),
these rules are **non-negotiable**:
### 1. ALL actor methods MUST be called inside `provide()` callback
```typescript
// WRONG — will throw or return undefined
const data = Entity.validate(rawData);
const summary = Entity.getSummary();
// CORRECT — always wrap in provide()
const result = Entity.provide(Entity.validate(rawData), () => ({
summary: Entity.getSummary(),
count: Entity.getCount(),
}));
```
### 2. Export actors with aliases to avoid type conflicts
```typescript
// In actors/index.ts
export { Entity as EntityActor } from "./entity";
// In parent index.ts
export { EntityActor } from "./actors";
```
### 3. Use `.passthrough()` in Zod schemas for API responses
API and MCP responses from external sources may include fields not in your schema.
Always use `.passthrough()` to avoid silently stripping data:
```typescript
export const EntitySchema = z.object({
id: z.string(),
name: z.string(),
}).passthrough();
```
### 4. Always validate before providing
```typescript
// CORRECT — validate first, then provide
Entity.provide(Entity.validate(data), () => {
// safe to call actor methods here
});
// WRONG — providing unvalidated data
Entity.provide(data, () => { /* ... */ });
```
### Actor Pattern in MCP Tool Handlers
When an MCP tool wraps a core actor, follow this pattern:
```typescript
server.tool(
"get-entity-summary",
"Get a summary of the entity including computed fields",
{
id: z.string().describe("The entity ID"),
},
async ({ id }) => {
const raw = await fetchEntity(id);
const result = EntityActor.provide(EntityActor.validate(raw), () => ({
summary: EntityActor.getSummary(),
stats: EntityActor.getStats(),
}));
return {
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
};
}
);
```
## Key Conventions
- **Tool names use kebab-case**: `list-items`, `get-item`, `create-item`.
- **Tool descriptions are written for an LLM audience.** Be specific about what the tool does, what it returns, and when to use it.
- **Zod `.describe()` on every parameter.** This becomes the parameter description in the MCP schema — LLMs rely on it heavily.
- **Zod `.passthrough()`** on schemas used for external API responses — never silently drop fields.
- **Return structured JSON as text content.** Always `JSON.stringify` with pretty-printing.
- **Error handling**: Return `{ isError: true }` with a descriptive message. Never throw unhandled exceptions.
- **One tool group per file.** Group related tools (CRUD for a resource) in the same file.
- **The MCP package is a thin wrapper.** All logic lives in `@repo/core`. Tool handlers: ~5-15 lines.
- **Actor methods only inside `provide()`.** This is the single most common mistake — never call actor methods outside the callback.
## Transport Architecture
The MCP server always uses **stdio transport** locally. The UI never connects to it directly.
- **Local dev**: MCP server is a stdio process. The **Hono API** (`packages/api`, port `3001`) wraps it and exposes REST endpoints. The Next.js UI fetches from `http://localhost:3001/api/...` — not from stdio.
- **Production**: Deploy the MCP server with an **HTTP/SSE transport** (e.g., via an MCP host or reverse proxy). The Hono layer is still the HTTP interface the UI consumes.
```
UI (Next.js :3000) → Hono API (:3001) → MCP stdio process → @repo/core
```
Never try to connect a browser or Next.js server directly to a stdio MCP process.
## Testing with MCP Inspector
Test the MCP server usRelated in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.