Skip to content

Add shared MCP workflow for qmd-docs indexing#20792

Merged
pelikhan merged 9 commits intomainfrom
copilot/add-shared-agentic-workflow
Mar 13, 2026
Merged

Add shared MCP workflow for qmd-docs indexing#20792
pelikhan merged 9 commits intomainfrom
copilot/add-shared-agentic-workflow

Conversation

Copy link
Contributor

Copilot AI commented Mar 13, 2026

Adds a shared MCP module (shared/mcp/qmd-docs.md) that restores a pre-built QMD search index and exposes it to agents via a local HTTP MCP server. A dedicated indexer workflow builds and caches the index from trusted content on the main branch. Imports the module into all documentation, dictation, and prompt workflows.

What's added

  • .github/workflows/shared/mcp/qmd-docs.md — installs @tobilu/qmd (on Node.js 24), restores the pre-built index from actions/cache (~/.cache/qmd), starts the QMD HTTP MCP server on localhost:8181, and exposes four MCP tools: query, get, multi_get, status

  • .github/workflows/qmd-docs-indexer.yml — standalone GitHub Actions workflow that builds and saves the QMD index. Triggers on push to main (path-filtered to indexed directories) and on a daily schedule to capture any missed pushes. Index is only ever built from trusted content on main. Uses actions/checkout@v6.0.2 and actions/setup-node@v6.

Indexed collections

Collection Source Description
docs docs/src/content/docs/ Documentation guides and reference
agents .github/agents/ Custom agent definitions and instructions
aw .github/aw/ Workflow authoring instructions and templates

Usage

imports:
  - shared/mcp/qmd-docs.md

Once imported, agents can search the docs with BM25 keyword search (lex queries) out of the box. For semantic/hybrid search, qmd embed can be added to the setup steps to generate local GGUF embeddings.

Caching

The qmd index (~/.cache/qmd) is built and cached by qmd-docs-indexer.yml using a key derived from hashFiles('docs/src/content/docs/**', '.github/agents/**', '.github/aw/**'). The shared module restores this cache at runtime — no indexing occurs during agent workflow runs.

Workflows updated

The shared/mcp/qmd-docs.md import has been added to all workflows that update docs, handle dictation, or manage prompts:

  • dictation-prompt.md — dictation / prompt generation
  • daily-doc-updater.md — daily documentation updates
  • daily-doc-healer.md — documentation gap detection and correction
  • developer-docs-consolidator.md — developer documentation consolidation
  • unbloat-docs.md — documentation simplification
  • glossary-maintainer.md — glossary maintenance
  • technical-doc-writer.md — technical documentation review
Original prompt

Add a shared agentic workflow that mounts a qmd index over our docs and sets up the MCP tool.

https://github.com/tobi/qmd


💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Add shared agentic workflow to mount qmd index Add shared MCP workflow for qmd docs indexing Mar 13, 2026
Copilot AI requested a review from pelikhan March 13, 2026 13:23
Copy link
Contributor

@pelikhan pelikhan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot use an actions/cache to reuse index

@pelikhan
Copy link
Contributor

@copilot import qmd shared workflow in all workflows that update prompts, dictation, update docs

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Mar 13, 2026

@copilot use an actions/cache to reuse index

