Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsCommunityBlog
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Decocms Mcp Development

BSecurity

Build and maintain MCPs in the decocms/mcps monorepo. Covers deco HTTP server pattern (withRuntime, createPrivateTool), tool definitions, app.json config, and the two MCP types: custom server vs official external server.

9 stars
0 votes
0 copies
0 views
Added 9/22/2026
developmenttypescriptgokubernetesgitapi

Works with

cliapimcp

Security Analysis

B85/100
highPerforms destructive filesystem operations

Scanned 9/22/2026

Install to Claude Code

$npx -y skills add decocms/mcps --skill decocms-mcp-development --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Decocms Mcp Development?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Decocms Mcp Development
[![Security: B — Skills Directory](https://www.skillsdirectory.com/api/skills/decocms-decocms-mcp-development/badge)](https://www.skillsdirectory.com/skills/decocms-decocms-mcp-development)

More formats (shields.io, HTML) on the badges page.

Download with Pro
Files
SKILL.md
---
name: decocms-mcp-development
description: Build and maintain MCPs in the decocms/mcps monorepo. Covers deco HTTP server pattern (withRuntime, createPrivateTool), tool definitions, app.json config, and the two MCP types: custom server vs official external server.
---

# MCP Development — decocms/mcps

Working directory: `/Users/jonasjesus/conductor/workspaces/mcps/san-antonio` (or `/Users/jonasjesus/Documents/decocms/mcps` on main worktree)

## When to Use This Skill

- Creating a new MCP from scratch
- Adding tools to an existing MCP
- Migrating a custom MCP to an official server
- Understanding the project structure
- Fixing tool definitions, env handling, or app.json

---

## Two Types of MCPs

### Type 1: Official Server (app.json only)

The MCP runs on an external server (Cloudflare, Grain, GitHub, etc.). We only provide:
- `app.json` — connection URL, auth, metadata
- `README.md` — optional

No `package.json`, no `deploy.json` entry, no workspace entry in root `package.json`.

**Example**: `apify/`, `cloudflare-ai-gateway/`, `grain-official/`

### Type 2: Custom Server (deco HTTP)

We build and host the server. Files:
```
<mcp-name>/
  app.json          # registry metadata + connection URL
  package.json      # deps: @decocms/runtime, zod, etc.
  tsconfig.json
  server/
    main.ts         # withRuntime entry point
    tools/
      index.ts      # export const tools = [...]
      <name>.ts     # tool definitions
    lib/
      env.ts        # getApiKey(env)
      <client>.ts   # API client
    constants.ts
  shared/
    deco.gen.ts     # Env interface (auto-generated)
```

---

## Custom Server Pattern

### `server/main.ts`

```typescript
import { withRuntime } from "@decocms/runtime";
import { serve } from "@decocms/mcps-shared/serve";
import { withAuth } from "@decocms/mcps-shared/auth";
import { tools } from "./tools/index.ts";
import type { Env } from "../shared/deco.gen.ts";
export type { Env };

const runtime = withRuntime<Env>({
  tools: (env: Env) => tools.map((createTool) => createTool(env)),
});

if (runtime.fetch) { serve(withAuth(runtime.fetch)); }
```

### Authentication is mandatory

MCPs are served on public hostnames and the runtime does not authenticate the
transport: `withRuntime` exposes `/mcp` **and** `POST /mcp/call-tool/<toolId>`
to anyone who resolves the host. `createPrivateTool` is not sufficient on its
own — it only asserts that some `x-mesh-token` JWT is present, and the runtime
decodes that token with `decodeJwt`, never verifying its signature.

`withAuth` compares the request credential against the `AUTH_TOKEN`
environment variable in constant time, and reads that variable at startup — an
MCP without a secret fails to boot rather than serving anonymously.

`scripts/check-auth.ts` runs in CI and fails any MCP that serves a handler
without `withAuth(...)`, or that builds a tool with plain `createTool`.
Legacy MCPs are listed in `auth-exemptions.json`; that file is a remediation
backlog, and adding to it requires reviewer sign-off.

Overrides:

```typescript
// Authorization already carries the user's upstream API key
serve(withAuth(runtime.fetch, { header: "x-deco-mcp-auth" }));

// OAuth callbacks / provider webhooks — each needs its own protection
serve(withAuth(runtime.fetch, { publicPaths: ["/oauth/callback", "/webhooks/*"] }));
```

Provision `AUTH_TOKEN` as a site state secret (kubernetes-bun) or via
`wrangler secret put` (Cloudflare). Generate with `openssl rand -hex 32`.

### `shared/deco.gen.ts`

```typescript
export interface MeshRequestContext {
  authorization: string;
}
export interface Env {
  MESH_REQUEST_CONTEXT: MeshRequestContext;
}
```

### `server/lib/env.ts` — Reading API key

```typescript
import type { Env } from "../../shared/deco.gen.ts";

export function getApiKey(env: Env): string {
  const auth = env.MESH_REQUEST_CONTEXT?.authorization ?? "";
  return auth.startsWith("Bearer ") ? auth.slice(7) : auth;
}
```

API key always comes from `env.MESH_REQUEST_CONTEXT.authorization` (Bearer token).

### `server/tools/<name>.ts` — Tool definition

```typescript
import { createPrivateTool } from "@decocms/runtime/tools";
import type { Env } from "../../shared/deco.gen.ts";
import { z } from "zod";
import { getApiKey } from "../lib/env.ts";

export const createMyTool = (env: Env) =>
  createPrivateTool({
    name: "my_tool_name",
    description: "What this tool does",
    inputSchema: z.object({
      param: z.string().describe("Description of param"),
      optional_param: z.string().optional(),
    }),
    handler: async ({ param, optional_param }) => {
      const apiKey = getApiKey(env);
      // ... call API
      return { result: "..." };
    },
  });
```

### `server/tools/index.ts`

```typescript
import { createMyTool } from "./my-tool.ts";

export const tools = [createMyTool];
```

### `package.json`

```json
{
  "name": "<mcp-name>",
  "version": "1.0.0",
  "type": "module",
  "scripts": {
    "build": "bun run ../scripts/build-mcp.ts",
    "dev": "bun run server/main.ts"
  },
  "dependencies": {
    "@decocms/runtime": "^1.2.10",
    "zod": "^4.0.0"
  },
  "devDependencies": {
    "@decocms/mcps-shared": "workspace:*"
  }
}
```

---

## `app.json` — Registry Config

```json
{
  "scopeName": "deco",
  "name": "<mcp-name>",
  "friendlyName": "Display Name",
  "connection": {
    "type": "HTTP",
    "url": "https://sites-<mcp-name>.decocache.com/mcp"
  },
  "description": "Short description (1-2 sentences)",
  "icon": "https://...",
  "unlisted": false,
  "auth": {
    "type": "token",
    "header": "Authorization",
    "prefix": "Bearer"
  },
  "metadata": {
    "categories": ["Developer Tools"],
    "official": false,
    "tags": ["tag1", "tag2"],
    "short_description": "One-line description",
    "mesh_description": "Long description for AI agents (2-3 paragraphs)"
  }
}
```

For **official external servers**, remove the `auth` field and set `"official": true`.

---

## Adding a New MCP to the Monorepo

1. Create `<mcp-name>/` directory with files above
2. Add to root `package.json` workspaces array (alphabetical)
3. Add entry to `deploy.json` — use `platformName: "kubernetes-bun"` for deco HTTP servers, or `platformName: "cloudflare-workers"` if the MCP uses `wrangler.toml`
4. Run `bun install` to update `bun.lock`

---

## Migrating Custom MCP to Official Server

When an official HTTP server exists (e.g., `https://api.example.com/mcp`):

1. Update `app.json` — change `connection.url` to official URL, set `"official": true`
2. Remove server code: `rm -rf server/ shared/ package.json tsconfig.json`
3. Remove from `deploy.json`
4. Remove from root `package.json` workspaces
5. Run `bun install`

---

## Key Packages

| Package | Purpose |
|---------|---------|
| `@decocms/runtime` | `withRuntime`, `createPrivateTool` |
| `@decocms/mcps-shared` | `serve` utility, `withAuth` middleware |
| `zod` | Input schema validation |
| `undici` | Proxy-aware fetch, SSE streaming |

## Common Patterns

- **Timeout safety**: `const parsed = parseInt(val, 10); const timeout = Number.isNaN(parsed) ? 30000 : parsed;`
- **Country codes**: `z.string().length(2).toUpperCase().optional()`
- **SSE streaming**: Use `undici` + process remaining buffer after stream loop ends

Attribution

decocmsdecocms
View sourceMore from decocms →
SSkills DirectorySkills Directory

Your tool, in front of Claude Code builders.

3 founder slots · $299/mo · GSC-verified traffic · sponsors can never buy grades.

See placements

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 (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Your tool, in front of Claude Code builders.

3 founder slots · $299/mo · GSC-verified traffic · sponsors can never buy grades.

See placements

Related Skills

Browser Extension Developer

Use this skill when developing or maintaining browser extension code in the `browser/` directory, including Chrome/Firefox/Edge compatibility, content scripts, background scripts, or i18n updates.

284072 votes

Seo Optimizer

SEO optimization with keyword analysis, readability assessment, technical validation, content quality. Use for search rankings, blog posts, content audits, or encountering keyword density, readability scores, meta tags, schema markup errors.

2192 votes

Google Official Seo Guide

Official Google SEO guide covering search optimization, best practices, Search Console, crawling, indexing, and improving website search visibility based on official Google documentation

1862 votes

Tanstack Start

Build a full-stack TanStack Start app on Cloudflare Workers from scratch — SSR, file-based routing, server functions, D1+Drizzle, better-auth, Tailwind v4+shadcn/ui. Use whenever the user mentions TanStack Start, asks to scaffold a full-stack Cloudflare app with SSR, wants an SSR dashboard, or asks for a React 19 + Cloudflare Workers app with file-based routing and server functions — even if they don't name TanStack Start specifically. No template repo — Claude generates every file fresh per ...

9881 votes

Pentest

PTES-aligned adversarial security audit for backend, frontend, and mobile applications. Produces a CVSS-scored Hacker Report with verified PoCs and phased remediation.

5491 votes
View all in development →