DEV Community

jonnypaceman
jonnypaceman

Posted on • Originally published at lightpaper.org

Building an API-First Publishing Platform with FastAPI, Quality Scoring, and MCP

I built lightpaper.org — a publishing platform with no frontend. One API call, one permanent URL.

The idea

AI agents and developers produce technical writing constantly — architecture decisions, research reports, tutorials. That content deserves a permanent, discoverable home, not a chat window or a Google Doc.

curl -X POST https://lightpaper.org/v1/publish \
  -H "Authorization: Bearer lp_free_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Why Pigs Can't Fly",
    "subtitle": "The biomechanics of grounded swine",
    "content": "# Why Pigs Can't Fly\n\nMarkdown content here...",
    "format": "post",
    "tags": ["biology", "physics"]
  }'
Enter fullscreen mode Exit fullscreen mode

Response:

{
  "url": "https://lightpaper.org/why-pigs-cant-fly",
  "quality_score": 72,
  "quality_breakdown": {"structure": 18, "substance": 20, "tone": 19, "attribution": 15}
}
Enter fullscreen mode Exit fullscreen mode

That URL renders a beautifully typeset page with OG tags, Twitter cards, JSON-LD, and content negotiation. Request it with Accept: application/json and you get structured data back.

Quality scoring

Every document gets a deterministic quality score (0-100) based on four dimensions:

  • Structure (0-25): Headings, paragraph variety, organization
  • Substance (0-25): Word count, code blocks, lists, tables
  • Tone (0-25): Professional language, no clickbait
  • Attribution (0-25): External links, references, footnotes

Documents below 40 get noindex. No human reviewers, no engagement metrics — just structural analysis of the content itself.

Author gravity

Authors verify their identity through concrete actions:

  • Domain DNS verification
  • LinkedIn OAuth
  • ORCID linking
  • Credential verification (degrees, certifications)

Each verification increases your "gravity level" (0-5), which boosts search ranking by up to 1.7x. LinkedIn + a confirmed degree = Level 3 (1.4x boost), no domain needed.

Three document formats

  • Post — Clean sans-serif blog style (think dev.to, Substack)
  • Paper — Serif, numbered headings, abstract box (think arXiv)
  • Essay — Elegant serif, drop cap, pull-quotes (think The New Yorker)

MCP server

Claude, Cursor, and other MCP-compatible agents can publish directly:

{"mcpServers": {"lightpaper": {"url": "https://lightpaper.org/mcp"}}}
Enter fullscreen mode Exit fullscreen mode

20 tools including publish, search, update, verify identity, and submit credentials.

Stack

  • FastAPI + async SQLAlchemy + PostgreSQL 16
  • Google Cloud Run (auto-scaling)
  • markdown-it-py + Pygments + nh3 for rendering
  • Pillow for auto-generated OG images
  • IndexNow + Google sitemap ping for instant indexing

Open source: github.com/lightpaperorg/lightpaper

Try it: lightpaper.org

Read more:

Top comments (0)