agentleFS
patonkikhpatonkikh/APES/skills/mcp/mcp-server-generator/skill.md

mcp-server-generator

Skill3 starsChanged 5 months agoMITView on GitHub

Generate a Model Context Protocol (MCP) server structure: transport layer, capability declarations, project layout, and bootstrap configuration for a new MCP integration. Use when working on scaffolding MCP servers, MCP transport setup.

  • Reads credentials

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 4 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Document why transport and runtime were chosen.

    line 49
  2. Distinctive:

    Follow MCP naming: lowercase, snake_case for tools.

    line 73
  3. Very specific:

    Never embed secrets in source.

    line 82
  4. Distinctive:

    Start with 3–5 essential tools.

    line 128
  5. Distinctive:

    Use JSON Schema for all tool input definitions.

    line 129

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
skill.md

MCP Server Generator

Purpose

Generate a Model Context Protocol (MCP) server structure: transport layer, capability declarations, project layout, and bootstrap configuration for a new MCP integration.

Input: Integration target (API, database, service), required capabilities (tools/resources/prompts), runtime preference (optional), security constraints
Output: MCP Server Scaffold Specification with directory layout, capability manifest, and implementation checklist
References: See references.md for domain cheat sheets. Examples: See examples.md for worked input/output.


Workflow

Step 1: Define server scope

CapabilityIncludedRationale
ToolsYes/NoAgent actions on external systems
ResourcesYes/NoRead-only data exposure
PromptsYes/NoReusable prompt templates
LoggingYes/NoServer lifecycle and debug

One server = one bounded domain (e.g., "GitHub issues", not "all of GitHub").

Step 2: Select transport and runtime

TransportUse case
stdioLocal IDE integration, subprocess
SSE / Streamable HTTPRemote hosted server
RuntimeFit
TypeScript (SDK)Node ecosystem, rapid iteration
Python (SDK)Data/ML integrations
OtherOnly when SDK unavailable

Document why transport and runtime were chosen.

Step 3: Design project layout

mcp-server-[name]/
├── src/
│   ├── index.ts          # Server entry, transport binding
│   ├── server.ts         # MCP server instance and capability registration
│   ├── tools/            # Tool handlers
│   ├── resources/        # Resource providers (if any)
│   └── lib/              # Shared clients, auth, validation
├── package.json / pyproject.toml
├── README.md
└── .env.example

Step 4: Declare capabilities manifest

CapabilityNameDescriptionAuth required
toolsearch_issuesSearch repo issuesOAuth token
resourcerepo://{owner}/{repo}Repository metadataOAuth token

Follow MCP naming: lowercase, snake_case for tools.

Step 5: Plan authentication and config

SecretSourceScope
API keyEnvironment variableRead-only
OAuth tokenUser-provided at connectPer-user

Never embed secrets in source. Document .env.example keys only.

Step 6: Validate

Run Validation checklist.


Decision Rules

ConditionAction
Scope spans multiple unrelated domainsSplit into separate MCP servers
Remote access requiredUse SSE/HTTP transport, not stdio only
Write operations on production dataRequire explicit confirmation tool design; flag in security review
No official API client existsPlan thin HTTP client in lib/ with rate limiting
PII exposure riskMinimize resources; add mcp-security-review before deploy
>20 tools in one serverGroup into sub-modules; consider splitting server

Validation

  • Single bounded domain scope defined
  • Transport and runtime selected with rationale
  • Project layout documented
  • Capability manifest with tool/resource names
  • Auth strategy uses environment variables, not hardcoded secrets
  • .env.example keys listed (no real values)
  • Error handling pattern defined for tool failures
  • README sections outlined (setup, config, capabilities)

Anti-patterns

  • God server — one MCP server wrapping an entire SaaS platform.
  • Secrets in repo — API keys committed to source control.
  • Undocumented tools — handlers without description and input schema.
  • stdio-only for SaaS — local transport when users need remote hosting.
  • Missing health signal — no way to verify server is correctly configured.

Best Practices

  • Start with 3–5 essential tools; expand based on usage.
  • Use JSON Schema for all tool input definitions.
  • Implement structured error responses (code, message, retryable flag).
  • Version server capabilities in README changelog.
  • Pair with mcp-tool-generator for detailed tool design.

Output Structure

# MCP Server Scaffold: [Server Name]

## Scope
[Domain boundary and capabilities included]

## Transport & Runtime
| Choice | Rationale |
|--------|-----------|

## Project Layout
[Directory tree]

## Capability Manifest
| Type | Name | Description | Auth |
|------|------|-------------|------|

## Configuration
| Variable | Required | Description |
|----------|----------|-------------|

## Implementation Checklist
- [ ] Bootstrap server entry
- [ ] Register capabilities
- [ ] Auth client in lib/
- [ ] Error handling middleware
- [ ] Integration test with MCP client

## Next Steps
[Link to tool design and security review]

Next Skills

OutcomeRecommended Skill
Design individual toolsmcp/mcp-tool-generator
Security review before deploymcp/mcp-security-review
Client integration in agent appmcp/mcp-client-generator
Implementation patternsmcp/mcp-best-practices
AI workflow integrationai/ai-workflow-builder

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.