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
82 changes: 82 additions & 0 deletions .github/workflows/csharp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: C# CI
on:
push:
branches: [main]
paths:
- 'csharp/**'
- '.github/workflows/csharp.yml'
pull_request:
paths:
- 'csharp/**'
- '.github/workflows/csharp.yml'
workflow_dispatch:

permissions:
contents: read

jobs:
csharp-build:
name: "Build"
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Restore dependencies
run: |
cd csharp/sdk
dotnet restore
- name: Build
run: |
cd csharp/sdk
dotnet build --no-restore --configuration Release

csharp-test:
name: "Unit Tests"
runs-on: ubuntu-latest
strategy:
matrix:
dotnet-version: ['8.0.x', '9.0.x']
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ matrix.dotnet-version }}
- name: Restore dependencies
run: |
cd csharp/sdk
dotnet restore
- name: Run tests
run: |
cd csharp/sdk
dotnet test --no-restore --verbosity normal --collect:"XPlat Code Coverage"

csharp-pack:
name: "Package"
runs-on: ubuntu-latest
needs: [csharp-build, csharp-test]
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Restore dependencies
run: |
cd csharp/sdk
dotnet restore
- name: Create NuGet package
run: |
cd csharp/sdk
dotnet pack --no-restore --configuration Release --output ./artifacts
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: nuget-packages
path: csharp/sdk/artifacts/*.nupkg
12 changes: 11 additions & 1 deletion .github/workflows/status-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
pull_request:
types: [opened, synchronize, reopened]
workflow_run:
workflows: ["Python CI", "Go CI", "TypeScript CI"]
workflows: ["C# CI", "Python CI", "Go CI", "TypeScript CI"]
types: [completed]

permissions:
Expand Down Expand Up @@ -42,6 +42,9 @@ jobs:
uses: dorny/paths-filter@v3
with:
filters: |
csharp:
- 'csharp/**'
- '.github/workflows/csharp.yml'
python:
- 'python/**'
- '.github/workflows/python.yml'
Expand All @@ -62,6 +65,12 @@ jobs:

// Define required checks per language
const requiredChecks = {
csharp: [
'C# CI / Build',
'C# CI / Unit Tests (8.0.x)',
'C# CI / Unit Tests (9.0.x)',
'C# CI / Package'
],
python: [
'Python CI / Linting',
'Python CI / Unit Tests (3.10)',
Expand All @@ -84,6 +93,7 @@ jobs:

// Get changed files from previous step
const changedFiles = {
csharp: ${{ steps.changed-files.outputs.csharp }} === 'true',
python: ${{ steps.changed-files.outputs.python }} === 'true',
go: ${{ steps.changed-files.outputs.go }} === 'true',
typescript: ${{ steps.changed-files.outputs.typescript }} === 'true'
Expand Down
46 changes: 28 additions & 18 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,41 @@
*.so
*.dylib

# Test binary, built with `go test -c`
*.test
# Build results
[Bb]in/
[Oo]bj/
artifacts/

# Code coverage profiles and other test artifacts
*.out
coverage.*
*.coverprofile
profile.cov
# NuGet
*.nupkg
*.snupkg
.nuget/
packages/

# Dependency directories (remove the comment below to include it)
# vendor/
# IDE
.vs/
.vscode/
*.suo
*.user
*.sln.docstates
.idea/
*.swp

# Go workspace file
go.work
go.work.sum
# Build
*.log
msbuild*.binlog

# Test results
TestResults/
coverage/

# OS
.DS_Store
Thumbs.db

# env file
.env

# Editor/IDE
# .idea/
# .vscode/

# Node.js / TypeScript
node_modules/
dist/
Expand All @@ -40,11 +52,9 @@ yarn-error.log*
__pycache__/
*.py[cod]
*$py.class
*.so
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ This repository provides a multi-language reference implementation of the propos

| Language | Directory | Package | Status |
|----------|-----------|---------|--------|
| C# | `csharp/sdk/` | `ModelContextProtocol.Interceptors` | In Progress |
| Go | `go/sdk/` | `github.com/modelcontextprotocol/ext-interceptors/go/sdk` | Planned |
| Python | `python/sdk/` | `mcp-ext-interceptors` | Planned |
| TypeScript | `typescript/sdk/` | `@ext-modelcontextprotocol/interceptors` | Planned |
Expand All @@ -20,7 +21,7 @@ This monorepo uses **path-based CI workflows** to efficiently test only what cha

### How It Works

1. **Language-specific workflows** (`python.yml`, `go.yml`, `typescript.yml`)
1. **Language-specific workflows** (`csharp.yml`, `python.yml`, `go.yml`, `typescript.yml`)
- Only trigger when their language directory or workflow file changes
- Run all tests, linting, and checks for that language

Expand Down Expand Up @@ -73,4 +74,4 @@ Apache License 2.0 - See LICENSE file for details
## Resources

- [Interceptor Framework Specification (SEP-1763)](https://github.com/modelcontextprotocol/modelcontextprotocol/issues/1763) - Full specification and design details
- [Model Context Protocol](https://modelcontextprotocol.io/specification)
- [Model Context Protocol](https://modelcontextprotocol.io/specification)
Loading