Added in b98c084. The index is cached under ~/.cache/qmd using a key derived from hashFiles('docs/src/content/docs/**'), so indexing only runs when docs change. Both the restore and save steps are skipped on cache hits.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/graphql
    • Triggering command: /usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw GOMOD GOMODCACHE go ache�� -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw GOMOD GOMODCACHE go env ck &#39;scripts/**/*GOINSECURE GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw GOMOD GOMODCACHE erignore env GOPATH); \ if coGOINSECURE GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE o fix.&#34;; \ exitGO111MODULE (http block)
  • https://api.github.com/repos/astral-sh/setup-uv/git/ref/tags/eac588ad8def6316056a12d4907a9d4d84ff7a3b
    • Triggering command: /usr/bin/gh gh api /repos/astral-sh/setup-uv/git/ref/tags/eac588ad8def6316056a12d4907a9d4d84ff7a3b --jq .object.sha ck &#39;scripts/**/*GOINSECURE GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE sh (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/a70c5eada06553e3510ac27f2c3bda9d3705bccb
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/a70c5eada06553e3510ac27f2c3bda9d3705bccb --jq .object.sha ck &#39;scripts/**/*GOINSECURE GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE sh (http block)
  • https://api.github.com/repos/githubnext/agentics/git/ref/tags/
    • Triggering command: /usr/bin/gh gh api /repos/githubnext/agentics/git/ref/tags/# --jq .object.sha 7094664/b388/_pkGOINSECURE GO111MODULE 64/bin/go GOINSECURE b/gh-aw/pkg/consrev-parse GOMODCACHE go env IP1v/6W5K8jb4A8GGOSUMDB GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE 7094664/b388/imp-f (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI requested a review from pelikhan March 13, 2026 13:34
@pelikhan pelikhan marked this pull request as ready for review March 13, 2026 13:37
Copilot AI review requested due to automatic review settings March 13, 2026 13:37
@pelikhan
Copy link
Contributor

@copilot rename to qmd-docs

@pelikhan
Copy link
Contributor

@copilot also index markdowns in .github/agents and .github/aw

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a shared MCP module that indexes the repo docs with QMD and exposes a local HTTP MCP server for agent-accessible documentation search.

Changes:

  • Introduces a shared qmd MCP server configuration (HTTP on localhost:8181) with a restricted tool allowlist.
  • Adds setup steps to install QMD, (re)index docs/src/content/docs, and start the server with a health-check gate.
  • Adds GitHub Actions cache restore/save for ~/.cache/qmd keyed on a docs content hash.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines +39 to +40
key: qmd-docs-${{ hashFiles('docs/src/content/docs/**') }}
restore-keys: qmd-docs-
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Mar 13, 2026

@copilot import qmd shared workflow in all workflows that update prompts, dictation, update docs

