Skip to main content

Crate powershell_mcp

Crate powershell_mcp 

Source
Expand description

powershell-mcp — hybrid vector + BM25 RAG over the official PowerShell documentation.

The source of truth is the MicrosoftDocs/PowerShell-Docs repository (the same markdown that powers learn.microsoft.com/powershell): cmdlet reference pages, about topics, and conceptual guides across all supported PowerShell versions. A CLI walks a checkout of that repo, chunks the markdown with line provenance, embeds every chunk locally (fastembed ONNX, no API key), builds a tantivy BM25 index, and serves hybrid retrieval (reciprocal rank fusion) over MCP or a CLI query command.

A local hybrid RAG server over a documentation corpus. See docs/setup.md for the full workflow.

Modules§

bm25
BM25 full-text index (tantivy) over the chunk corpus.
chunk
File chunking — split documentation files into retrieval units with line provenance.
embed
Local embedding model (fastembed, ONNX, no API key).
install
Install helper: copy the binary to ~/.local/bin, register the MCP server (with POWERSHELL_MCP_HOME pointing at the index directory) in ~/.opengrok/config.toml, and install the embedded skill, baking in the index directory.
rag
Hybrid vector + BM25 store for the PowerShell documentation corpus.
scan
Corpus scanning — walk the PowerShell-Docs checkout and collect the markdown files that should be indexed, with relative paths and sizes.
server
MCP server handler — the three query tools, wired to the RAG store.

Constants§

SERVER_NAME
Name used for the MCP server registration, the installed binary, the skill directory, and the tools’ namespace. The POWERSHELL_MCP_SERVER_NAME environment variable overrides it at install time.