mcp-medic 1.0.4 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +41 -5
  2. package/action.yml +29 -1
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -151,24 +151,60 @@ Define organization-wide policies that compose with built-in checks:
151
151
 
152
152
  ## GitHub Action
153
153
 
154
- Add MCP config validation to your PR workflow:
154
+ The `mcp-medic-action` (`shivam039/mcp-doctor@v1`) enables automated MCP configuration validation directly in your CI pipelines. It executes protocol handshakes, validates tool schemas, runs security heuristics, applies organizational policy rules, and gates pull requests against broken MCP setups before they affect downstream AI agents.
155
+
156
+ > **Naming Note**: This GitHub repository (`shivam039/mcp-doctor`) powers the GitHub Action; for local terminal usage or npm scripts, the CLI package is published as **`mcp-medic`** (`npx mcp-medic`).
157
+
158
+ ### Example Workflow
155
159
 
156
160
  ```yaml
157
161
  name: Validate MCP Configs
158
- on: [push, pull_request]
162
+ on:
163
+ push:
164
+ branches: [main]
165
+ pull_request:
166
+ branches: [main]
159
167
 
160
168
  jobs:
161
- validate:
169
+ validate-mcp:
162
170
  runs-on: ubuntu-latest
163
171
  steps:
164
- - uses: actions/checkout@v4
165
- - uses: shivam039/mcp-doctor@main
172
+ - name: Checkout repository
173
+ uses: actions/checkout@v4
174
+
175
+ - name: Validate MCP Configuration
176
+ uses: shivam039/mcp-doctor@v1.0.4 # or @v1
166
177
  with:
167
178
  config-path: './.mcp.json'
168
179
  fail-on: 'error'
169
180
  show-fixes: 'true'
181
+ export-junit: 'junit-mcp-report.xml'
170
182
  ```
171
183
 
184
+ ### Action Inputs
185
+
186
+ | Input | Description | Required | Default |
187
+ |---|---|---|---|
188
+ | `config-path` | Path to the target MCP configuration file (defaults to auto-discovery across `.mcp.json` / Claude Desktop) | No | `''` |
189
+ | `fail-on` | Failure threshold: `'error'` (fails on errors only) or `'warning'` (fails on any error or warning) | No | `'error'` |
190
+ | `show-fixes` | Output actionable fix suggestions under flagged diagnostics (`'true'` / `'false'`) | No | `'true'` |
191
+ | `policy-path` | Path to organizational policy JSON (`.mcp-medic-policy.json`) | No | `''` |
192
+ | `export-junit` | Path to export JUnit XML report for CI test dashboards | No | `''` |
193
+ | `export-json` | Path to export JSON diagnostics report | No | `''` |
194
+ | `snapshot` | Path to baseline snapshot JSON to gate on regressions only | No | `''` |
195
+ | `timeout` | Per-server handshake timeout in milliseconds | No | `'5000'` |
196
+ | `verbose` | Output raw JSON-RPC traffic and debug logs (`'true'` / `'false'`) | No | `'false'` |
197
+
198
+ ### Exit & Failure Behavior
199
+
200
+ The action adheres to strict exit code taxonomy:
201
+ - **`0` (Success)**: All configured MCP servers passed handshake and schema validations cleanly (or warnings were found with `fail-on: 'error'`).
202
+ - **`1` (Diagnostic Failure)**: One or more validation checks failed at or above the configured `fail-on` threshold.
203
+ - **`2` (Usage / Configuration Error)**: Invalid config syntax, unreadable files, or malformed CLI arguments.
204
+
205
+ > [!WARNING]
206
+ > **Execution Security**: In order to perform authentic protocol handshakes, the action spawns stdio processes and establishes real HTTP/SSE network connections specified in your configuration. Only run against configurations and repositories you trust. See [SECURITY.md](./SECURITY.md) for full threat model details.
207
+
172
208
  ---
173
209
 
174
210
  ## Check Ecosystem Directory
package/action.yml CHANGED
@@ -7,7 +7,7 @@ branding:
7
7
 
8
8
  inputs:
9
9
  config-path:
10
- description: 'Path to MCP configuration file (defaults to auto-discovery)'
10
+ description: 'Path to MCP configuration file (defaults to auto-discovery across project/.mcp.json)'
11
11
  required: false
12
12
  default: ''
13
13
  fail-on:
@@ -18,6 +18,22 @@ inputs:
18
18
  description: 'Display actionable fix suggestions under diagnostics'
19
19
  required: false
20
20
  default: 'true'
21
+ policy-path:
22
+ description: 'Path to organizational policy JSON (.mcp-medic-policy.json)'
23
+ required: false
24
+ default: ''
25
+ export-junit:
26
+ description: 'Path to export JUnit XML report for CI test dashboards'
27
+ required: false
28
+ default: ''
29
+ export-json:
30
+ description: 'Path to export JSON diagnostics report'
31
+ required: false
32
+ default: ''
33
+ snapshot:
34
+ description: 'Path to baseline snapshot JSON to gate on regressions only'
35
+ required: false
36
+ default: ''
21
37
  timeout:
22
38
  description: 'Handshake timeout per server in milliseconds'
23
39
  required: false
@@ -48,6 +64,18 @@ runs:
48
64
  if [ -n "${{ inputs.fail-on }}" ]; then
49
65
  ARGS="$ARGS --fail-on ${{ inputs.fail-on }}"
50
66
  fi
67
+ if [ -n "${{ inputs.policy-path }}" ]; then
68
+ ARGS="$ARGS --policy ${{ inputs.policy-path }}"
69
+ fi
70
+ if [ -n "${{ inputs.export-junit }}" ]; then
71
+ ARGS="$ARGS --export-junit ${{ inputs.export-junit }}"
72
+ fi
73
+ if [ -n "${{ inputs.export-json }}" ]; then
74
+ ARGS="$ARGS --export-json ${{ inputs.export-json }}"
75
+ fi
76
+ if [ -n "${{ inputs.snapshot }}" ]; then
77
+ ARGS="$ARGS --snapshot ${{ inputs.snapshot }}"
78
+ fi
51
79
  if [ -n "${{ inputs.timeout }}" ]; then
52
80
  ARGS="$ARGS --timeout ${{ inputs.timeout }}"
53
81
  fi
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mcp-medic",
3
- "version": "1.0.4",
3
+ "version": "1.1.0",
4
4
  "description": "Diagnose broken MCP (Model Context Protocol) server configs before they break your agent silently.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",