init-mcp-server

A command that creates a standalone MCP server project. MCP, or Model Context Protocol, is a way for AI tools to connect to external tools and data.

In plain words
What is it for?
Use it to start a Python or TypeScript MCP server, such as one that connects an AI tool to Slack, a database, or GitHub.
Why use it?
It removes the need to build the basic project structure by hand when creating a server for others to install.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/alphaaiservice/cortex/init-mcp-server
Clone the repo
git clone --depth 1 https://github.com/alphaaiservice/cortex
Per session 121 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,868 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00121 $0.03868
Opus 5 $0.00060 $0.01934
Sonnet 5 $0.00024 $0.00774
Haiku 4.5 $0.00012 $0.00387

Measured 2d ago against content hash 6cc2da46246e, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

init-mcp-server scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

commands/init-mcp-server.md · 408 lines

How it starts

The opening of the file, as written. The whole thing — 408 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Init MCP Server — Scaffold a Standalone MCP Server Project

Create: $ARGUMENTS

This command scaffolds a standalone MCP server project — the kind you publish to PyPI/npm and other people install. For MCP servers embedded INSIDE a SaaS app (under app/ai/mcp/ of a FastAPI/NestJS/Spring Boot app), use /auto-build with AI in the FEATURE_PROFILE instead.

📖 CANONICAL REFERENCE: skills/alpha-architecture/references/CODE_PATTERNS_MCP_SERVER.md contains the full library of MCP server patterns (tools/prompts/resources, error handling, JSON-RPC, transport choice, testing). Load that file for all code patterns referenced below.


Step 0: Parse arguments

Extract from $ARGUMENTS:

  • server-name (required, first positional arg) — kebab-case, e.g. slack-mcp, postgres-mcp. Becomes the project directory + the MCP server name advertised in the handshake.
  • --lang = python (default) | typescript. Python recommended — the official SDK is more mature and the ecosystem is bigger for backend-style MCP servers.
  • --transport = stdio (default) | http | sse. stdio is recommended for almost everything (Claude Code, Claude Desktop, Cursor, etc. all use stdio). Use http/sse only if you specifically need to serve MCP over the network.
  • --with-tools (default ON) — include example tools (the most common MCP primitive).
  • --with-prompts (default OFF) — include example prompts (slash-command-style prompts the host can call).
  • --with-resources (default OFF) — include example resources (URI-addressable read-only content).

If server-name is missing, stop and ask the user for it.

If --lang is missing, ask: "Python (mature SDK, recommended) or TypeScript (better for web-facing MCP)?"


Step 1: Decision tree — should they actually be doing this?

Before scaffolding, confirm the user wants a STANDALONE MCP server, not the embedded variant:

Ask: "Is this MCP server going to be a separate package that other people install
      (PyPI / npm), OR is it going to be part of an existing app you're building?"

  Standalone package        → continue with this command
  Inside an existing app    → STOP. Use /auto-build or /retrofit instead. The
                              embedded MCP server lives under app/ai/mcp/ of
                              the host application; don't create a separate repo.
  Not sure yet              → recommend standalone. Easy to publish; can also
                              vendor it into an app later as a submodule.

Read the full file on GitHub · 408 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 408 lines · 121 tokens per session scan A 6cc2da46246e

Subscribe to this mod's changes

init-mcp-server is a command published in the GitHub repository alphaaiservice/cortex (1 stars, last pushed 26d ago), licensed MIT. It adds 121 tokens to every session and 3,868 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.