Done in e64e526. Added shared/mcp/qmd.md to all 7 relevant workflows: dictation-prompt, daily-doc-updater, daily-doc-healer, developer-docs-consolidator, unbloat-docs, glossary-maintainer, and technical-doc-writer.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/graphql
    • Triggering command: /usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw (http block)
    • Triggering command: /usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw _value&#34;].&#34;\n&#34;; (http block)
    • Triggering command: /usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw plorer.md (http block)
  • https://api.github.com/repos/actions/cache/git/ref/tags/v4
    • Triggering command: /usr/bin/gh gh api /repos/actions/cache/git/ref/tags/v4 --jq .object.sha .md (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/cache/git/ref/tags/v4 --jq .object.sha d -n 10 (http block)
  • https://api.github.com/repos/actions/setup-node/git/ref/tags/v4
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v4 --jq .object.sha .md (http block)
  • https://api.github.com/repos/astral-sh/setup-uv/git/ref/tags/eac588ad8def6316056a12d4907a9d4d84ff7a3b
    • Triggering command: /usr/bin/gh gh api /repos/astral-sh/setup-uv/git/ref/tags/eac588ad8def6316056a12d4907a9d4d84ff7a3b --jq .object.sha .md (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/a70c5eada06553e3510ac27f2c3bda9d3705bccb
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/a70c5eada06553e3510ac27f2c3bda9d3705bccb --jq .object.sha .md (http block)
  • https://api.github.com/repos/githubnext/agentics/git/ref/tags/
    • Triggering command: /usr/bin/gh gh api /repos/githubnext/agentics/git/ref/tags/# --jq .object.sha .md (http block)

If you need me to access, download, or install something from one of these locations, you can either:

…dexing

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Mar 13, 2026

@copilot rename to qmd-docs

Done in a712cba. Renamed to shared/mcp/qmd-docs.md and updated all 7 workflow imports accordingly. The old qmd.md is now a stub pointing to the new name.

@copilot also index markdowns in .github/agents and .github/aw

Done in a712cba. Added .github/agents (as agents collection) and .github/aw (as aw collection) to the indexing step. Both directories are checked for existence before indexing, and the cache key now hashes all three source directories (docs/src/content/docs/**, .github/agents/**, .github/aw/**).

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/graphql
    • Triggering command: /usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw (http block)
    • Triggering command: /usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw -embedcfg /tmp/go-build2329420286/b336/embedcfg -pack (http block)
  • https://api.github.com/repos/astral-sh/setup-uv/git/ref/tags/eac588ad8def6316056a12d4907a9d4d84ff7a3b
    • Triggering command: /usr/bin/gh gh api /repos/astral-sh/setup-uv/git/ref/tags/eac588ad8def6316056a12d4907a9d4d84ff7a3b --jq .object.sha (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/a70c5eada06553e3510ac27f2c3bda9d3705bccb
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/a70c5eada06553e3510ac27f2c3bda9d3705bccb --jq .object.sha (http block)
  • https://api.github.com/repos/githubnext/agentics/git/ref/tags/
    • Triggering command: /usr/bin/gh gh api /repos/githubnext/agentics/git/ref/tags/# --jq .object.sha (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title Add shared MCP workflow for qmd docs indexing Add shared MCP workflow for qmd-docs indexing Mar 13, 2026
@pelikhan
Copy link
Contributor

@copilot

  • move the indexing tasks into a separate actions .yml workflow that triggers on push to main and filters to path that get indexed.

  • also run on daily schedule to capture missed pushes.

  • remove index update in qmd-docs.md

Rationale: index only updated with trusted docs.

…cs.md

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Mar 13, 2026

@copilot

  • move the indexing tasks into a separate actions .yml workflow that triggers on push to main and filters to path that get indexed....

Done in 019b802.

  • Created .github/workflows/qmd-docs-indexer.yml — triggers on push to main (path-filtered to docs/src/content/docs/**, .github/agents/**, .github/aw/**) and on a daily schedule at 03:00 UTC. It checks out the repo, installs QMD, and builds/saves the index cache.
  • Removed all indexing steps from qmd-docs.md — the shared module now only installs QMD, restores the pre-built cache, and starts the MCP server.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/graphql
    • Triggering command: /usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw (http block)
  • https://api.github.com/repos/astral-sh/setup-uv/git/ref/tags/eac588ad8def6316056a12d4907a9d4d84ff7a3b
    • Triggering command: /usr/bin/gh gh api /repos/astral-sh/setup-uv/git/ref/tags/eac588ad8def6316056a12d4907a9d4d84ff7a3b --jq .object.sha (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/a70c5eada06553e3510ac27f2c3bda9d3705bccb
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/a70c5eada06553e3510ac27f2c3bda9d3705bccb --jq .object.sha (http block)
  • https://api.github.com/repos/githubnext/agentics/git/ref/tags/
    • Triggering command: /usr/bin/gh gh api /repos/githubnext/agentics/git/ref/tags/# --jq .object.sha (http block)

If you need me to access, download, or install something from one of these locations, you can either:

runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot update to latest release of actions/checkout and sha, also for setup-node

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 8bab062. Updated to actions/checkout@de0fac2e # v6.0.2 and actions/setup-node@395ad326 # v6 — matching the versions used across other workflows in the repo.

id: qmd-cache
uses: actions/cache/restore@v4
with:
path: ~/.cache/qmd
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot mount cache in /tmp/gh-aw/cache/qmd-docs

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 003f149. Both the shared module and indexer now use /tmp/gh-aw/cache/qmd-docs as the cache path. A symlink ~/.cache/qmd → /tmp/gh-aw/cache/qmd-docs is created at runtime so qmd finds its data at its default location.

…-docs-indexer.yml

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@pelikhan
Copy link
Contributor

@copilot revert 003f149

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Mar 13, 2026

@copilot revert 003f149

Reverted in 3cce874.

@pelikhan pelikhan merged commit edd81b6 into main Mar 13, 2026
@pelikhan pelikhan deleted the copilot/add-shared-agentic-workflow branch March 13, 2026 14:49
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.

3 participants