60-adding-github-sources

A project guide for adding GitHub repositories as documentation sources to an SAP documentation service. It covers linking a repository, adding its metadata, configuring the build, generating URLs, and testing the source.

In plain words
What is it for?
Use it when adding a GitHub repository whose Markdown documentation should be included in the service.
Why use it?
It turns a multi-file setup task into a defined sequence and helps keep new documentation sources discoverable and validated.

Cursor rule for Cursor

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/marianfoo/mcp-sap-docs/60-adding-github-sources
Clone the repo
git clone --depth 1 https://github.com/marianfoo/mcp-sap-docs

Made for: Cursor.

Per session 2,456 This file is loaded in full into every session.
When invoked 2,456 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.02456 $0.02456
Opus 5 $0.01228 $0.01228
Sonnet 5 $0.00491 $0.00491
Haiku 4.5 $0.00246 $0.00246

Measured 2d ago against content hash 34462eec9139, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

60-adding-github-sources scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

.cursor/rules/60-adding-github-sources.mdc · 326 lines

How it starts

The opening of the file, as written. The whole thing — 326 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Adding New GitHub Documentation Sources (Rule)

Complete guide for adding new GitHub repositories as documentation sources to the SAP docs MCP project.

Overview

The SAP docs MCP uses a metadata-driven architecture that makes adding new GitHub sources straightforward. The process involves 5 main steps:

  1. Git Submodule Setup - Add repository as submodule
  2. Metadata Configuration - Define source in src/metadata.json
  3. Build Configuration - Add to build scripts
  4. URL Generation - Configure URL patterns
  5. Testing & Validation - Add tests and verify functionality

Step-by-Step Process

1. Git Submodule Setup

Add the new repository as a Git submodule in .gitmodules:

# Example: Adding UI5 TypeScript source
[submodule "sources/ui5-typescript"]
    path = sources/ui5-typescript
    url = https://github.com/UI5/typescript.git
    branch = gh-pages  # Specify the correct branch

Key considerations:

  • Use descriptive path names under sources/
  • Specify the correct branch (main, master, gh-pages, etc.)
  • Ensure the repository contains documentation files (typically .md files)

2. Metadata Configuration

Add source definition to src/metadata.json in the sources array:

{
  "id": "ui5-typescript",
  "type": "documentation",
  "lang": "en",
  "boost": 0.1,
  "tags": ["ui5", "typescript", "types", "frontend"],
  "description": "UI5 TypeScript",
  "libraryId": "/ui5-typescript",
  "sourcePath": "ui5-typescript",
  "baseUrl": "https://github.com/UI5/typescript/blob/gh-pages",
  "pathPattern": "/{file}",
  "anchorStyle": "github"
}

Required fields:

  • id: Unique identifier for the source
  • type: "documentation", "api", or "samples"
  • libraryId: Library identifier (usually / + id)
  • sourcePath: Path under sources/ directory
  • baseUrl: Base URL for generated documentation links
  • pathPattern: URL pattern ({file} is replaced with filename)
  • anchorStyle: "github", "docsify", or "custom"

Read the full file on GitHub · 326 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 326 lines · 2,456 tokens per session scan A 34462eec9139

Subscribe to this mod's changes

60-adding-github-sources is a cursor rule published in the GitHub repository marianfoo/mcp-sap-docs (217 stars, last pushed 14d ago), licensed Apache-2.0. It adds 2,456 tokens to every session, about $0.0123 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.