Agent skill

MCP Server Patterns

by affaan-m in affaan-m/ECC

Build MCP servers with Node/TypeScript SDK — tools, resources, prompts, Zod validation, stdio vs Streamable HTTP.

MITAuto-check passedAgent Workflows

Install MCP Server Patterns

skills CLI
$ npx skills add affaan-m/ECC --skill mcp-server-patterns -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install affaan-m/ECC mcp-server-patterns --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/affaan-m/ECC.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/mcp-server-patterns .claude/skills/mcp-server-patterns && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
mcp-server-patterns
GitHub stars
276k
Used in
5 other repos
Token cost
~1k tokens
SKILL.md length
484 words
Files
1
Skills in repo
673
Repo updated
First seen
Licence
MIT

At a glance

Build MCP servers with Node/TypeScript SDK — tools, resources, prompts, Zod validation, stdio vs Streamable HTTP.

  • Debugging an MCP server — tools
  • SKILL.md covers When to Use, How It Works, Examples and Best Practices, plus 1 more section
  • Calls npm
  • Transport choice

What it does

MCP Server Patterns is an agent skill from affaan-m/ECC. Build MCP servers with Node/TypeScript SDK — tools, resources, prompts, Zod validation, stdio vs Streamable HTTP. Use Context7 or official MCP docs for latest API. Use when building or debugging an MCP server — tools, resources, prompts, validation, or transport choice.

Its SKILL.md is about 1k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Agent Workflows, covering MCP servers and Forms and validation. It works with Model Context Protocol, TypeScript and Zod. The repository describes itself as: The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond. The licence is MIT.

When your agent uses it

  • Debugging an MCP server — tools
  • Transport choice

Example prompts

  • “/mcp-server-patterns”

Requirements

  • Node.js

What it can do on your machine

Read from SKILL.md and the folder at commit ef648e0. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • npm

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • modelcontextprotocol.io

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

MCP Server Patterns loads about 1k tokens when it runs. Until then it costs about 73 tokens; SKILL.md has 484 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~73
When it runs · the whole SKILL.md, loaded when a task matches
~1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from affaan-m/ECC at commit ef648e0, republished under its MIT licence (© affaan-m). 484 words, ~1,046 tokens.

