github-readme-mcp

github-readme-mcp

An MCP server that reviews README files using transparent, deterministic rules, scoring them and suggesting improvements.

Category
访问服务器

README

github-readme-mcp

Give every README a clear score, a punchy intro, and a copy-paste improvement plan—no LLM required.

github-readme-mcp is a small Model Context Protocol (MCP) server that reviews README files using transparent, deterministic rules. Paste markdown, point at a local file, pass a GitHub repo URL, or hand it a raw URL—it returns scores, missing sections, concrete issues, and an improved draft. Optional OpenAI polish kicks in only when you set OPENAI_API_KEY; if the key is missing or the call fails, everything still works.


Try the demo (about 30 seconds)

  1. git clone <repo-url> && cd github-readme-mcp && npm install

  2. Run a scored review on the intentionally weak sample README (no build step required):

    npm run demo
    

    You should see a low overall score, missing sections (install, usage, license, etc.), and concrete suggestions.

  3. Compare weak vs strong examples side by side:

    npm run demo:compare
    
  4. Same analysis as JSON:

    npm run demo:json | head
    
  5. Optional: npm run build then use node dist/cli.js … (see below).


Why it exists

Great READMEs reduce support load and speed up adoption, but most teams lack a consistent checklist. This project encodes a practical rubric (title, value prop, install, usage, features, demo, badges, contributing, license, support) into MCP tools and a tiny CLI so you can run reviews locally, wire them into an agent, or demo the idea in minutes.


Features

  • Deterministic analysis — weighted 0–100 score with per-dimension breakdown (title, clarity, install, usage, features, demo, badges, contributing/contact, license).
  • Multiple inputs — inline markdown, local path, https://github.com/owner/repo, or any raw https:// markdown URL (with basic safety checks).
  • Five MCP tools — analyze, grouped suggestions, intro rewrites, full improved README, before/after comparison.
  • Optional LLM polish — OPENAI_API_KEY / OPENAI_BASE_URL / OPENAI_MODEL; graceful fallback to rule-based text.
  • CLI — analyze, improve, and compare with --json or markdown output.
  • Tests + linting — Vitest, ESLint, Prettier.

Quickstart

git clone <your-fork-or-url>
cd github-readme-mcp
npm install
npm run build   # optional until you run dist/ or publish

MCP server (stdio)

Use dist/server.js for hosts like Cursor (single-purpose entry, easy to reason about):

npm start
# same as:
node dist/server.js

The github-readme-mcp npm bin points at dist/cli.js: with no arguments it also starts the stdio MCP server, so npx github-readme-mcp works the same way after a build.

CLI commands

During development (TypeScript via tsx, no build):

npm run dev -- analyze ./README.md
npm run dev -- analyze https://github.com/modelcontextprotocol/servers --json
npm run dev -- improve ./examples/weak-readme.md
npm run dev -- compare ./examples/weak-readme.md ./examples/strong-readme.md

After npm run build:

node dist/cli.js analyze ./README.md
node dist/cli.js serve          # MCP stdio (explicit)

Flags: --json for machine-readable output; --markdown / --md for human-readable (default for analyze/improve/compare).

npm scripts

Script What it runs
npm run build tsc → dist/
npm start node dist/server.js (MCP)
npm run dev tsx src/cli.ts + your args after --
npm run dev:server tsx src/server.ts (MCP, dev)
npm run demo Analyze examples/weak-readme.md
npm run demo:json Same, JSON
npm run demo:compare Weak vs strong fixtures
npm test Vitest
npm run lint ESLint
npm run format Prettier write

MCP tools overview

Tool Purpose
analyze_readme Full report: overallScore, sectionScores, sections, issues, quick wins, badges/taglines, rewrittenIntro, summary.
suggest_readme_improvements Same inputs; mustFix / shouldImprove / niceToHave with whyItMatters and suggestedFix (same underlying issues as analyze_readme).
rewrite_intro introVariants, taglineVariants, rationale; optional OpenAI refinement.
generate_improved_readme Scaffold missing sections, optional badges/contributing; optional OpenAI polish.
compare_before_after summary, improvements, stillMissing for two markdown strings.

