-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Feature/740 multi server chatbot example #1348
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Feature/740 multi server chatbot example #1348
Conversation
|
commit: |
- Remove JSON config files with absolute local paths - Generate test configs dynamically using __dirname - Handle expected connection closed errors in cleanup test - All 13 tests passing locally and should pass in CI
…e using lightweight in-process McpServer
| import { createServer, type Server } from 'node:http'; | ||
|
|
||
| import { Client, StreamableHTTPClientTransport } from '@modelcontextprotocol/client'; | ||
| import type { EventStore, JSONRPCMessage } from '@modelcontextprotocol/server'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
result of lint:fix
Add TypeScript multi-server chatbot example
Implements a TypeScript chatbot example that connects to multiple MCP servers with LLM integration, following the pattern from the Python SDK's simple-chatbot.
Motivation and Context
Closes #740
The TypeScript SDK needed an example showing how to build a chatbot that connects to multiple MCP servers and integrates with an LLM. This example demonstrates:
StdioClientTransportHow Has This Been Tested?
Automated tests:
simpleChatbot.test.ts(14 tests)Manual testing:
Tested with
@modelcontextprotocol/server-everythingand@modelcontextprotocol/server-memoryusing Groq'sllama-3.3-70b-versatile.Breaking Changes
None - this is a new example.
Types of changes
Checklist
Additional context
This PR represents my first contribution while learning to work with MCP connections. @felixweinberger Thanks for providing the list with good first issues! Really educational for me to work with this. Will continue improving the example here. Happy to further contribute.