Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# EditorConfig: https://editorconfig.org
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = space
indent_size = 4

[*.{ps1,psm1,psd1,ps1xml}]
indent_size = 4

[*.{yml,yaml,json}]
indent_size = 2

[*.md]
trim_trailing_whitespace = false

[*.txt]
trim_trailing_whitespace = false
17 changes: 17 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Normalise line endings to LF in the repository and on checkout on every platform.
* text=auto eol=lf

*.ps1 text eol=lf
*.psm1 text eol=lf
*.psd1 text eol=lf
*.ps1xml text eol=lf
*.md text eol=lf
*.yml text eol=lf
*.yaml text eol=lf
*.json text eol=lf
*.ts text eol=lf
*.txt text eol=lf

*.png binary
*.ico binary
*.nupkg binary
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Default owner for everything in the repository.
* @nullthrone
51 changes: 51 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Bug report
description: Something does not work as documented or as the specification requires.
labels: ['bug', 'needs confirmation']
body:
- type: textarea
id: description
attributes:
label: What happened?
description: What did you do, what did you expect, what happened instead?
validations:
required: true
- type: textarea
id: reproduction
attributes:
label: Reproduction
description: Minimal script or steps. For protocol issues include the JSON-RPC messages (redact secrets).
render: powershell
- type: input
id: module-version
attributes:
label: Module version
placeholder: 0.1.0-preview1
validations:
required: true
- type: input
id: powershell-version
attributes:
label: PowerShell version and operating system
description: Output of `$PSVersionTable.PSVersion` and `$PSVersionTable.OS`
placeholder: 7.4.20 on Ubuntu 24.04
validations:
required: true
- type: dropdown
id: area
attributes:
label: Area
options:
- Server (stdio)
- Server (Streamable HTTP)
- Client
- Authorization
- Extensions (Tasks, Skills, Apps)
- Legacy revisions (2025-11-25 / 2025-06-18)
- Build, tests, CI
- Other
- type: checkboxes
id: severity
attributes:
label: Impact
options:
- label: This prevents basic MCP operations (connection, message exchange, tools/resources/prompts), i.e. a P0 candidate.
8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
blank_issues_enabled: true
contact_links:
- name: Security vulnerability
url: https://github.com/nullthrone/powershell-sdk/security/advisories/new
about: Please report security problems privately, not as a public issue.
- name: Model Context Protocol specification
url: https://modelcontextprotocol.io/specification/2026-07-28
about: Questions about the protocol itself belong to the specification repository.
23 changes: 23 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Feature request
description: A new capability or an improvement.
labels: ['enhancement', 'needs confirmation']
body:
- type: textarea
id: problem
attributes:
label: Problem
description: What can you not do today, or what is harder than it should be?
validations:
required: true
- type: textarea
id: proposal
attributes:
label: Proposal
description: Sketch of the API or behaviour you have in mind, ideally as PowerShell.
render: powershell
- type: input
id: spec
attributes:
label: Specification reference
description: Section of the specification, extension or SEP this relates to, if any.
placeholder: https://modelcontextprotocol.io/specification/2026-07-28/...
15 changes: 15 additions & 0 deletions .github/ISSUE_TEMPLATE/question.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Question
description: Ask about usage, design decisions or the roadmap.
labels: ['question']
body:
- type: textarea
id: question
attributes:
label: Question
validations:
required: true
- type: textarea
id: context
attributes:
label: Context
description: What are you trying to achieve? Which host or client is involved?
11 changes: 11 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
## Summary

<!-- What changes and why. Reference the milestone item (ROADMAP.md) or the issue. -->

## Checklist