Input shape (resolve one source):

  • content?: string — raw markdown
  • filePath?: string — local path
  • repoUrl?: string — GitHub repository URL
  • rawUrl?: string — direct raw markdown URL

rewrite_intro requires content. compare_before_after requires original and improved.


Example outputs

See examples/sample-analyze-output.json for the JSON shape returned by analyze_readme (illustrative scores).

Markdown CLI output lists section scores, detected vs missing sections, quick wins, tagline ideas, a deterministic intro rewrite, and issues with severities.


Cursor / MCP configuration

Point command/args at dist/server.js after npm run build (adjust the absolute path):

{
  "mcpServers": {
    "github-readme-mcp": {
      "command": "node",
      "args": ["/absolute/path/to/github-readme-mcp/dist/server.js"]
    }
  }
}

Optional OpenAI polish:

{
  "mcpServers": {
    "github-readme-mcp": {
      "command": "node",
      "args": ["/absolute/path/to/github-readme-mcp/dist/server.js"],
      "env": {
        "OPENAI_API_KEY": "sk-...",
        "OPENAI_MODEL": "gpt-4o-mini"
      }
    }
  }
}

Architecture

flowchart LR
  subgraph inputs [Inputs]
    C[content]
    F[filePath]
    G[repoUrl]
    R[rawUrl]
  end
  L[loaders] --> A[analysis + scoring]
  A --> T[MCP tools / CLI]
  P[providers/openai optional] --> T
  inputs --> L
  • src/loaders/ — Resolve markdown from the four input types; GitHub uses the REST API for default_branch plus raw fallbacks; raw URLs are fetched with size and content-type guards.
  • src/analysis/ — Section detection, heuristics, and buildAnalyzeResult (single pipeline for scores + issues).
  • src/scoring/ — Weighted rubric; overall score is the weighted mean of per-dimension 0–100 scores.
  • src/rewrite/ — Deterministic intro and full README scaffolding; compare reuses analysis.
  • src/providers/ — Optional OpenAI chat calls for polish only.
  • src/tools/ — MCP tool handlers shared with the CLI where applicable.
  • src/server.ts — stdio MCP server.
  • src/cli.ts — Subcommands; with no subcommand, starts the same MCP server (npm bin entry).

Development

npm install
npm run typecheck
npm run lint
npm run format
npm test
npm run build
  • Node 20+ recommended.
  • Environment — copy .env.example to .env locally if you use a key; the server does not load .env by itself (set vars in your MCP host or shell).

Roadmap

  • Configurable rubric weights via a small JSON file.
  • Additional hosts (GitLab raw URLs, self-hosted GitHub).
  • Localization hints for non-English READMEs.
  • Optional read_lints style tool that only lists issues without scores.

Contributing

Issues and PRs are welcome. Please run npm test and npm run lint before submitting. Keep changes focused; match existing TypeScript style and avoid new dependencies unless there is a clear win.


License

MIT — see LICENSE.


GitHub About copy (pick one)

  1. MCP server + CLI that scores READMEs, finds missing sections, and drafts improvements—deterministic by default, OpenAI optional.
  2. README reviewer for developers: GitHub URL, raw URL, or local path → scores, issues, improved markdown over MCP.
  3. Ship clearer OSS docs: weighted README rubric, quick wins, and copy-paste scaffolds via Model Context Protocol.

Suggested GitHub topics

readme documentation mcp model-context-protocol github developer-tools markdown lint oss typescript nodejs


Launch post (short)

Ship READMEs that pass the “5-second skim.” I open-sourced github-readme-mcp—an MCP server + CLI that scores your README, lists missing sections, suggests badges and taglines, and drafts an improved version. It runs fully offline with deterministic rules; add an OpenAI key only if you want extra polish. Try npm run demo on the included weak README, or point it at any GitHub repo URL. MIT licensed—stars and feedback welcome.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选