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 "Install 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 ServerBuild 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.
| Name | Required | Description | Default |
|---|---|---|---|
| yaml_spec | Yes | Raw YAML string matching the SystemArchitecture schema. | |
| output_directory | No | Output directory path for generated files. | ./generated_app |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
There are no annotations, so the description carries the full burden for behavioral transparency. It mentions scaffolding a codebase, which implies side effects, but it does not disclose whether the tool overwrites existing files in the output directory, requires network access, validates the YAML, or has any other side effects. This is a significant gap for a code generation tool.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single concise sentence (10 words) that front-loads the key action and outcome. Every word earns its place, with no redundancy or fluff.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a tool that creates a complete codebase, the description is too thin. It lacks critical context such as whether the output directory will be created or overwritten, what the generated code includes, error behaviors, or prerequisites. The schema covers parameters but not the tool's overall behavior, making the description insufficient for a complex operation.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, with both parameters having descriptive text in the schema. The description adds minimal meaning beyond that, only restating that the YAML is an architecture definition. It does not explain the SystemArchitecture schema or clarify any subtle behaviors, so the baseline of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's function with a specific verb 'scaffolds' and a specific resource ('complete FastAPI codebase') and input ('YAML architecture definition'). It is not a tautology and gives a clear purpose, though there are no sibling tools to differentiate from, so it doesn't mention alternatives.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage: use this when you have a YAML architecture definition and want a FastAPI codebase. However, it provides no explicit when-to-use guidance, no exclusions, and no alternative tools to consider, so it only meets the baseline for implied usage.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
1 tool update
v0.1.0- First observed
build_fastapi_app
TDQS
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
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Multi-agent AI pipeline that generates professional Solution Architecture Documents.
Turn your app idea into IA, wireframes, PRD, style guides, and dev specs for coding agents.
Turn PRDs and product ideas into structured specs so coding agents build your intent, not theirs.
Production-readiness for your AI coding agents.
Related MCP Servers
- AlicenseNot gradedqualityAmaintenanceEnables 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.161AGPL 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-
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/SevenDeadlyCommits/fast_api_scaffolder'
If you have feedback or need assistance with the MCP directory API, please join our Discord server