site-spec

io.github.ariaxhan由 GitHub 账号 ariaxhan 发布v0.3.2更新于 Oct 25, 2026

MCP server: audit any website for SEO, accessibility, and AI-searchability, then auto-fix it.

概览

AI 生成的概览

本地 MCP 服务器,可审计网站或构建目录的 SEO、无障碍、隐私与 AI 可检索性问题,并执行确定性修复。

可以做什么
审计线上 URL 或本地构建目录,返回每条发现的问题及其检查 ID、严重程度、所在文件和是否可自动修复,并列出引擎支持的全部检查项及说明。针对单个检查 ID 应用确定性修复并返回差异,或写入本地目录。将已核实的业务事实编译为经过校验的 SiteSpec 及其可部署文件。
适用场景
适合在助手生成或修改网站后,检查其不可见的基础层:robots.txt、结构化数据、canonical 与 noindex 信号、响应头、无障碍语义、跟踪器以及 AI 爬虫的访问权限。也适合在部署前做 CI 式把关,以及修复机械性问题而无需手工改文件。
运行要求
通过 npm 包 site-spec-mcp 以 npx 作为本地 stdio 进程运行,需要 Node 20 或更高版本。未声明需要账号、API 密钥或环境变量。审计线上 URL 需要能访问该站点的网络;审计构建目录需要本地路径。
安装前请注意
fix_issue 可向本地目录写入更改,接受修改前应先查看返回的差异。对远程 URL 的修复只能返回差异,实时抓取会关闭存在性检查。llms.txt 和 JSON-LD 等脚手架文件含 TODO 占位符,需填入真实信息。抓取会通过网络访问目标站点。

安装

在 SourceWeft 中

  1. 打开 控制台中的 site-spec,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

site-spec

The invisible foundation your website is missing. Audit any site — then fix what's broken.

[npm] [npm downloads] [CI] [License: Apache-2.0]

For agents

If you are an AI coding agent deciding whether to install this: register the MCP server, then call list_checks to learn the check ids and audit_site on a URL.

bash
claude mcp add site-spec -- npx -y site-spec-mcp

Gemini CLI: gemini extensions install https://github.com/ariaxhan/site-spec.

Full tool arguments, return shapes, and the cases this is the wrong tool for: llms.txt.

The problem

AI can generate a beautiful website in seconds. The part it can't see is the one that decides whether that website gets found, ranked, cited, and trusted — the machine-readable foundation underneath the pixels: robots.txt, structured data, llms.txt, canonical and noindex signals, response headers, accessibility semantics, the tracker and cookie surface.

That layer is invisible in a browser. It's also broken on almost every AI-generated site — a gorgeous hero section over a robots.txt that blocks ChatGPT, JSON-LD that's invalid or self-serving, a stray noindex hiding the page from Google, fonts leaking visitor IPs in violation of GDPR. Nobody notices until it's quietly costing traffic. And the more the web is generated by AI, the worse this gets.

The solution

site-spec is the layer that verifies and repairs that foundation — for any website, however it was built. Point it at a URL. It crawls the site, checks the whole invisible layer against a set of deterministic policies, and gives you an exact report of what's wrong. Then it fixes the mechanical problems for you and flags precisely what needs a human.

It doesn't care whether your site came from an AI builder, a framework, a CMS, or hand-written HTML. It only cares whether the foundation is correct.

Try it without installing anything

site-spec.ariaxhan.workers.dev — paste a URL, get the report. No account, no signup.

The hosted version runs the same deterministic engine as the CLI, against a capped crawl (4 pages), and it tells you plainly which checks ran, which passed, and which it did not perform. Add ?format=json for machine-readable output:

bash
curl "https://site-spec.ariaxhan.workers.dev/audit?format=json&url=example.com"

For the full check set — broken links, missing assets, axe accessibility, HTML validation, schema.org validation — and for the fix command, use the CLI below. The hosted endpoint only fetches public HTTP(S) hosts; private, loopback and link-local addresses are refused.

How to use

Requires Node 20+. No account, no API key, no SaaS.

