Skip to content

Commit 2e4d1d6

Browse files
authored
Expand MCP CLI debugging toolkit
1 parent d0f706c commit 2e4d1d6

44 files changed

Lines changed: 8436 additions & 31 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/cli_binaries.yml

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
name: Build CLI Binaries
2+
3+
on:
4+
push:
5+
tags:
6+
- 'mcp_dart_cli-v*'
7+
workflow_dispatch:
8+
inputs:
9+
tag:
10+
description: 'CLI release tag to attach assets to, for example mcp_dart_cli-v0.1.9'
11+
required: true
12+
type: string
13+
14+
permissions:
15+
contents: write
16+
17+
jobs:
18+
build:
19+
name: Build ${{ matrix.asset }}
20+
runs-on: ${{ matrix.os }}
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
include:
25+
- os: ubuntu-latest
26+
asset: mcp_dart-linux-x64
27+
- os: macos-13
28+
asset: mcp_dart-macos-x64
29+
- os: macos-14
30+
asset: mcp_dart-macos-arm64
31+
- os: windows-latest
32+
asset: mcp_dart-windows-x64.exe
33+
34+
defaults:
35+
run:
36+
working-directory: packages/mcp_dart_cli
37+
38+
steps:
39+
- uses: actions/checkout@v6
40+
41+
- uses: dart-lang/setup-dart@v1
42+
with:
43+
sdk: stable
44+
45+
- name: Install dependencies
46+
run: dart pub get
47+
48+
- name: Compile executable
49+
shell: bash
50+
run: |
51+
mkdir -p dist
52+
dart compile exe bin/mcp_dart.dart -o "dist/${{ matrix.asset }}"
53+
54+
- name: Smoke test executable
55+
shell: bash
56+
run: |
57+
"./dist/${{ matrix.asset }}" --version
58+
59+
- name: Upload binary artifact
60+
uses: actions/upload-artifact@v5
61+
with:
62+
name: ${{ matrix.asset }}
63+
path: packages/mcp_dart_cli/dist/${{ matrix.asset }}
64+
if-no-files-found: error
65+
66+
release-assets:
67+
name: Attach binaries to release
68+
runs-on: ubuntu-latest
69+
needs: build
70+
steps:
71+
- uses: actions/checkout@v6
72+
73+
- name: Resolve release tag
74+
id: tag
75+
run: |
76+
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
77+
echo "tag=${{ inputs.tag }}" >> "$GITHUB_OUTPUT"
78+
else
79+
echo "tag=${{ github.ref_name }}" >> "$GITHUB_OUTPUT"
80+
fi
81+
82+
- name: Download binary artifacts
83+
uses: actions/download-artifact@v6
84+
with:
85+
path: dist
86+
merge-multiple: true
87+
88+
- name: Add bundled skill asset
89+
run: |
90+
cp packages/mcp_dart_cli/lib/src/skills/mcp-developer/SKILL.md dist/mcp-developer.SKILL.md
91+
92+
- name: Attach binaries
93+
uses: softprops/action-gh-release@v3
94+
with:
95+
tag_name: ${{ steps.tag.outputs.tag }}
96+
files: dist/*
97+
fail_on_unmatched_files: true

.github/workflows/test_cli.yml

Lines changed: 52 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,22 @@ on:
77
pull_request:
88
paths:
99
- 'packages/mcp_dart_cli/**'
10+
- 'test/interop/python/**'
11+
- 'test/interop/ts/**'
12+
- 'tool/install.sh'
13+
- 'tool/install.ps1'
14+
- '.github/workflows/cli_binaries.yml'
1015
- '.github/workflows/test_cli.yml'
1116
push:
1217
branches:
1318
- main
1419
paths:
1520
- 'packages/mcp_dart_cli/**'
21+
- 'test/interop/python/**'
22+
- 'test/interop/ts/**'
23+
- 'tool/install.sh'
24+
- 'tool/install.ps1'
25+
- '.github/workflows/cli_binaries.yml'
1626
- '.github/workflows/test_cli.yml'
1727

1828
jobs:
@@ -31,14 +41,44 @@ jobs:
3141
with:
3242
sdk: stable
3343

44+
- name: Set up Node.js
45+
uses: actions/setup-node@v6
46+
with:
47+
node-version: '20'
48+
49+
- name: Set up Python
50+
uses: actions/setup-python@v6
51+
with:
52+
python-version: '3.12'
53+
54+
- name: Install TS interop dependencies
55+
working-directory: test/interop/ts
56+
run: npm ci
57+
58+
- name: Build TS interop fixtures
59+
working-directory: test/interop/ts
60+
run: npm run build
61+
62+
- name: Install Python interop dependencies
63+
working-directory: .
64+
run: python -m pip install -r test/interop/python/requirements.txt
65+
3466
- name: Install dependencies
3567
run: dart pub get
3668

69+
- name: Validate standalone installers
70+
working-directory: .
71+
run: |
72+
sh -n tool/install.sh
73+
pwsh -NoLogo -NoProfile -Command "\$ErrorActionPreference = 'Stop'; \$errors = \$null; [void][System.Management.Automation.PSParser]::Tokenize((Get-Content -Raw tool/install.ps1), [ref]\$errors); if (\$errors) { throw \$errors[0] }"
74+
3775
- name: Analyze project
3876
run: dart analyze
3977

40-
- name: Run tests
41-
run: dart test
78+
- name: Run tests with coverage
79+
run: |
80+
dart pub global activate coverage
81+
dart pub global run coverage:test_with_coverage
4282
4383
- name: Run MCP spec conformance gate
4484
run: dart run bin/mcp_dart.dart conformance --suite all --json
@@ -72,3 +112,13 @@ jobs:
72112
exit 1
73113
fi
74114
echo "✓ Package achieves perfect score"
115+
116+
- name: Upload coverage to Codecov
117+
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.user.login != 'dependabot[bot]' }}
118+
uses: codecov/codecov-action@v6
119+
with:
120+
token: ${{ secrets.CODECOV_TOKEN }}
121+
files: packages/mcp_dart_cli/coverage/lcov.info
122+
flags: cli
123+
name: codecov-cli
124+
fail_ci_if_error: true

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,9 @@ mcp_dart inspect --tool add --json-args '{"a": 1, "b": 2}' # Call a tool
153153
| `serve` | Run your server (stdio or HTTP) |
154154
| `doctor` | Check project health and connectivity |
155155
| `inspect` | Test and debug server capabilities |
156+
| `inspect-server` | Produce a structured live server inspection report |
157+
| `inspect-client` | Run a stdio harness that inspects a connecting client |
158+
| `trace` | Proxy stdio client/server traffic and write a JSON trace |
156159

157160
📖 **[Full CLI Documentation](https://github.com/leehack/mcp_dart/tree/main/packages/mcp_dart_cli)**
158161

codecov.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ coverage:
22
status:
33
project:
44
default:
5-
# Workflow-only PRs can show tiny run-to-run coverage variance even when
6-
# no Dart source lines change. Keep project coverage enforced, but allow
7-
# a narrow tolerance so unrelated CI-maintenance PRs are not blocked by
8-
# a sub-0.1% coverage fluctuation.
9-
threshold: 0.1%
5+
target: auto
6+
threshold: 5%
7+
patch:
8+
default:
9+
target: 70%
10+
threshold: 1%

packages/mcp_dart_cli/.pubignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
coverage/
2+
.dart_tool/
3+
test/e2e/
4+
test/fixtures/dart_mcp_project/
5+
test/fixtures/**/.dart_tool/
6+
test/fixtures/**/pubspec.lock