- [ ] `./build.ps1 -Task CI` passes locally (Analyze, Test, Package, PublishLocal)
- [ ] New behaviour is covered by tests (unit, integration or spec)
- [ ] `CHANGELOG.md` has an entry under `[Unreleased]` for user-visible changes
- [ ] `conformance-baseline.yml` is unchanged or shrank
- [ ] Documentation updated where behaviour or public API changed
56 changes: 56 additions & 0 deletions .github/actions/install-pwsh/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Install pinned PowerShell
description: >-
Downloads the given PowerShell release from github.com/PowerShell/PowerShell, extracts it into the runner's
temp folder and prepends it to PATH so that later `shell: pwsh` steps use exactly this version.
inputs:
version:
description: PowerShell version to install, e.g. 7.4.20
required: true
runs:
using: composite
steps:
- name: Download and extract (Linux, macOS)
if: runner.os != 'Windows'
shell: bash
env:
PWSH_VERSION: ${{ inputs.version }}
run: |
set -euo pipefail
case "$RUNNER_OS-$(uname -m)" in
Linux-x86_64) asset="linux-x64.tar.gz" ;;
Linux-aarch64) asset="linux-arm64.tar.gz" ;;
macOS-arm64) asset="osx-arm64.tar.gz" ;;
macOS-x86_64) asset="osx-x64.tar.gz" ;;
*) echo "Unsupported runner: $RUNNER_OS-$(uname -m)"; exit 1 ;;
esac
url="https://github.com/PowerShell/PowerShell/releases/download/v${PWSH_VERSION}/powershell-${PWSH_VERSION}-${asset}"
dest="$RUNNER_TEMP/pwsh-${PWSH_VERSION}"
mkdir -p "$dest"
echo "Downloading $url"
curl -sSfL --retry 5 --retry-delay 5 -o "$RUNNER_TEMP/pwsh.tar.gz" "$url"
tar -xzf "$RUNNER_TEMP/pwsh.tar.gz" -C "$dest"
chmod +x "$dest/pwsh"
echo "$dest" >> "$GITHUB_PATH"
- name: Download and extract (Windows)
if: runner.os == 'Windows'
shell: pwsh
env:
PWSH_VERSION: ${{ inputs.version }}
run: |
$ErrorActionPreference = 'Stop'
$version = $env:PWSH_VERSION
$url = "https://github.com/PowerShell/PowerShell/releases/download/v$version/powershell-$version-win-x64.zip"
$archive = Join-Path $env:RUNNER_TEMP 'pwsh.zip'
$dest = Join-Path $env:RUNNER_TEMP "pwsh-$version"
Write-Host "Downloading $url"
Invoke-WebRequest -Uri $url -OutFile $archive -MaximumRetryCount 5 -RetryIntervalSec 5
Expand-Archive -Path $archive -DestinationPath $dest -Force
Add-Content -Path $env:GITHUB_PATH -Value $dest
- name: Verify
shell: pwsh
env:
PWSH_VERSION: ${{ inputs.version }}
run: |
$actual = $PSVersionTable.PSVersion.ToString()
Write-Host "pwsh $actual from $PSHOME"
if ($actual -ne $env:PWSH_VERSION) { throw "Expected PowerShell $env:PWSH_VERSION on PATH but found $actual." }
9 changes: 9 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
labels: [dependencies]
commit-message:
prefix: 'ci'
20 changes: 20 additions & 0 deletions .github/labels.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[
{ "name": "bug", "color": "d73a4a", "description": "Type: something is not working" },
{ "name": "enhancement", "color": "a2eeef", "description": "Type: new feature or request" },
{ "name": "question", "color": "d876e3", "description": "Type: further information is requested" },
{ "name": "needs confirmation", "color": "fbca04", "description": "Status: reported, not yet confirmed by a maintainer" },
{ "name": "needs repro", "color": "fbca04", "description": "Status: a reproduction is required before work can start" },
{ "name": "ready for work", "color": "0e8a16", "description": "Status: confirmed and ready to be picked up" },
{ "name": "good first issue", "color": "7057ff", "description": "Status: good for newcomers" },
{ "name": "help wanted", "color": "008672", "description": "Status: extra attention is needed" },
{ "name": "P0", "color": "b60205", "description": "Priority: critical (CVSS >= 7.0 or core MCP operations broken); target fix within 7 days" },
{ "name": "P1", "color": "d93f0b", "description": "Priority: high" },
{ "name": "P2", "color": "e99695", "description": "Priority: medium" },
{ "name": "P3", "color": "f9d0c4", "description": "Priority: low" },
{ "name": "conformance", "color": "1d76db", "description": "Relates to the MCP conformance suite or the baseline" },
{ "name": "spec: 2026-07-28", "color": "0052cc", "description": "Relates to the current specification revision" },
{ "name": "spec: legacy", "color": "5319e7", "description": "Relates to the 2025-11-25 / 2025-06-18 dual-era support" },
{ "name": "security", "color": "b60205", "description": "Security-relevant change or report" },
{ "name": "dependencies", "color": "0366d6", "description": "Dependency updates (Dependabot, build dependencies)" },
{ "name": "documentation", "color": "0075ca", "description": "Improvements or additions to documentation" }
]
109 changes: 109 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
name: CI