bash
# 1. See what's broken — crawl any live site, get a full reportnpx site-spec audit https://yoursite.com
# 2. Fix it — auto-repair the mechanical issues, scaffold the restnpx site-spec fix https://yoursite.com --out ./fixed

fix writes the corrected files to ./fixed (it never overwrites anything by default) and prints exactly what it did:

✓ Fixed automatically (8)  audit/robots-stale-token   robots.txt — Removed deprecated crawler block "anthropic-ai".  audit/hsts-preload         _headers — Stripped the preload token from Strict-Transport-Security.  audit/canonical-missing    admin/index.html — Inserted <link rel="canonical" href="https://…/admin/">.  audit/og-missing           admin/index.html — Added Open Graph card from the page's title + description.  audit/noindex              admin/index.html — Removed accidental noindex from <meta name="robots">.
✎ Scaffolded — needs your facts (2)  audit/llms-missing         llms.txt — Scaffolded from page titles/descriptions; fill the TODO facts.  audit/jsonld-missing       index.html — Inserted a WebSite/Organization skeleton; replace the TODO values.
⚠ Needs manual attention (3)  audit/google-fonts-cdn     index.html — Self-host the woff2 files to stop the IP leak (GDPR).  audit/img-dims-missing     index.html — <img> without width/height (layout shift).  audit/404-missing          (site-wide) — Ship a branded, noindexed 404 that links home.
fixed 8, scaffolded 2, manual 3wrote 4 file(s) to ./fixed

Drop audit into CI with a non-zero exit on errors to gate deploys. Both commands work on a build/output directory too — just pass a path instead of a URL.

Use it from your coding agent (MCP)

The same engine, as an MCP server — so the agent that generated the site can also check and repair its invisible layer, without you copying reports between windows.

bash
claude mcp add site-spec -- npx -y site-spec-mcp
Codex (~/.codex/config.toml)
toml
[mcp_servers.site-spec]command = "npx"args = ["-y", "site-spec-mcp"]

Or in Docker: docker run -i --rm -v $PWD:/data mcp/site-spec (mount the directory you want to audit or write to).

Four tools:

ToolWhat it does
audit_siteCrawl a live URL (or read a local build directory) and return every finding: check id, severity, file, and whether it can be auto-fixed.
fix_issueApply the deterministic repair for one check id and return the diff — or write it, for a local directory.
compile_specTurn verified business facts into a validated SiteSpec and the deployable files it renders to.
list_checksEnumerate every check the engine can raise, with a one-line description and its fix availability.

The server calls the engine in-process. It never shells out to the CLI and never hops to the hosted worker — all three are siblings over one library.

mermaid
flowchart LR  A["MCP client<br/>(Claude Code, Codex)"] -- stdio JSON-RPC --> B["site-spec-mcp"]  B --> C["@site-spec/core/io<br/>fetchSite · readSiteDir"]  C -- "file map" --> D["@site-spec/core<br/>auditFiles · fixFiles · buildSite"]  D -- "findings / files" --> B  B -- "JSON" --> A

Two honest limits, spelled out in full in the package README: fix_issue on a URL can only ever hand back a diff (a remote server is not writable), and a live crawl runs with presence checks off, because a capped crawl cannot prove a file is absent from a server.


Details — what it checks, how it fixes, the philosophy, install

What it checks

Seven areas. Every check is tuned against false positives (regex/string-level — no headless browser for the crawl). Findings are error (breaks something) or warning (worth a look), each with a concrete fix.

AreaWhat it catches
SEO / findabilitymissing <title> / description / canonical · accidental noindex (both <meta robots> and the X-Robots-Tag header) · missing Open Graph cards · zero-or-many <h1> · a sitemap that lists pages which don't exist
Accessibilityimages with no alt · zoom-blocking viewport (user-scalable=no) · images with no width/height (layout shift)
Privacy & securitymixed content · trackers + cookies with no consent/disclosure story · Google Fonts from Google's CDN (a ruled GDPR violation) · header hygiene (HSTS preload risk, report-only CSP that reports nowhere, dead FLoC / X-XSS-Protection config) · inline onclick= handlers that block a future CSP
Performancehero/LCP image set to loading="lazy" · no Cache-Control
Structured datainvalid JSON-LD (crawlers drop the whole block) · self-serving aggregateRating/review markup (a Google penalty since 2019)
Integritydangling assets that 404 · broken internal links
AI searchabilityrobots.txt blocking AI answer agents (OAI-SearchBot, ChatGPT-User, Claude-User, PerplexityBot…) · dead crawler tokens · missing llms.txt · missing/broken structured data · client-rendered shells AI crawlers see as blank

