doc: Add example of testing against TS SDK (#237)
This commit is contained in:
parent
7ee58ef780
commit
22b4dce608
1 changed files with 28 additions and 3 deletions
|
|
@ -28,19 +28,44 @@ This repo uses **npm** — don't commit `pnpm-lock.yaml` or `yarn.lock`.
|
||||||
|
|
||||||
## Running your scenario
|
## Running your scenario
|
||||||
|
|
||||||
|
Run a client scenario against the bundled example client:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
# Against the bundled TypeScript example
|
|
||||||
npm run build
|
npm run build
|
||||||
node dist/index.js client --command "tsx examples/clients/typescript/everything-client.ts" --scenario <your-scenario>
|
node dist/index.js client --command "tsx examples/clients/typescript/everything-client.ts" --scenario <your-scenario>
|
||||||
|
```
|
||||||
|
|
||||||
|
Run a server scenario against any server running locally (replace 3000 with your server's port, if necessary):
|
||||||
|
|
||||||
|
```sh
|
||||||
# Against a server
|
# Against a server
|
||||||
node dist/index.js server --url http://localhost:3000/mcp --scenario <your-scenario>
|
node dist/index.js server --url http://localhost:3000/mcp --scenario <your-scenario>
|
||||||
```
|
```
|
||||||
|
|
||||||
See the [README](./README.md) for full CLI options and the [SDK Integration Guide](./SDK_INTEGRATION.md) for testing against a real SDK.
|
Run a server scenario against the latest TypeScript SDK:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
# In another directory, clone and prepare the SDK once
|
||||||
|
cd ..
|
||||||
|
git clone https://github.com/modelcontextprotocol/typescript-sdk.git
|
||||||
|
cd typescript-sdk
|
||||||
|
pnpm install
|
||||||
|
pnpm run build:all
|
||||||
|
|
||||||
|
# Start the SDK's conformance server in one terminal
|
||||||
|
cd test/conformance
|
||||||
|
PORT=3100 pnpm run test:conformance:server:run
|
||||||
|
|
||||||
|
# Back in this repo, run your local conformance build against it
|
||||||
|
cd /path/to/conformance
|
||||||
|
npm run build
|
||||||
|
node dist/index.js server --url http://localhost:3100/mcp --scenario <your-scenario>
|
||||||
|
```
|
||||||
|
|
||||||
|
See the [README](./README.md) for full CLI options and the [SDK Integration Guide](./SDK_INTEGRATION.md) for more on testing against a real SDK.
|
||||||
|
|
||||||
## Pull requests
|
## Pull requests
|
||||||
|
|
||||||
- Register your scenario in the right suite in `src/scenarios/index.ts`
|
- Register your scenario in the right suite in `src/scenarios/index.ts`
|
||||||
- Run against at least one real SDK before opening the PR — we'll ask what the output looked like
|
- Run against at least one real SDK (see above) before opening the PR — we'll ask what the output looked like
|
||||||
- Keep PRs focused; one feature or scenario group at a time
|
- Keep PRs focused; one feature or scenario group at a time
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue