agentleFS
MicrosoftKnown publishermicrosoft/github-advisory-mcp/AGENTS.md

github-advisory-mcp

AGENTS.md7 starsChanged 3 months agoMITView on GitHub

Guidance for AI coding agents (and humans) working in this repository. Keep changes minimal, typed, and covered by tests. For contribution policy see CONTRIBUTING.md; for user-facing docs see README.md. An MCP server that serves GitHub Security Advisories from a local clone of github/advisory-database. Two-tier design: MCP server (stdio or HTTP) → local Express REST API → LocalRepositoryDataSource (reads advisory JSON from disk). Core MCP tools: list_advisories, get_advisory (full parameters in the README). The server reads advisory JSON from ADVISORY_REPO_PATH (default…

  • Installs packages
  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.

    Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

The file

We split this AGENTS.md into the rules it gives an agent

1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Don't commit dist/, external/, or machine-specific .vscode/mcp.json tweaks (all git-ignored).

    line 86

≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

AGENTS.md

Guidance for AI coding agents (and humans) working in this repository. Keep changes minimal, typed, and covered by tests. For contribution policy see CONTRIBUTING.md; for user-facing docs see README.md.

What this is

An MCP server that serves GitHub Security Advisories from a local clone of github/advisory-database. Two-tier design: MCP server (stdio or HTTP) → local Express REST API → LocalRepositoryDataSource (reads advisory JSON from disk).

Core MCP tools: list_advisories, get_advisory (full parameters in the README).

Prerequisites

  • Node.js 20+ (CI runs 20.x and 22.x)
  • Git
  • The server runs from dist/ — rebuild after every source change.

Build

npm install      # or: npm ci  (installs from package-lock.json)
npm run build    # tsc -> dist/

Bootstrap the advisory database (needed to run/serve)

The server reads advisory JSON from ADVISORY_REPO_PATH (default ./external/advisory-database). Clone it once:

./scripts/setup-advisory-database.sh
# or manually:
git clone --depth=1 https://github.com/github/advisory-database.git external/advisory-database

external/ is git-ignored. If absent, the server also auto-clones on first tool call.

Run

stdio (what .vscode/mcp.json launches — for VS Code / agent use):

ADVISORY_REPO_PATH=./external/advisory-database node dist/index.js

HTTP streaming:

MCP_PORT=18006 ADVISORY_API_PORT=18005 \
ADVISORY_REPO_PATH=./external/advisory-database node dist/http-server.js
# health: http://localhost:18006/health

Test

  • Unit (fast, hermetic — start here): npx vitest run test/unit
  • E2E (spawns the server; needs the advisory DB): npm run test:e2e
    • The first list_advisories cold-builds an in-memory index over the whole DB; if it flakes on the default 30s timeout, raise it: npx vitest run test/e2e --testTimeout=120000.
  • Integration (Azure OpenAI): npm run test:integration — requires Azure credentials; skip unless you're specifically exercising the AI SDK path.
  • npm test runs all suites (including integration). Prefer test/unit for routine work.

Project layout

PathRole
src/index.tsstdio MCP entry (also starts the local REST API)
src/http-server.tsHTTP streaming MCP entry + REST API
src/local-server.tslocal Express REST API the tools call
src/server.tsshared MCP tool registration
src/datasources/local-repository.tsadvisory indexing + filters
src/tools/MCP tool schemas/handlers
test/{unit,e2e,integration}/test suites

Conventions

  • TypeScript, ES modules, strict tsc build. Add/extend Zod schemas in src/tools/ for any new tool input — inputs are validated at the boundary.
  • Rebuild (npm run build) and restart the server after edits — it runs from dist/.
  • Don't commit dist/, external/, or machine-specific .vscode/mcp.json tweaks (all git-ignored).

Key environment variables

VariableDefaultPurpose
ADVISORY_REPO_PATH./external/advisory-databaseAdvisory DB location
MCP_PORT18006HTTP MCP port
ADVISORY_API_PORT18005Local REST API port
ADVISORY_API_HOST127.0.0.1Local REST API host
ADVISORY_REFRESH_ON_STARTtruegit pull the DB on startup (false to skip)

Semantic search (prototype)

An optional semantic_search tool (local hybrid embeddings + BM25) lives under src/semantic/. Build its index once, then it loads lazily on first call:

npm run build
node dist/semantic/build-index.js --limit 5000   # omit --limit for the full reviewed corpus

Relevant env: SEMANTIC_MODEL (default Xenova/all-MiniLM-L6-v2), SEMANTIC_MODEL_CACHE (point at a local transformers cache to run offline), SEMANTIC_ALLOW_REMOTE=true (allow model download), SEMANTIC_INDEX_DIR.

Network note

Installs use the public npm registry (registry.npmjs.org). If your environment proxies or mirrors npm, configure a git-ignored .npmrc pointing at your mirror; the committed package-lock.json keeps canonical public registry URLs.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.