# Create Mcp Server

> Scaffold production-ready MCP servers in seconds

- **Type:** MCP server
- **Install:** `agentstack add mcp-agentailor-create-mcp-server`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [agentailor](https://agentstack.voostack.com/s/agentailor)
- **Installs:** 0
- **Category:** [Integrations](https://agentstack.voostack.com/c/integrations)
- **Latest version:** 0.1.0
- **License:** Apache-2.0
- **Upstream author:** [agentailor](https://github.com/agentailor)
- **Source:** https://github.com/agentailor/create-mcp-server
- **Website:** https://www.agentailor.com/

## Install

```sh
agentstack add mcp-agentailor-create-mcp-server
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# @agentailor/create-mcp-server

[](https://www.npmjs.com/package/@agentailor/create-mcp-server)
[](https://github.com/agentailor/create-mcp-server/actions/workflows/test.yml)
[](https://www.npmjs.com/package/@agentailor/create-mcp-server)
[](https://opensource.org/licenses/MIT)
[](https://nodejs.org/)
[](https://github.com/agentailor/create-mcp-server/pulls)

Scaffold production-ready MCP servers in seconds.

## Quick Start

**Interactive mode** (guided prompts):

```bash
npx @agentailor/create-mcp-server
```

**CLI mode** (all options via arguments):

```bash
npx @agentailor/create-mcp-server --name=my-server
```

## CLI Options

| Option | Short | Default | Description |
|--------|-------|---------|-------------|
| `--name` | `-n` | — | Project name (required in CLI mode) |
| `--package-manager` | `-p` | `npm` | Package manager: npm, pnpm, yarn |
| `--framework` | `-f` | `sdk` | Framework: sdk, fastmcp |
| `--stdio` | — | `false` | Use stdio transport (for local clients) |
| `--template` | `-t` | `stateless` | Server mode: stateless, stateful (HTTP only) |
| `--oauth` | — | `false` | Enable OAuth (sdk+stateful only, incompatible with --stdio) |
| `--no-git` | — | `false` | Skip git initialization |
| `--help` | `-h` | — | Show help |
| `--version` | `-V` | — | Show version |

**Examples:**

```bash
# Minimal - uses all defaults (HTTP streamable)
npx @agentailor/create-mcp-server --name=my-server

# stdio server (for local clients)
npx @agentailor/create-mcp-server --name=my-server --stdio

# stdio with FastMCP
npx @agentailor/create-mcp-server --name=my-server --stdio --framework=fastmcp

# Full HTTP options
npx @agentailor/create-mcp-server \
  --name=my-auth-server \
  --package-manager=pnpm \
  --framework=sdk \
  --template=stateful \
  --oauth

# Short flags
npx @agentailor/create-mcp-server -n my-server -p yarn -f fastmcp
```

## Features

- **Two frameworks** — Official MCP SDK or FastMCP
- **Two transport types** — HTTP (streamable) or stdio (for local cllients)
- **Two HTTP server modes** — stateless or stateful with session management
- **Optional OAuth** — OIDC-compliant authentication (SDK HTTP only) ([setup guide](docs/oauth-setup.md))
- **Package manager choice** — npm, pnpm, or yarn
- **TypeScript ready** — ready to customize
- **Docker ready** — production Dockerfile included (HTTP transport)
- **MCP Inspector** — built-in debugging with `npm run inspect`

## Frameworks

| Framework | Description |
|-----------|-------------|
| **Official MCP SDK** (default) | Full control with Express.js, supports OAuth |
| **FastMCP** | Simpler API with less boilerplate |

### FastMCP

[FastMCP](https://github.com/punkpeye/fastmcp) is a TypeScript framework built on top of the official MCP SDK that provides a simpler, more intuitive API for building MCP servers.

```typescript
import { FastMCP } from "fastmcp";
import { z } from "zod";

const server = new FastMCP({ name: "My Server", version: "1.0.0" });

server.addTool({
  name: "add",
  description: "Add two numbers",
  parameters: z.object({ a: z.number(), b: z.number() }),
  execute: async ({ a, b }) => String(a + b),
});

server.start({ transportType: "httpStream", httpStream: { port: 3000 } });
```

Learn more: [FastMCP Documentation](https://github.com/punkpeye/fastmcp)

## Transport Types

| Feature | HTTP (Streamable HTTP) | stdio |
|---------|------------------------|-------|
| Use case | Remote access, cloud deployment | Local clients (Claude Desktop) |
| Protocol | HTTP/SSE | stdin/stdout |
| Session management | ✓ (stateful mode) | — |
| OAuth support | ✓ (SDK stateful) | — |
| Docker deployment | ✓ | — |
| Port configuration | ✓ | — |

**HTTP**: Deploy as an HTTP server accessible remotely. Choose stateless or stateful mode.

**stdio**: Run as a local process. Communicates over stdin/stdout. Ideal for local clients. No HTTP server, no port, no Dockerfile generated.

## Server Modes (HTTP only)

| Feature | Stateless (default) | Stateful |
|---------|---------------------|----------|
| Session management | — | ✓ |
| SSE support | — | ✓ |
| OAuth option (SDK only) | — | ✓ |
| Endpoints | POST /mcp | POST, GET, DELETE /mcp |

**Stateless**: Simple HTTP server — each request creates a new transport instance.

**Stateful**: Session-based server with transport reuse, Server-Sent Events for real-time updates, and optional OAuth authentication (SDK only).

## Generated Project

```
my-mcp-server/
├── src/
│   ├── server.ts     # MCP server (tools, prompts, resources)
│   ├── index.ts      # Express app and transport setup
│   └── auth.ts       # OAuth middleware (if enabled)
├── Dockerfile        # Production-ready Docker build
├── package.json
├── tsconfig.json
├── .gitignore
├── .env.example
└── README.md
```

**Scripts:**
- `npm run dev` — build and start the server
- `npm run inspect` — open MCP Inspector (update URL in `package.json` if needed)

## Learning Resources

| Guide | Description |
|-------|-------------|
| [Create Your First MCP Server in 5 Minutes](https://blog.agentailor.com/posts/create-your-first-mcp-server-in-5-minutes?utm_source=github&utm_medium=readme&utm_campaign=create-mcp-server) | Build your first production-ready MCP server. A complete beginner guide to scaffolding a Fetch MCP server with TypeScript. |
| [Securing MCP Servers with Keycloak](https://blog.agentailor.com/posts/oauth-for-mcp-servers-practical-guide-keycloak?utm_source=github&utm_medium=readme&utm_campaign=create-mcp-server) | Learn how to secure your MCP servers with OAuth authentication using Keycloak. |
| [Getting Started with FastMCP](https://blog.agentailor.com/posts/getting-started-with-fastmcp?utm_source=github&utm_medium=readme&utm_campaign=create-mcp-server) | Build MCP servers faster with FastMCP — the TypeScript framework inspired by Python's most popular MCP library. |
| [OAuth for MCP Clients (Next.js + LangGraph.js)](https://blog.agentailor.com/posts/mcp-client-oauth-nextjs-langgraph?utm_source=github&utm_medium=readme&utm_campaign=create-mcp-server) | Implement OAuth authentication in your MCP client using Next.js and the MCP SDK. |

## Need help building MCP servers or agent infrastructure?

I help teams design and ship production-ready AI agent systems (MCP, LangGraph, RAG, memory, performance).

If you’re building something serious on top of this:

→ [DM me on LinkedIn](https://www.linkedin.com/in/ali-ibrahim-junior/)

Happy to jump on a short call.

## What is MCP?

The [Model Context Protocol](https://modelcontextprotocol.io/) (MCP) is an open protocol that enables AI assistants to interact with external tools, data sources, and services.

## Built by Agentailor

Built by [Agentailor](https://agentailor.com/?utm_source=github&utm_medium=readme&utm_campaign=create-mcp-server) — your launchpad for production-ready MCP servers and scalable AI agents. We provide the tools, templates, and expertise to ship AI-powered applications faster.

## Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [agentailor](https://github.com/agentailor)
- **Source:** [agentailor/create-mcp-server](https://github.com/agentailor/create-mcp-server)
- **License:** Apache-2.0
- **Homepage:** https://www.agentailor.com/

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** yes
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/mcp-agentailor-create-mcp-server
- Seller: https://agentstack.voostack.com/s/agentailor
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
