You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+15Lines changed: 15 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -556,6 +556,9 @@ mcp proxy tool add_operation "Adds a and b" "a:int,b:int" ./examples/add.sh
556
556
# Register an inline command as an MCP tool
557
557
mcp proxy tool add_operation "Adds a and b""a:int,b:int" -e 'echo "total is $a + $b = $(($a+$b))"'
558
558
559
+
# Register an inline command as an MCP tool with optional parameter
560
+
mcpt proxy tool add_operation "Adds a and b with optional result msg""a:int,b:int,[msg:string]" -e 'echo "$msg$a + $b = $(($a+$b))"'
561
+
559
562
# Unregister a tool
560
563
mcp proxy tool --unregister add_operation
561
564
@@ -581,6 +584,8 @@ This new format clearly shows what parameters each tool accepts, making it easie
581
584
2. Start the proxy server, which implements the MCP protocol
582
585
3. When a tool is called, parameters are passed as environment variables to the script/command
583
586
4. The script/command's output is returned as the tool response
587
+
5. If the script's output is a base64-encoded PNG image (prefixed with `data:image/png;base64,`), it is returned as an [ImageContent](https://modelcontextprotocol.io/specification/2025-06-18/server/prompts#image-content) object.
588
+
584
589
585
590
#### Example Scripts and Commands
586
591
@@ -599,6 +604,16 @@ result=$(($a + $b))
599
604
echo"The sum of $a and $b is $result"
600
605
```
601
606
607
+
**Generating a QR Code**
608
+
609
+
This example requires a tool like `qrencode` to be installed.
610
+
611
+
```bash
612
+
# Register a tool to generate a QR code
613
+
mcp proxy tool qrcode "Generates a QR code""text:string" \
0 commit comments