Skip to content

feat: add a tool to fetch pages from the repository's GitHub wiki - #274

Open
Rutvij97 wants to merge 1 commit into
idosal:mainfrom
Rutvij97:feat/github-wiki-tool
Open

Rutvij97 wants to merge 1 commit into
idosal:mainfrom
Rutvij97:feat/github-wiki-tool

Conversation

@Rutvij97

Copy link
Copy Markdown

Problem

Many projects keep guides, FAQs and design notes in their GitHub wiki, which GitMCP cannot currently reach: the wiki is a separate git repository, so neither the documentation fetch nor code search sees it (#159).

Changes

  • New fetch_<repo-name>_wiki tool on the default repository handler (read-only, optional page parameter).
    • Without page: lists the wiki pages (parsed from github.com/{owner}/{repo}/wiki/_pages) and returns the Home page.
    • With page: accepts a title (Getting Started), slug (Getting-Started), file name (Getting-Started.md) or full wiki URL, and returns the page Markdown from raw.githubusercontent.com/wiki/{owner}/{repo}/{Page}.md.
    • Wiki page names are case-sensitive, so if the exact name is not found the tool retries with a case-insensitive match from the page list. If there is still no match, it returns the available pages.
    • All requests go through the existing fetchFileWithRobotsTxtCheck. A clear message is returned when the repository has no wiki.
  • Helpers live in src/api/utils/wiki.ts, and the tool name uses enforceToolNameLengthLimit like the other tools.
  • README: documented the tool in the Tools section.

Tests

New unit tests in src/api/utils/wiki.test.ts and src/api/tools/wiki.test.ts. They mock fetch, so no network is used. src/api/tools/index.test.ts now expects the new tool.

  • pnpm test (vitest run): 9 files, 57 tests passed (37 before this change).
  • pnpm build: succeeds.
  • npx prettier --check on the changed source and test files: clean.
  • npx tsc -p tsconfig.cloudflare.json --noEmit: reports the same 8 errors as main. They are in app/chat/lib/user-id.ts, app/routes/_index.tsx, commonTools.ts (AutoRAG types), cache.ts and index.ts, and this change adds none.

Closes #159

Add a fetch_<repo>_wiki tool to the default repository handler. Without a
page it lists the wiki pages and returns the Home page; with a page name,
title or wiki URL it returns that page's Markdown from
raw.githubusercontent.com, falling back to a case-insensitive match and
listing the available pages when the page is not found. Requests go
through the existing robots.txt check.

Closes idosal#159
@voucha-checks

voucha-checks Bot commented Nov 12, 2026

Copy link
Copy Markdown

VOUCHA

VOUCHA is currently in early access and is not enabled for this repository yet.

To request access, contact @idosal.

VOUCHA has not added a comprehension check to this PR.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for github wiki

1 participant