on:
push:
branches: [main]
pull_request:
workflow_dispatch:
workflow_call:

permissions:
contents: read

concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
POWERSHELL_TELEMETRY_OPTOUT: '1'
DOTNET_CLI_TELEMETRY_OPTOUT: '1'
DOTNET_NOLOGO: '1'

jobs:
lint:
name: Lint (PSScriptAnalyzer)
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install PowerShell 7.4
uses: ./.github/actions/install-pwsh
with:
version: '7.4.20'
- name: Analyze
shell: pwsh
run: ./build.ps1 -Bootstrap -Task Analyze
- name: Check module name availability on the PowerShell Gallery
shell: pwsh
continue-on-error: true
run: |
$lines = foreach ($name in 'ModelContextProtocol', 'ModelContextProtocol.Sdk') {
$found = Find-PSResource -Name $name -Repository PSGallery -Prerelease -ErrorAction SilentlyContinue
if ($found) { '| `{0}` | taken: version {1} by {2} |' -f $name, $found.Version, $found.Author } else { '| `{0}` | available |' -f $name }
}
$summary = @('## PowerShell Gallery name check', '', '| Name | Status |', '|---|---|') + $lines
$summary | Add-Content -Path $env:GITHUB_STEP_SUMMARY
$summary

test:
name: Test (${{ matrix.os }}, pwsh ${{ matrix.pwsh }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
pwsh: ['7.4.20', '7.5.11', '7.6.6']
env:
MCP_EXPECTED_PWSH_VERSION: ${{ matrix.pwsh }}
steps:
- name: Check out
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install PowerShell ${{ matrix.pwsh }}
uses: ./.github/actions/install-pwsh
with:
version: ${{ matrix.pwsh }}
- name: Build and test
shell: pwsh
run: ./build.ps1 -Bootstrap -Task Test
- name: Upload test results
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: test-results-${{ matrix.os }}-pwsh${{ matrix.pwsh }}
path: output/test-results/
if-no-files-found: warn

ps51-guard:
name: Windows PowerShell 5.1 guard
runs-on: windows-latest
steps:
- name: Check out
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install PowerShell 7.4
uses: ./.github/actions/install-pwsh
with:
version: '7.4.20'
- name: Build and run the guard tests
shell: pwsh
run: ./build.ps1 -Bootstrap -Task Test -TestTag PS51Guard

package:
name: Package
needs: [lint, test, ps51-guard]
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install PowerShell 7.4
uses: ./.github/actions/install-pwsh
with:
version: '7.4.20'
- name: Package and verify the local-repository publish
shell: pwsh
run: ./build.ps1 -Bootstrap -Task Package, PublishLocal
- name: Upload package
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: nupkg
path: output/packages/*.nupkg
if-no-files-found: error
34 changes: 34 additions & 0 deletions .github/workflows/labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Sync issue labels

# Creates or updates the repository labels from .github/labels.json (the label taxonomy of the MCP SDK tiering
# guidelines plus repository-specific labels). Runs on demand and whenever the file changes on main.

on:
workflow_dispatch:
push:
branches: [main]
paths: ['.github/labels.json']

permissions:
issues: write

jobs:
sync:
name: Create or update labels
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Sync labels
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
run: |
set -euo pipefail
jq -c '.[]' .github/labels.json | while read -r label; do
name=$(jq -r '.name' <<< "$label")
color=$(jq -r '.color' <<< "$label")
description=$(jq -r '.description' <<< "$label")
gh label create "$name" --color "$color" --description "$description" --force
echo "synced: $name"
done
Loading
Loading