Update README.md to include working examples
The current documentation contains code that will cause errors, they should be fixed.
This commit is contained in:
parent
4d6197ac07
commit
ad51fd0f5b
1 changed files with 1 additions and 2 deletions
|
|
@ -242,7 +242,6 @@ app.post('/mcp', async (req, res) => {
|
|||
transport = transports[sessionId];
|
||||
} else if (!sessionId && isInitializeRequest(req.body)) {
|
||||
// New initialization request
|
||||
const eventStore = new InMemoryEventStore();
|
||||
transport = new StreamableHTTPServerTransport({
|
||||
sessionIdGenerator: () => randomUUID(),
|
||||
onsessioninitialized: (sessionId) => {
|
||||
|
|
@ -815,7 +814,7 @@ app.post('/messages', async (req, res) => {
|
|||
const sessionId = req.query.sessionId as string;
|
||||
const transport = transports.sse[sessionId];
|
||||
if (transport) {
|
||||
await transport.handlePostMessage(req, res);
|
||||
await transport.handlePostMessage(req, res, req.body);
|
||||
} else {
|
||||
res.status(400).send('No transport found for sessionId');
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue