add mpc inspector example
This commit is contained in:
38
examples/mpc/inspector/README.md
Normal file
38
examples/mpc/inspector/README.md
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
# Inspector Example
|
||||||
|
|
||||||
|
This is a simple example of how to use the MCP module to create a server that handles JSON-RPC requests and responses.
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
```v
|
||||||
|
import freeflowuniverse.herolib.mcp
|
||||||
|
|
||||||
|
// Define custom handlers if needed
|
||||||
|
handlers := {
|
||||||
|
'custom_method': my_custom_handler
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create server configuration
|
||||||
|
config := mcp.ServerConfiguration{
|
||||||
|
// Configure server capabilities as needed
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create and start the server
|
||||||
|
mut server := mcp.new_server(handlers, config)!
|
||||||
|
server.start()!
|
||||||
|
```
|
||||||
|
|
||||||
|
## Running Example
|
||||||
|
|
||||||
|
1. `bash example.sh`
|
||||||
|
2. `open localhost:5173`
|
||||||
|
3. Configure inspector:
|
||||||
|
- Transport type: `STDIO`
|
||||||
|
- Command: `v`
|
||||||
|
- Arguments: `-w -n run /Users/timurgordon/code/github/freeflowuniverse/herolib/lib/mcp/v_do/vdo.v`
|
||||||
|
4. Connect
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
Expected output:
|
||||||
|

|
||||||
3
examples/mpc/inspector/example.sh
Normal file
3
examples/mpc/inspector/example.sh
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
npx @modelcontextprotocol/inspector node build/index.js
|
||||||
BIN
examples/mpc/inspector/inspector_screenshot.png
Normal file
BIN
examples/mpc/inspector/inspector_screenshot.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 382 KiB |
Reference in New Issue
Block a user