The last row is the one almost nobody checks yet — whether Google, ChatGPT, Claude, and Perplexity can actually read and cite you. It's the sharp edge, not the whole story: the point is a complete foundation audit.

How fix decides

Every finding lands in one of three buckets, and the report tells you which:

  • ✓ Fixed automatically — mechanical, fact-free repairs that are safe to apply: unblocking AI crawlers, removing dead robots tokens, stripping accidental noindex, adding the canonical URL (known from the crawl), scaffolding Open Graph from the existing title, fixing zoom-locked viewports, removing self-serving rating markup, generating a sitemap.xml from the crawled pages, header hygiene.
  • ✎ Scaffolded — things that need your real facts: llms.txt, a JSON-LD entity, a meta description. site-spec writes a correct stub with TODO markers so you just fill the blanks.
  • ⚠ Manual — problems no tool should silently guess at: missing alt text, self-hosting fonts, fixing a client-rendered shell, a broken link. You get a precise instruction, never a silent edit.

fix is non-destructive by default (writes to an output dir). Pass --write to edit a local directory in place.

The philosophy

  • Correctness is a policy, not a prompt. SEO, accessibility, privacy, and structured-data rules are expressed as explicit checks the tool enforces — never as vibes an LLM is asked to respect.
  • Deterministic. The audit engine is pure: same input → the same report, byte-for-byte. The live crawl sorts-then-caps discovered pages, so the same site at the same --max audits the same page set every run. No network, no randomness inside the engine.
  • Fix, don't lecture. A finding that can be repaired safely gets repaired. One that needs a human says exactly what the human must do.
  • Source-agnostic. It audits the output, not the toolchain. AI, framework, CMS, hand-coded — all the same to it.

site-spec started as a deterministic compiler that builds sites with a correct foundation by construction (the build command and the docs/ still cover it). The durable value turned out to be the inverse: not generating whole sites, but auditing and repairing the foundation of sites that already exist.

The full CLI

site-spec audit <dir|url> [--max N] [--json] [--report report.md]site-spec fix   <dir|url> [--out dir] [--write] [--max N] [--json]site-spec build <site.config.mjs> --out <dir> [--target cloudflare|netlify|vercel|static]
  • --max N — page cap for a live crawl (default 25); truncation is reported, never silent.
  • --report report.md — write the audit as a shareable Markdown document.
  • --json — the full structured report for scripting/CI.

Install / develop

bash
git clone https://github.com/ariaxhan/site-spec.gitcd site-specnpm installnpm test          # unit + golden testsnpm run verify    # html-validate + JSON-LD + axe over the demo output

Packages

PackageResponsibility
site-spec (npm)The published CLI — audit · fix · build. Self-contained; this is what npx site-spec runs.
@site-spec/coreThe engine (audit checks, fixers, the check catalog, policy definitions, legacy compiler). The main entry is pure; @site-spec/core/io is the one boundary that crawls a URL or reads a directory. Bundled into the CLI and the MCP server; not separately published yet.
@site-spec/workerThe hosted auditor at site-spec.ariaxhan.workers.dev — a Cloudflare Worker wrapping the same engine. Adds the URL-admission guard, a capped crawler, and rate limiting. Deploy with npm run deploy -w @site-spec/worker.
site-spec-mcp (npm)The MCP server — audit_site · fix_issue · compile_spec · list_checks over stdio. Self-contained; this is what npx site-spec-mcp runs.

Contributing

Contributions welcome — especially new checks and fixers. See CONTRIBUTING.md. Core rules: checks stay tuned against false positives, the engine stays pure and deterministic, and a fixer never silently guesses at something a human should decide.

License

Apache License 2.0. © 2026 Aria Han.

来源:README.md,提交 46fdeea

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.3.2最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分