Skip to content

Commit 336e13a

Browse files
committed
Merge main into pcarleton/blue
2 parents a8d1868 + e5cdffe commit 336e13a

File tree

15 files changed

+628
-23
lines changed

15 files changed

+628
-23
lines changed

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Enforce LF line endings for all text files
2+
* text=auto eol=lf
3+

.github/dependabot.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
version: 2
2+
3+
updates:
4+
- package-ecosystem: npm
5+
directory: /
6+
schedule:
7+
interval: weekly
8+
cooldown:
9+
default-days: 7
10+
11+
- package-ecosystem: github-actions
12+
directory: /
13+
schedule:
14+
interval: weekly
15+
cooldown:
16+
default-days: 7

.prettierrc.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"endOfLine": "lf",
23
"singleQuote": true,
34
"trailingComma": "none",
45
"overrides": [

package-lock.json

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
"commander": "^14.0.2",
5050
"eventsource-parser": "^3.0.6",
5151
"express": "^5.1.0",
52+
"jose": "^6.1.2",
5253
"zod": "^3.25.76"
5354
}
5455
}

src/runner/client.ts

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ async function executeClient(
1616
command: string,
1717
scenarioName: string,
1818
serverUrl: string,
19-
timeout: number = 30000
19+
timeout: number = 30000,
20+
context?: Record<string, unknown>
2021
): Promise<ClientExecutionResult> {
2122
const commandParts = command.split(' ');
2223
const executable = commandParts[0];
@@ -26,30 +27,37 @@ async function executeClient(
2627
let stderr = '';
2728
let timedOut = false;
2829

30+
// Build environment with optional context
31+
const env = { ...process.env };
32+
if (context) {
33+
env.MCP_CONFORMANCE_CONTEXT = JSON.stringify(context);
34+
}
35+
2936
return new Promise((resolve) => {
30-
const process = spawn(executable, args, {
37+
const childProcess = spawn(executable, args, {
3138
shell: true,
32-
stdio: 'pipe'
39+
stdio: 'pipe',
40+
env
3341
});
3442

3543
const timeoutHandle = setTimeout(() => {
3644
timedOut = true;
37-
process.kill();
45+
childProcess.kill();
3846
}, timeout);
3947

40-
if (process.stdout) {
41-
process.stdout.on('data', (data) => {
48+
if (childProcess.stdout) {
49+
childProcess.stdout.on('data', (data) => {
4250
stdout += data.toString();
4351
});
4452
}
4553

46-
if (process.stderr) {
47-
process.stderr.on('data', (data) => {
54+
if (childProcess.stderr) {
55+
childProcess.stderr.on('data', (data) => {
4856
stderr += data.toString();
4957
});
5058
}
5159

52-
process.on('close', (code) => {
60+
childProcess.on('close', (code) => {
5361
clearTimeout(timeoutHandle);
5462
resolve({
5563
exitCode: code || 0,
@@ -59,7 +67,7 @@ async function executeClient(
5967
});
6068
});
6169

62-
process.on('error', (error) => {
70+
childProcess.on('error', (error) => {
6371
clearTimeout(timeoutHandle);
6472
resolve({
6573
exitCode: -1,
@@ -93,13 +101,17 @@ export async function runConformanceTest(
93101
console.error(
94102
`Executing client: ${clientCommand} ${scenarioName} ${urls.serverUrl}`
95103
);
104+
if (urls.context) {
105+
console.error(`With context: ${JSON.stringify(urls.context)}`);
106+
}
96107

97108
try {
98109
const clientOutput = await executeClient(
99110
clientCommand,
100111
scenarioName,
101112
urls.serverUrl,
102-
timeout
113+
timeout,
114+
urls.context
103115
);
104116

105117
// Print stdout/stderr if client exited with nonzero code

0 commit comments

Comments
 (0)