Agent skill
setup
Post-init orientation for an MCP server built on @cyanheads/mcp-ts-core. Use after running `@cyanheads/mcp-ts-core init` to understand the project structure, conventions, and skill sync model. Also use when onboarding to an existing project for the first time.
Install this agent skill to your Project
npx add-skill https://github.com/cyanheads/mcp-ts-core/tree/main/skills/setup
Metadata
Additional technical details for this skill
- type
- workflow
- author
- cyanheads
- version
- 1.2
- audience
- external
SKILL.md
Context
This skill assumes @cyanheads/mcp-ts-core init has already run. The CLI created the project's CLAUDE.md and AGENTS.md for different agents, copied external skills to skills/, and scaffolded the directory structure with echo definitions as starting points. This skill covers what was created and what to do next.
Agent Protocol File
The init CLI generates both CLAUDE.md and AGENTS.md with the same purpose. Keep one authoritative file for the agent you actually use:
- Claude Code — keep
CLAUDE.md, discardAGENTS.md - All other agents (Codex, Cursor, Windsurf, etc.) — keep
AGENTS.md, discardCLAUDE.md
Both files serve the same purpose: project-specific agent instructions. Prefer committing one authoritative copy rather than trying to keep both in sync by hand.
For the full framework API, read:
node_modules/@cyanheads/mcp-ts-core/CLAUDE.md
Read that file once per session. It contains the exports catalog, tool/resource/prompt contracts, error codes, context API, and common import patterns.
Project Structure
What init actually creates:
CLAUDE.md # Agent protocol (project-specific)
AGENTS.md # Alternate agent protocol file — keep the one your agent uses
.github/ISSUE_TEMPLATE/ # GitHub issue templates (bug report, feature request)
skills/ # Project skills (source of truth)
src/
index.ts # createApp() entry point
mcp-server/
tools/definitions/
echo.tool.ts # Echo tool (starter — replace when ready)
resources/definitions/
echo.resource.ts # Echo resource (starter — replace when ready)
prompts/definitions/
echo.prompt.ts # Echo prompt (starter — replace when ready)
Add these as needed:
src/
worker.ts # createWorkerHandler() — only for Cloudflare Workers
config/
server-config.ts # Server-specific env vars (own Zod schema)
services/
[domain]/
[domain]-service.ts # Init/accessor pattern
types.ts
Scaffolded Echo Definitions
The init creates echo definitions for tools, resources, and prompts. They're functional examples with inline comments explaining conventions. After init:
- Clean up what you don't need. If your server has no prompts, the echo prompt definition and its registration in
src/index.tscan go. Same for resources. - Rename and replace what you keep. The echo definitions show the pattern — swap them out for your real tools/resources/prompts.
- Definitions register directly in
src/index.ts. No barrel files, just import and add to the arrays.
Conventions
| Convention | Rule |
|---|---|
| File names | kebab-case |
| Tool/resource/prompt names | snake_case, prefixed with server name (e.g. tasks_fetch_list) |
| File suffixes | .tool.ts, .resource.ts, .prompt.ts |
| Imports (framework) | @cyanheads/mcp-ts-core and subpaths |
| Imports (server code) | @/ path alias for src/ |
Skill Sync
Copy all project skills into your agent's skill directory so they're available as context. skills/ is the source of truth.
For Claude Code:
mkdir -p .claude/skills && cp -R skills/* .claude/skills/
For other agents (Codex, Cursor, Windsurf, etc.) — copy to the equivalent directory (e.g., .codex/skills/, .cursor/skills/).
After the initial copy, use the maintenance skill to keep them in sync after package updates.
Project Scaffolding
After installing dependencies (prefer bun install; npm install also works), complete these one-time setup tasks:
- Update dependencies to latest —
bun update --latest(ornpx npm-check-updates -u && npm installif using npm). The scaffoldedpackage.jsonpins minimum versions from when the framework was published; updating ensures you start with the latest compatible releases. - Initialize git —
git init && git add -A && git commit -m "chore: scaffold from @cyanheads/mcp-ts-core" - Verify agent protocol placeholders — if the
initCLI was run without a[name]argument,{{PACKAGE_NAME}}may remain as a literal inCLAUDE.md/AGENTS.mdandpackage.json. Replace it with the actual server name.
Checklist
- Agent protocol file selected — keep one authoritative file (
CLAUDE.mdorAGENTS.md) -
{{PACKAGE_NAME}}placeholders replaced in agent protocol file (if not auto-substituted by init) - Core framework CLAUDE.md read (
node_modules/@cyanheads/mcp-ts-core/CLAUDE.md) - Unused echo definitions cleaned up (and unregistered from
src/index.ts) - Skills copied to agent directory (
cp -R skills/* .claude/skills/or equivalent) - Project structure understood (definitions directories, entry point)
-
bun run devcheckpasses - If new server: proceed to
design-mcp-serverskill to plan the tool surface
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
add-resource
Scaffold a new MCP resource definition. Use when the user asks to add a resource, expose data via URI, or create a readable endpoint.
field-test
Exercise tools, resources, and prompts with real-world inputs to verify behavior end-to-end. Use after adding or modifying definitions, or when the user asks to test, try out, or verify their MCP surface. Calls each definition with realistic and adversarial inputs and produces a report of issues, pain points, and recommendations.
release
Verify release readiness and publish. The git wrapup protocol handles version bumps, changelog, README, commits, and tagging during the coding session. This skill verifies nothing was missed, runs final checks, and presents the irreversible publish commands.
add-export
Add a new subpath export to the @cyanheads/mcp-ts-core package. Use when creating a new public API surface that consumers import from a dedicated subpath (e.g., @cyanheads/mcp-ts-core/newutil).
api-errors
McpError constructor, JsonRpcErrorCode reference, and error handling patterns for `@cyanheads/mcp-ts-core`. Use when looking up error codes, understanding where errors should be thrown vs. caught, or using ErrorHandler.tryCatch in services.
api-utils
API reference for all utilities exported from `@cyanheads/mcp-ts-core/utils`. Use when looking up utility method signatures, options, peer dependencies, or usage patterns.
Didn't find tool you were looking for?