Skip to content

Commit 161b8da

Browse files
committed
fix lint and rename
1 parent b9faec3 commit 161b8da

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/examples/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ curl -X POST -H "Content-Type: application/json" -H "Accept: application/json, t
3636
http://localhost:3000/mcp
3737
```
3838

39-
### Client (`client/simpleStreamableHttpClient.ts`)
39+
### Client (`client/simpleStreamableHttp.ts`)
4040

4141
A client that connects to the server, initializes it, and demonstrates how to:
4242

@@ -47,7 +47,7 @@ A client that connects to the server, initializes it, and demonstrates how to:
4747
#### Running the client
4848

4949
```bash
50-
npx tsx src/examples/client/simpleStreamableHttpClient.ts
50+
npx tsx src/examples/client/simpleStreamableHttp.ts
5151
```
5252

5353
Make sure the server is running before starting the client.

src/examples/server/simpleStreamableHttp.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,11 +135,11 @@ app.post('/mcp', async (req: Request, res: Response) => {
135135
});
136136

137137
// Helper function to detect initialize requests
138-
function isInitializeRequest(body: any): boolean {
138+
function isInitializeRequest(body: unknown): boolean {
139139
if (Array.isArray(body)) {
140-
return body.some(msg => msg.method === 'initialize');
140+
return body.some(msg => typeof msg === 'object' && msg !== null && 'method' in msg && msg.method === 'initialize');
141141
}
142-
return body.method === 'initialize';
142+
return typeof body === 'object' && body !== null && 'method' in body && body.method === 'initialize';
143143
}
144144

145145
// Start the server

0 commit comments

Comments
 (0)