FastAPI Scaffolder MCP Server
Generates production-ready FastAPI applications from declarative YAML architecture specifications, including typed models, routers, configuration, dependency wiring, and test suites.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@FastAPI Scaffolder MCP Server Build a FastAPI app from the YAML spec in ./architecture.yaml"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
FastAPI Scaffolder
FastAPI Scaffolder is a developer tool and AI system agent that transforms human- and machine-readable YAML architecture specifications into production-ready FastAPI applications.
It provides both a CLI interface for humans and a Model Context Protocol (MCP) server for AI agents (Gemini, Claude Desktop, Cursor, Windsurf, LangChain) to generate modular APIs instantly.
Capabilities
Dual Interface: Native CLI for developers and a zero-dependency JSON-RPC 2.0 MCP server for AI models.
Declarative Schemas: Define microservices, endpoints, HTTP methods, Pydantic request/response payloads, and service dependencies in single or split YAML files.
Modular Generation: Renders complete project structures complete with typed Pydantic models, FastAPI routers, configuration, dependency wiring, and test suites.
Python 3.14 Ready: Built natively without third-party wrapper bottlenecks or SDK version locks.
Related MCP server: MCP Server Template
Installation
Prerequisites
Python
>= 3.10(Tested up to3.14)uvorpip
Install Locally (Editable Mode)
# Clone and enter directory
cd fastapi-scaffolder
# Install with CLI and MCP entry points
pip install -e .
This registers two global commands in your active virtual environment:
scaffold— Human-facing CLI toolscaffold-mcp— Executable stdio MCP server for AI clients
Schema Specification (architecture.yaml)
Define your API architecture using standard YAML:
system_name: PaymentInvoicingPlatform
version: 1.0.0
services:
- name: AuthService
description: Handles user authentication and tokens
dependencies: []
endpoints:
- path: /auth/login
method: POST
summary: Authenticate user
request_body:
- name: email
type: str
- name: password
type: str
response_body:
- name: access_token
type: str
- name: InvoiceService
description: Manages client invoices
dependencies:
- AuthService
endpoints:
- path: /invoices
method: POST
summary: Create client invoice
request_body:
- name: client_email
type: str
- name: amount
type: float
response_body:
- name: invoice_id
type: str
- name: status
type: str
Usage Guide
1. Human CLI Usage
Scaffold an app directly from the terminal using the scaffold command:
# Generate app from YAML spec
scaffold -i architecture.yaml -o ./my_fastapi_app
# Combine multiple service specs
scaffold -i auth_service.yaml billing_service.yaml -o ./monorepo_app
2. AI Setup with Model Context Protocol (MCP)
scaffold-mcp communicates over Standard Input/Output (stdio) via JSON-RPC 2.0.
Cursor / Claude Desktop / Windsurf Setup
Add fastapi-scaffolder to your MCP configuration file (claude_desktop_config.json or Cursor MCP settings):
{
"mcpServers": {
"fastapi-scaffolder": {
"command": "/path/to/your/venv/bin/scaffold-mcp",
"args": []
}
}
}
Replace /path/to/your/venv/bin/scaffold-mcp with the absolute path returned by which scaffold-mcp.
System Prompt Directive for AI Agents
Add this instruction to your LLM system prompt so it outputs compliant YAML to invoke the tool:
FastAPI Scaffolder Schema Directive:
When generating an API, output a YAML string structured as follows:
system_name: MySystem version: 1.0.0 services: - name: ServiceName description: Summary of responsibility dependencies: [] endpoints: - path: /items/{id} method: GET summary: retrieve item response_body: - name: id type: strPass this raw YAML string to the
build_fastapi_apptool withoutput_directory.
3. Usage with Google Gemini SDK
To run fastapi-scaffolder inside Gemini agent workflows:
from google import genai
from google.genai import types
from scaffolder.mcp_server import execute_scaffold
client = genai.Client()
# Pass the tool execution function to Gemini
response = client.models.generate_content(
model="gemini-2.5-flash",
contents="Design a user profile microservice in YAML and build the code in ./user_service",
config=types.GenerateContentConfig(
tools=[execute_scaffold]
)
)
# Execute the returned function call
if response.function_calls:
for call in response.function_calls:
if call.name == "execute_scaffold":
result = execute_scaffold(call.args)
print(result)
Testing the MCP Server Manually
Verify that the MCP server starts and receives messages via stdio:
# Run server executable
scaffold-mcp
Paste this test payload into stdout and press Enter:
{"jsonrpc": "2.0", "id": 1, "method": "tools/list"}
Expected Response:
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"tools": [
{
"name": "build_fastapi_app",
"description": "Scaffolds a complete FastAPI codebase from a YAML architecture definition.",
"inputSchema": {
"type": "object",
"properties": {
"yaml_spec": {
"type": "string",
"description": "Raw YAML string matching the SystemArchitecture schema."
},
"output_directory": {
"type": "string",
"description": "Output directory path for generated files.",
"default": "./generated_app"
}
},
"required": ["yaml_spec"]
}
}
]
}
}
Available Tools
1 toolbuild_fastapi_appB
Scaffolds a complete FastAPI codebase from a YAML architecture definition.
Inputs: yaml_spec (required), output_directory.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 1 tool
With only one tool, there is no possibility of confusion or overlap. The tool has a distinct and singular purpose.
The single tool name 'build_fastapi_app' follows a clear verb_noun pattern, and consistency is trivially maintained with only one tool.
A single tool feels thin for a server, but it is borderline appropriate given the narrow, focused purpose of scaffolding FastAPI apps from YAML definitions.
The tool fully covers the stated domain of scaffolding a complete FastAPI codebase. There are no obvious missing operations for the intended workflow.
Maintenance
Related MCP Connectors
Build Spring Boot applications, ready for coding agents, including best practices.
Multi-agent AI pipeline that generates professional Solution Architecture Documents.
Build and publish full-stack apps from your coding agent: models, rules, pages, auth, per-app MCP.
Turn an idea or meeting transcript into a working single-file AI agent, check it, use it right away.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceEnables AI coding agents to generate standardized code using scaffolding templates, enforce architectural patterns, and validate outputs programmatically. Supports creating projects from boilerplates and adding features to existing codebases while maintaining team conventions.160AGPL 3.0
- FlicenseNot gradedqualityNot gradedmaintenanceA scaffold project for building FastAPI-based Model Context Protocol servers with automatic tool discovery and router capabilities.-
- FlicenseBqualityDmaintenanceA specialized toolchain that guides AI agents through a structured 'Atomic Development' workflow for building Python FastAPI and Supabase backends. It manages project scaffolding and enforces dependency-ordered generation of database models, API routes, and tests.9-
- FlicenseNot gradedqualityDmaintenanceA production-ready Python scaffold for building Model Context Protocol (MCP) servers using FastMCP. It provides a structured framework for developers and AI agents to rapidly develop, test, and manage custom tools and workflows.1-