This React-based demo showcases an MCP client interacting with SSE servers, enabling tool calls and text completion, though it's still under development and has limitations regarding tool naming and concurrent calls.
This project demonstrates a Model Context Protocol (MCP) client built with React, utilizing Server-Sent Events (SSE) for real-time communication. It's a work in progress, but functional.
To get started, launch the SSE servers. You can use Supergateway:
npx -y supergateway --cors --port 8002 --stdio "npx -y @modelcontextprotocol/server-everything"Alternatively, use uv to run two Python-based MCP servers:
uv run mcp-simple-tool-prompt-resource --transport sse --port 8000uv run mcp-simple-tool-prompt-resource2 --transport sse --port 8001The client defaults to localhost for these servers, but this can be configured. Finally, start the React application:
npm startThe project currently faces an issue with duplicate tool names across different servers. A potential solution is to modify the tools_available list to include the server name (e.g., mcpserver.name.toolname). The handling of multiple concurrent tool calls is untested and may require setting a maximum limit. Note that text completion streaming must be disabled for tool calls to function correctly.
brucepro/llamacppMCPClientDemo
February 7, 2025
March 19, 2025
TypeScript