Skip to content

Commit 890032c

Browse files
TianqiZhangCopilot
andauthored
feat: Add experimental CLI for Learn MCP (#117)
* Add in-repo Microsoft Learn companion CLI Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Address PR review feedback Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Address additional PR review feedback Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Remove unused zod dependency Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Remove CLI spec document Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 17984b0 commit 890032c

27 files changed

Lines changed: 4747 additions & 6 deletions

.github/workflows/validate.yml

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,35 @@ on:
88

99
jobs:
1010
validate:
11-
name: Validate Claude Plugin & Skills
11+
name: Validate Repository (Node ${{ matrix.node-version }})
1212
runs-on: ubuntu-latest
13-
13+
strategy:
14+
matrix:
15+
node-version: [22, 24]
16+
1417
steps:
1518
- name: Checkout repository
1619
uses: actions/checkout@v4
1720

21+
- name: Set up Node.js
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: ${{ matrix.node-version }}
25+
cache: npm
26+
cache-dependency-path: cli/package-lock.json
27+
28+
- name: Install CLI dependencies
29+
working-directory: cli
30+
run: npm ci
31+
32+
- name: Build CLI
33+
working-directory: cli
34+
run: npm run build
35+
36+
- name: Test CLI
37+
working-directory: cli
38+
run: npm test
39+
1840
- name: Run validation script
1941
shell: pwsh
2042
run: ./scripts/validate-repo.ps1

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@ _site/
44
.optemp/
55
_themes*/
66
_repo.*/
7-
8-
.openpublishing.buildcore.ps1
7+
node_modules/
8+
.openpublishing.buildcore.ps1
9+
.claude/settings.local.json

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,17 @@ https://learn.microsoft.com/api/mcp?maxTokenBudget=2000
107107
| `microsoft_docs_fetch` | Fetch and convert a Microsoft documentation page into markdown format | `url` (string): URL of the documentation page to read |
108108
| `microsoft_code_sample_search` | Search for official Microsoft/Azure code snippets and examples | `query` (string): Search query for Microsoft/Azure code snippets<br/>`language` (string, optional): Programming language filter.|
109109

110+
## 💻 Companion CLI
111+
112+
This repository now also includes an in-repo companion CLI under [`/cli`](cli/). The `mslearn` CLI is a thin MCP client for the public Learn endpoint and adds shell-friendly commands for docs search, docs fetch, code sample search, and diagnostics.
113+
114+
```bash
115+
cd cli
116+
npm install
117+
npm run build
118+
node dist/index.js --help
119+
```
120+
110121
## 🤖 Agent Skills
111122

112123
[Agent Skills](https://agentskills.io/) are portable instruction packages that help AI agents use tools more effectively. We provide three skills that guide agents on when and how to use the Microsoft Learn MCP tools:

cli/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
dist/
2+
node_modules/
3+
coverage/

cli/README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Microsoft Learn Companion CLI
2+
3+
`mslearn` is a thin companion CLI for the public Microsoft Learn MCP server. It dynamically discovers the available Learn tools at runtime and exposes shell-friendly commands for docs search, docs fetch, code sample search, and environment diagnostics.
4+
5+
## Commands
6+
7+
```bash
8+
mslearn search "azure functions timeout"
9+
mslearn fetch "https://learn.microsoft.com/azure/azure-functions/functions-versions#function-app-timeout-duration" --section "Function app timeout duration"
10+
mslearn code-search "cosmos db change feed processor" --language csharp
11+
mslearn doctor
12+
```
13+
14+
By default, the CLI connects to the public Microsoft Learn MCP endpoint:
15+
16+
```text
17+
https://learn.microsoft.com/api/mcp
18+
```
19+
20+
## Development
21+
22+
```bash
23+
npm install
24+
npm run build
25+
npm test
26+
node dist/index.js --help
27+
```

0 commit comments

Comments
 (0)