
ai-api-cost-mcp
io.github.m-mustufa/ai-api-cost-mcp
Estimate and compare OpenAI, Claude and Gemini API costs, gross margin and break-even price.
Documentation
AI SaaS with Mustafa
Source of aisaaswithmustafa.com, the portfolio, blog and free tools of Muhammad Mustafa, a full-stack SaaS and AI developer.
- 50+ pages, 35 blog posts and 5 free browser tools
- Hand-written HTML rendered through Astro for a shared header and footer
- Tailwind CSS compiled ahead of time, vanilla JavaScript, no client-side framework
- Hosted on Netlify with serverless functions and two small build plugins
How this site is built
The site started as plain HTML files. In November 2026 it moved to Astro without changing a single URL or a word of page content.
- Pages stay as HTML at their public paths (
index.html,pricing.html,blog/*.html,tools/*.html). Each page has two markers where its header and footer used to be:<!--@site-header-->and<!--@site-footer-->. - Astro renders every page into
dist/at the same URL.LegacyPage.astroswaps the markers forSiteHeader.astroandSiteFooter.astro, so the navigation and footer are edited in one place. .htmlURLs are kept withbuild.format: "preserve"inastro.config.mjs:pricing.htmlstayspricing.html, andblog/index.htmlstaysblog/index.html.src/lib/legacy.mjssets the active nav link, adds a content hash (?v=) to every local CSS and JS file so browsers never keep a stale stylesheet, and switchesrobotstonoindexon every Netlify deploy that is not production.- Static files (images, feed, sitemap, redirects) are copied into
dist/bysrc/lib/copy-static.mjs.
Parity check
scripts/parity-check.js compares every page of a git ref (production by default) with the new build. It checks titles, meta tags, canonical URLs, JSON-LD, headings, body text, links, images, static files, sitemap URLs and every local link or asset reference. The migration went live only when it reported zero differences.
npm run build
npm run parity # compare dist/ with main
npm run parity -- <ref> # or with any git ref
Commands
| Command | What it does |
|---|---|
npm install | Install dependencies (Node 22.12 or newer) |
npm run build | Build the site into dist/ |
npm run preview | Serve dist/ locally |
npm run build:css | Recompile assets/css/tailwind.css after changing Tailwind classes |
npm run validate:site-seo | Build, then check titles, descriptions, headings, schema, images, links and sitemap entries |
npm run validate:blog-seo | Check every blog post's SEO structure |
npm run parity | Compare the build with production page by page |
Project structure
index.html, pricing.html, ... Pages (HTML with header/footer markers)
blog/ Blog posts, posts.json manifest, RSS feed, images
tools/ Free browser tools
src/components/ Shared SiteHeader, SiteFooter and the page renderer
src/lib/ Page loading, asset hashing, static file copying
assets/ CSS, JavaScript, images and documents
scripts/ Blog pipeline, validators, parity check, SEO helpers
netlify/functions/ Serverless functions (site assistant, IndexNow relay, scheduled social posts)
netlify/plugins/ Post-deploy plugins (IndexNow, LinkedIn)
Blog pipeline
New posts are rendered from blog/_template.html by scripts/new-post.js. The script updates the blog/posts.json manifest and regenerates the blog index, the homepage blog section, the sitemap and the RSS feed from it. After a production deploy, a build plugin notifies IndexNow (Bing and other engines) about changed pages only.
Free tools
- Complexity Coach: Big O estimates for JavaScript
- AI API Cost Calculator
- SaaS Metrics Calculator
- Upwork Proposal Roast
- IndexNow Submitter
Deploying
Netlify runs npm run build and publishes dist/ (see netlify.toml). Pushes to main go to production. Preview branches get their own noindexed Netlify URL.
Need a SaaS, AI or web project built? See services and pricing or get in touch.
All content, images and branding © 2026 Muhammad Mustafa.
ai-api-cost-mcpnpm install ai-api-cost-mcp