Skip to content

Commit 2ca6743

Browse files
committed
mcp-client code demo
start of project to add mcp client support
1 parent 2879f38 commit 2ca6743

File tree

24 files changed

+22918
-0
lines changed

24 files changed

+22918
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 brucepro
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# A Demo of the MCP Client using React and SSE
2+
Still in progress but seems to work.
3+
4+
# Instructions
5+
6+
Load the SSE servers:
7+
cd servers/python/simple-tool-prompt-resource
8+
Load it with uv.
9+
```bash
10+
uv run mcp-simple-tool-prompt-resource --transport sse --port 8000
11+
```
12+
cd servers/python/simple-tool-prompt-resource2
13+
Load it with uv.
14+
```bash
15+
uv run mcp-simple-tool-prompt-resource2 --transport sse --port 8001
16+
```
17+
The script assumes these are running at localhost. But you can edit the config and change it to any SSE server.
18+
19+
Run the script.
20+
21+
npm start
22+
23+
24+
# Issues to consider:
25+
two tool names that match but are different servers, can prolly modify the tools_available to do mcpserver.name.toolname to the list tools.
26+
27+
Haven't tested multiple tools being called, prolly should set max tool calls.
28+
29+
Text completion streaming needs to be off to call tools.
30+
31+

0 commit comments

Comments
 (0)