Download SKILL.mdSave it as .claude/skills/mcp-server-patterns/SKILL.md (or your agent's skills folder).
name
mcp-server-patterns
description
Build MCP servers with Node/TypeScript SDK — tools, resources, prompts, Zod validation, stdio vs Streamable HTTP. Use Context7 or official MCP docs for latest API. Use when building or debugging an MCP server — tools, resources, prompts, validation, or transport choice.
metadata.origin
ECC

MCP Server Patterns

The Model Context Protocol (MCP) lets AI assistants call tools, read resources, and use prompts from your server. Use this skill when building or maintaining MCP servers. The SDK API evolves; check Context7 (query-docs for "MCP") or the official MCP documentation for current method names and signatures.

For the broader routing decision of when a capability should be a rule, a skill, MCP, or a plain CLI/API workflow, see docs/capability-surface-selection.md.

When to Use

Use when: implementing a new MCP server, adding tools or resources, choosing stdio vs HTTP, upgrading the SDK, or debugging MCP registration and transport issues.

How It Works

Core concepts
  • Tools: Actions the model can invoke (e.g. search, run a command). Register with registerTool() or tool() depending on SDK version.
  • Resources: Read-only data the model can fetch (e.g. file contents, API responses). Register with registerResource() or resource(). Handlers typically receive a uri argument.
  • Prompts: Reusable, parameterised prompt templates the client can surface (e.g. in Claude Desktop). Register with registerPrompt() or equivalent.
  • Transport: stdio for local clients (e.g. Claude Desktop); Streamable HTTP is preferred for remote (Cursor, cloud). Legacy HTTP/SSE is for backward compatibility.

The Node/TypeScript SDK may expose tool() / resource() or registerTool() / registerResource(); the official SDK has changed over time. Always verify against the current MCP docs or Context7.

Connecting with stdio

For local clients, create a stdio transport and pass it to your server’s connect method. The exact API varies by SDK version (e.g. constructor vs factory). See the official MCP documentation or query Context7 for "MCP stdio server" for the current pattern.

Keep server logic (tools + resources) independent of transport so you can plug in stdio or HTTP in the entrypoint.

Show full SKILL.md (205 more words)Show less
Remote (Streamable HTTP)

For Cursor, cloud, or other remote clients, use Streamable HTTP (single MCP HTTP endpoint per current spec). Support legacy HTTP/SSE only when backward compatibility is required.

Examples

Install and server setup
bash
npm install @modelcontextprotocol/sdk zod
typescript
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { z } from "zod";

const server = new McpServer({ name: "my-server", version: "1.0.0" });

Register tools and resources using the API your SDK version provides: some versions use server.tool(name, description, schema, handler) (positional args), others use server.tool({ name, description, inputSchema }, handler) or registerTool(). Same for resources — include a uri in the handler when the API provides it. Check the official MCP docs or Context7 for the current @modelcontextprotocol/sdk signatures to avoid copy-paste errors.

Use Zod (or the SDK’s preferred schema format) for input validation.

Best Practices

  • Schema first: Define input schemas for every tool; document parameters and return shape.
  • Errors: Return structured errors or messages the model can interpret; avoid raw stack traces.
  • Idempotency: Prefer idempotent tools where possible so retries are safe.
  • Rate and cost: For tools that call external APIs, consider rate limits and cost; document in the tool description.
  • Versioning: Pin SDK version in package.json; check release notes when upgrading.

Official SDKs and Docs

  • JavaScript/TypeScript: @modelcontextprotocol/sdk (npm). Use Context7 with library name "MCP" for current registration and transport patterns.
  • Go: Official Go SDK on GitHub (modelcontextprotocol/go-sdk).
  • C#: Official C# SDK for .NET.

© affaan-m, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/mcp-server-patterns of affaan-m/ECC.

Open the folder on GitHubat commit ef648e0

Used in 5 other repositories

We found 16 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 5 other GitHub owners. This page covers the copy in affaan-m/ECC, which our catalogue first saw on October 9, 2026.

Compare with similar skills

MCP Server Patterns next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

MCP Server Patterns compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
MCP Server Patterns this skillaffaan-m/ECC276k5 repos~1kAutomated safety check: PassMIT
MCP SDK Auditawdr74100/figwright995—~4.1kAutomated safety check: PassMIT
Vscode MCP Tool Developmenttjx666/vscode-mcp105—~1.5kAutomated safety check: PassCustom licence
MCP DeveloperJeffallan/claude-skills12k—~1.5kAutomated safety check: PassMIT
Typescript MCP Server Generatorgithub/awesome-copilot40k—~1.7kAutomated safety check: PassMIT
Typescript Styletjx666/vscode-mcp105—~961Automated safety check: PassCustom licence

Similar skills

  • MCP SDK Audit

    awdr74100/figwright

    Upgrade @modelcontextprotocol/server (the MCP TypeScript SDK v2) and prove the wire contract survived.

    995 GitHub stars~4.1k tokensUpdated today
    Agent WorkflowsAuto-check passed
  • End-to-end workflow for adding, modifying, or debugging VSCode MCP tools in this repo — IPC zod schema and EventMap, bridge service registration, core ToolDefinition and tool constants, MCP/CLI…

    105 GitHub stars~1.5k tokensUpdated 2 mo ago
    Agent WorkflowsAuto-check passed
  • MCP Developer

    Jeffallan/claude-skills

    Builds and debugs MCP servers and clients in TypeScript or Python, from tool and resource definitions to transport setup and inspector-based protocol checks.

    12k GitHub stars~1.5k tokensUpdated 6 days ago
    Agent WorkflowsAuto-check passed
  • Typescript MCP Server Generator

    github/awesome-copilot

    Official

    Generate a complete MCP server project in TypeScript using the MCP TypeScript SDK v2 (@modelcontextprotocol/server) with tools, resources, and proper configuration

    40k GitHub stars~1.7k tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Typescript Style

    tjx666/vscode-mcp

    TypeScript code style and repo conventions for VSCode MCP — inference vs explicit types, ESM import suffixes, zod schema contracts, async VSCode/Node APIs, JSON-safe IPC results, JSDoc for public…

    105 GitHub stars~961 tokensUpdated 2 mo ago
    DevelopmentAuto-check passed
  • OpenAPI to MCP Server

    mcp-use/mcp-use

    Turns an OpenAPI or Swagger spec into an MCP server with the mcp-use TypeScript SDK, mapping each operation to a tool, wiring auth, testing and deploying.

    11k GitHub stars~5.2k tokensUpdated today
    Backend & APIsAuto-check passed

More from affaan-m/ECC

All 673 skills in this repo
  • Skill Stocktake

    affaan-m/ECC

    Audits your installed Claude skills and commands for quality, with a quick mode for recently changed skills and a full mode that evaluates all of them through subagents.

    276k GitHub starsUsed in 5 repos~1.9k tokens
    Auto-check passed
  • Ingests, indexes, searches, edits and monitors video, audio and live streams through the VideoDB Python SDK, returning stream links, clips and timestamps.

    276k GitHub starsUsed in 3 repos~3.5k tokens
    Auto-check: notes
  • Rules Distillation

    affaan-m/ECC

    Scans installed skills for principles that recur across them and proposes rule-file changes: append, revise, add a section, create a file or leave as covered.

    276k GitHub starsUsed in 2 repos~2.3k tokens
    Auto-check passed
  • Builds DRAFT counterparty agreements from one markdown template and a small JSON spec per party, with clauses picked by the party's role.

    276k GitHub stars~2.9k tokensUpdated 4 days ago
    Auto-check passed
  • Measures whether agents actually follow a skill, rule or agent definition by generating scenarios at three strictness levels and scoring tool-call traces.

    276k GitHub starsUsed in 1 repo~623 tokens
    Auto-check passed
  • Instinct-based learning system that observes sessions via hooks, creates atomic instincts with confidence scoring, and evolves them into skills/commands/agents.

    276k GitHub stars~3.5k tokensUpdated 4 days ago
    Auto-check passed

Categories

Questions about MCP Server Patterns

What does MCP Server Patterns do?

Build MCP servers with Node/TypeScript SDK — tools, resources, prompts, Zod validation, stdio vs Streamable HTTP. MCP Server Patterns is an agent skill from affaan-m/ECC. Build MCP servers with Node/TypeScript SDK — tools, resources, prompts, Zod validation, stdio vs Streamable HTTP.

When should I use MCP Server Patterns?

MCP Server Patterns fits situations like: debugging an MCP server — tools; transport choice.

How do I install MCP Server Patterns in Claude Code?

Run `npx skills add affaan-m/ECC --skill mcp-server-patterns -a claude-code`. Or copy the skill folder (skills/mcp-server-patterns in affaan-m/ECC) into .claude/skills/mcp-server-patterns in your project. Claude Code loads it when a task matches its description.

How do I install MCP Server Patterns in Codex?

Run `npx skills add affaan-m/ECC --skill mcp-server-patterns -a codex`. Or copy the skill folder (skills/mcp-server-patterns in affaan-m/ECC) into .agents/skills/mcp-server-patterns in your project. Codex loads it when a task matches its description.

Can I use MCP Server Patterns in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add affaan-m/ECC --skill mcp-server-patterns -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/mcp-server-patterns, .gemini/skills/mcp-server-patterns, .github/skills/mcp-server-patterns and .opencode/skills/mcp-server-patterns in your project.

What does MCP Server Patterns need to run?

Going by SKILL.md and its folder, MCP Server Patterns needs the command-line tools its instructions call (npm). Our summary lists: Node.js.

Does MCP Server Patterns access the network?

SKILL.md names 1 domain. As links in the text: modelcontextprotocol.io. This is read from the text; nothing was executed.

Is MCP Server Patterns safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does MCP Server Patterns use?

MCP Server Patterns is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does MCP Server Patterns use?

About 1k tokens (SKILL.md is roughly 4.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to MCP Server Patterns?

Skills that share tags, products or a category with MCP Server Patterns: MCP SDK Audit (awdr74100/figwright, 995 stars), Vscode MCP Tool Development (tjx666/vscode-mcp, 105 stars), MCP Developer (Jeffallan/claude-skills, 12k stars) and Typescript MCP Server Generator (github/awesome-copilot, 40k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains MCP Server Patterns?

affaan-m (a GitHub user) maintains it in affaan-m/ECC, which has 275,546 GitHub stars. The repository holds 673 skills in this directory. The repository was last updated on October 5, 2026.

Source: affaan-m/ECC on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.