Skip to content

Commit 32d0fe7

Browse files
committed
Refactored MCP test server (servers, fixtures,etc) out of core and into top level test package - in preparation for composable test server work.
1 parent d9f2c61 commit 32d0fe7

41 files changed

Lines changed: 417 additions & 295 deletions

Some content is hidden

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

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ web/tsconfig.jest.tsbuildinfo
99
core/build
1010
cli/build
1111
tui/build
12+
test/build
1213
test-output
1314
tool-test-output
1415
metadata-test-output
@@ -18,7 +19,7 @@ web/playwright-report/
1819
web/results.json
1920
web/test-results/
2021
web/e2e/test-results/
21-
# Only ignore mcp.json at repo root (test configs in test/ are committed)
22+
# Only ignore mcp.json at repo root (configs in configs/ are committed)
2223
/mcp.json
2324
.claude/settings.local.json
2425

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ core/build
33
web/dist
44
cli/build
55
tui/build
6+
test/build
67
CODE_OF_CONDUCT.md
78
SECURITY.md
89
mcp.json

AGENTS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,4 @@ The project is organized as a monorepo with workspaces:
3333
- `core/`: Core shared code used by web, CLI, and TUI
3434
- `cli/`: Command-line interface for testing and invoking MCP server methods directly
3535
- `tui/`: Terminal user interface
36+
- `test/`: Composable MCP test servers, fixtures, and harness

cli/__tests__/cli.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ import {
1212
createInvalidConfig,
1313
deleteConfigFile,
1414
} from "./helpers/fixtures.js";
15-
import { getTestMcpServerCommand } from "../../core/test/test-server-stdio.js";
16-
import { createTestServerHttp } from "../../core/test/test-server-http.js";
1715
import {
16+
getTestMcpServerCommand,
17+
createTestServerHttp,
1818
createEchoTool,
1919
createTestServerInfo,
20-
} from "../../core/test/test-server-fixtures.js";
20+
} from "@modelcontextprotocol/inspector-test-server";
2121

2222
describe("CLI Tests", () => {
2323
describe("Basic CLI Mode", () => {

cli/__tests__/headers.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ import {
55
expectOutputContains,
66
expectCliSuccess,
77
} from "./helpers/assertions.js";
8-
import { createTestServerHttp } from "../../core/test/test-server-http.js";
98
import {
9+
createTestServerHttp,
1010
createEchoTool,
1111
createTestServerInfo,
12-
} from "../../core/test/test-server-fixtures.js";
12+
} from "@modelcontextprotocol/inspector-test-server";
1313

1414
describe("Header Parsing and Validation", () => {
1515
describe("Valid Headers", () => {

cli/__tests__/helpers/fixtures.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as fs from "fs";
22
import * as path from "path";
33
import * as os from "os";
44
import * as crypto from "crypto";
5-
import { getTestMcpServerCommand } from "../../../core/test/test-server-stdio.js";
5+
import { getTestMcpServerCommand } from "@modelcontextprotocol/inspector-test-server";
66

77
/**
88
* Sentinel value for tests that don't need a real server

cli/__tests__/metadata.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ import {
55
expectCliFailure,
66
expectValidJson,
77
} from "./helpers/assertions.js";
8-
import { createTestServerHttp } from "../../core/test/test-server-http.js";
98
import {
9+
createTestServerHttp,
1010
createEchoTool,
1111
createAddTool,
1212
createTestServerInfo,
13-
} from "../../core/test/test-server-fixtures.js";
13+
} from "@modelcontextprotocol/inspector-test-server";
1414
import { NO_SERVER_SENTINEL } from "./helpers/fixtures.js";
1515

1616
describe("Metadata Tests", () => {

cli/__tests__/tools.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
expectValidJson,
77
expectJsonError,
88
} from "./helpers/assertions.js";
9-
import { getTestMcpServerCommand } from "../../core/test/test-server-stdio.js";
9+
import { getTestMcpServerCommand } from "@modelcontextprotocol/inspector-test-server";
1010

1111
describe("Tool Tests", () => {
1212
describe("Tool Discovery", () => {

cli/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
"devDependencies": {
2828
"@types/express": "^5.0.0",
2929
"tsx": "^4.7.0",
30-
"vitest": "^4.0.17"
30+
"vitest": "^4.0.17",
31+
"@modelcontextprotocol/inspector-test-server": "*"
3132
},
3233
"dependencies": {
3334
"@modelcontextprotocol/inspector-core": "*",
File renamed without changes.

0 commit comments

Comments
 (0)