packages/mcp_dart_cli/CHANGELOG.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,30 @@
1+
## Unreleased
2+
3+
- Add `mcp_dart inspect-server` for structured MCP server inspection reports
4+
covering handshake, capabilities, ping, tools, resources, resource templates,
5+
prompts, completions, logging, task-capable tool calls, notifications,
6+
Streamable HTTP session handling, and OAuth protected-resource metadata
7+
discovery, with optional JSON probe configs for app-specific tool, resource,
8+
prompt, completion, and task arguments.
9+
- Add `mcp_dart inspect-client` as a stdio MCP harness for inspecting client
10+
initialization, advertised capabilities, primitive discovery/call behavior,
11+
and active roots/sampling/elicitation request handling.
12+
- Add `mcp_dart trace` as a stdio proxy that forwards client/server traffic and
13+
writes a JSON trace report with raw frames, parsed messages, ids, methods,
14+
timings, server stderr, and malformed-frame errors.
15+
- Add `mcp_dart list-tools` and `mcp_dart call-tool` as scriptable MCP
16+
debugging commands for Dart, TypeScript, Python, and other spec-compatible
17+
servers.
18+
- Add `mcp_dart skills install/print` with a bundled MCP developer agent skill.
19+
- Add CLI e2e interop coverage against official TypeScript/Python MCP SDK
20+
servers and clients, Streamable HTTP, and published TypeScript filesystem and
21+
Python time MCP servers.
22+
- Clarify that `inspect-server` and `inspect-client` are the live inspection
23+
workflow, while `conformance` is a built-in SDK/CLI regression fixture suite.
24+
- Add standalone GitHub release binary build automation and one-line installer
25+
scripts for users without the Dart SDK.
26+
- Extend `mcp_dart update` to upgrade standalone GitHub release binaries.
27+
128
## 0.1.8
229

330
- Make `mcp_dart inspect` capability listing respect the server's advertised

0 commit comments

Comments
 (0)