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
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ jobs:
| `command` | No\* | | Server command to run via stdio (e.g., `node dist/index.js`) |
| `args` | No | | Arguments for the server command (space-separated) |
| `url` | No\* | | Server URL for streamable-http transport |
| `sse` | No | `false` | Use SSE transport instead of streamable-http (requires `url`) |
| `headers` | No | | Custom HTTP headers, one per line as `Key: Value` |
| `fail-on` | No | `breaking` | Severity threshold for failure: `safe`, `warning`, `breaking` |
| `comment-on-pr` | No | `true` | Post diff as a PR comment |
| `github-token` | No | `github.token` | GitHub token for PR comments |
Expand Down Expand Up @@ -71,3 +73,17 @@ npx mcpdiff snapshot --command node --args server.js -o contracts/baseline.mcpc.
```

Commit this file to your repository and reference it in the `baseline` input.

## SSE Transport with Custom Headers

```yaml
- name: Check MCP contract (SSE)
uses: mcp-contracts/github-action@main
with:
baseline: contracts/baseline.mcpc.json
url: https://mcp.example.com/sse
sse: "true"
headers: |
Authorization: Bearer ${{ secrets.MCP_TOKEN }}
fail-on: breaking
```
7 changes: 7 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ inputs:
url:
description: "Server URL for streamable-http transport"
required: false
sse:
description: "Use SSE transport instead of streamable-http (requires url)"
required: false
default: "false"
headers:
description: "Custom HTTP headers, one per line as 'Key: Value'"
required: false
fail-on:
description: "Severity threshold for failure: safe | warning | breaking"
required: false
Expand Down
38 changes: 38 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"$schema": "https://biomejs.dev/schemas/2.4.6/schema.json",
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"complexity": {
"noExcessiveCognitiveComplexity": {
"level": "warn",
"options": { "maxAllowedComplexity": 20 }
},
"useLiteralKeys": "off"
},
"style": {
"noDefaultExport": "error",
"useNodejsImportProtocol": "error"
},
"suspicious": {
"noExplicitAny": "error"
}
}
},
"formatter": {
"enabled": true,
"indentStyle": "tab",
"lineWidth": 100
},
"javascript": {
"formatter": {
"quoteStyle": "double",
"semicolons": "always",
"trailingCommas": "all"
}
},
"files": {
"includes": ["**", "!**/dist"]
}
}
Loading
Loading