Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsCommunityBlog
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Uvicorn

ASecurity

ASGI server for Python web applications - Fast, production-ready server for async frameworks

416 stars
0 votes
0 copies
4 views
Added 2/9/2026
developmentpythongobashfastapidjangodockerapi

Works with

cliapi

Security Analysis

A96/100
mediumInstalls packages at runtime which could introduce malicious dependencies

Scanned 2/12/2026

Install to Claude Code

$npx -y skills add aiskillstore/marketplace --skill uvicorn --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Uvicorn?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Uvicorn
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/aiskillstore-uvicorn/badge)](https://www.skillsdirectory.com/skills/aiskillstore-uvicorn)

More formats (shields.io, HTML) on the badges page.

Download with Pro
Files
SKILL.md
---
name: uvicorn
description: ASGI server for Python web applications - Fast, production-ready server for async frameworks
when_to_use: |
  - Running FastAPI, Starlette, Django Channels, or other ASGI applications
  - Development servers with hot reload
  - Production deployment with multiple workers
  - WebSocket applications
  - Async Python web services
---

# Uvicorn Skill Guide

Uvicorn is a lightning-fast ASGI server implementation, using uvloop and httptools. It's the go-to server for modern Python async web frameworks.

## Quick Start

### Basic Usage

```bash
# Run ASGI app
uv run uvicorn main:app

# With host/port
uv run uvicorn main:app --host 0.0.0.0 --port 8000

# Development with auto-reload
uv run uvicorn main:app --reload
```

## Common Patterns

### 1. Simple ASGI Application

```python
# main.py
async def app(scope, receive, send):
    assert scope['type'] == 'http'

    await send({
        'type': 'http.response.start',
        'status': 200,
        'headers': [(b'content-type', b'text/plain')],
    })
    await send({
        'type': 'http.response.body',
        'body': b'Hello, World!',
    })
```

### 2. FastAPI Application

```python
# main.py
from fastapi import FastAPI

app = FastAPI()

@app.get("/")
async def root():
    return {"message": "Hello World"}
```

```bash
uv run uvicorn main:app --reload
```

### 3. Application Factory Pattern

```python
# main.py
from fastapi import FastAPI

def create_app():
    app = FastAPI()
    # Configure app
    return app

app = create_app()
```

```bash
uv run uvicorn --factory main:create_app
```

### 4. Programmatic Server Control

```python
import uvicorn

# Simple run
if __name__ == "__main__":
    uvicorn.run("main:app", host="0.0.0.0", port=8000, reload=True)
```

```python
import asyncio
import uvicorn

async def main():
    config = uvicorn.Config("main:app", port=5000, log_level="info")
    server = uvicorn.Server(config)
    await server.serve()

if __name__ == "__main__":
    asyncio.run(main())
```

### 5. Configuration with Environment Variables

```bash
export UVICORN_HOST="0.0.0.0"
export UVICORN_PORT="8000"
export UVICORN_RELOAD="true"
uv run uvicorn main:app
```

## Production Deployment

### Multi-Process Workers

```bash
# Use multiple worker processes
uv run uvicorn main:app --workers 4

# Note: Can't use --reload with --workers
```

### Gunicorn + Uvicorn

```bash
# Install gunicorn
uv add gunicorn

# Run with Gunicorn process manager
uv run gunicorn main:app -w 4 -k uvicorn.workers.UvicornWorker
```

### HTTPS/SSL

```bash
uv run uvicorn main:app --ssl-keyfile=./key.pem --ssl-certfile=./cert.pem
```

### Unix Socket

```bash
uv run uvicorn main:app --uds /tmp/uvicorn.sock
```

## Configuration Options

### Common CLI Flags

```bash
uv run uvicorn main:app \
  --host 0.0.0.0 \
  --port 8000 \
  --reload \
  --reload-dir ./app \
  --log-level info \
  --access-log \
  --workers 4
```

### Key Settings

- `--host`: Bind host (default: 127.0.0.1)
- `--port`: Bind port (default: 8000)
- `--reload`: Enable auto-reload for development
- `--workers`: Number of worker processes
- `--log-level`: Logging level (critical, error, warning, info, debug)
- `--access-log`: Enable access logging
- `--factory`: Treat app as application factory

## Docker Integration

### Dockerfile

```dockerfile
FROM python:3.12-slim
WORKDIR /app

# Install dependencies
COPY requirements.txt .
RUN pip install -r requirements.txt

# Copy application
COPY . .

# Run with uvicorn
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
```

### Docker Compose with Hot Reload

```yaml
services:
  app:
    build: .
    ports:
      - "8000:8000"
    environment:
      - UVICORN_RELOAD=true
    volumes:
      - .:/app
    command: uvicorn main:app --host 0.0.0.0 --port 8000 --reload
```

## Troubleshooting

### Common Issues

1. **Port already in use**: Change port or kill existing process
2. **Module not found**: Check PYTHONPATH or use `--app-dir`
3. **Reload not working**: Ensure watching correct directories with `--reload-dir`
4. **Worker count**: Use `--workers` for production, avoid with `--reload`

### Debug Mode

```bash
uv run uvicorn main:app --reload --log-level debug
```

### Health Checks

```python
@app.get("/health")
async def health():
    return {"status": "healthy"}
```

Attribution

aiskillstoreaiskillstore
View sourceMore from aiskillstore →
SSkills DirectorySkills Directory

Know which skills are safe — weekly.

Best new skills + every skill we flagged as malicious. From the team that scanned 103,619.

Join free

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Know which skills are safe — weekly.

Best new skills + every skill we flagged as malicious. From the team that scanned 103,619.

Join free

Related Skills

Browser Extension Developer

Use this skill when developing or maintaining browser extension code in the `browser/` directory, including Chrome/Firefox/Edge compatibility, content scripts, background scripts, or i18n updates.

284722 votes

Seo Optimizer

SEO optimization with keyword analysis, readability assessment, technical validation, content quality. Use for search rankings, blog posts, content audits, or encountering keyword density, readability scores, meta tags, schema markup errors.

2192 votes

Google Official Seo Guide

Official Google SEO guide covering search optimization, best practices, Search Console, crawling, indexing, and improving website search visibility based on official Google documentation

1862 votes

Tanstack Start

Build a full-stack TanStack Start app on Cloudflare Workers from scratch — SSR, file-based routing, server functions, D1+Drizzle, better-auth, Tailwind v4+shadcn/ui. Use whenever the user mentions TanStack Start, asks to scaffold a full-stack Cloudflare app with SSR, wants an SSR dashboard, or asks for a React 19 + Cloudflare Workers app with file-based routing and server functions — even if they don't name TanStack Start specifically. No template repo — Claude generates every file fresh per ...

9881 votes

Pentest

PTES-aligned adversarial security audit for backend, frontend, and mobile applications. Produces a CVSS-scored Hacker Report with verified PoCs and phased remediation.

5491 votes
View all in development →