Skip to content

Commit 018993f

Browse files
committed
Add interactive MCP server testing tool and update README documentation
1 parent 71e38d0 commit 018993f

File tree

3 files changed

+754
-1
lines changed

3 files changed

+754
-1
lines changed

README.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,11 @@ mini-a goal="list all JavaScript files in this directory" useshell=true
108108
mini-a goal="what time is it in Sydney?" mcp="(cmd: 'ojob mcps/mcp-time.yaml', timeout: 5000)"
109109
```
110110

111+
**Testing MCP servers interactively:**
112+
```bash
113+
mini-a mcptest=true mcp="(cmd: 'ojob mcps/mcp-time.yaml')"
114+
```
115+
111116
**Aggregate MCP tools via proxy (single tool exposed):**
112117
```bash
113118
mini-a goal="compare release dates across APIs" \
@@ -132,6 +137,60 @@ mini-a goal="help me plan a vacation in Lisbon" chatbotmode=true
132137
3. Set your model configuration (see Quick Start above)
133138
4. Start using Mini-A via `opack exec mini-a` (or the `mini-a` alias if you added it)!
134139

140+
## Testing MCP Servers
141+
142+
Mini-A includes an interactive MCP server testing tool that helps you test and debug MCP servers before integrating them into your workflows.
143+
144+
### Using the MCP Tester
145+
146+
Launch the MCP tester console:
147+
```bash
148+
mini-a mcptest=true
149+
```
150+
151+
Or connect to an MCP server directly:
152+
```bash
153+
mini-a mcptest=true mcp="(cmd: 'ojob mcps/mcp-time.yaml')"
154+
```
155+
156+
For HTTP remote MCP servers:
157+
```bash
158+
mini-a mcptest=true mcp="(type: remote, url: 'http://localhost:9090/mcp')"
159+
```
160+
161+
### MCP Tester Features
162+
163+
The interactive tester provides:
164+
165+
- **Connection Management** - Connect to both STDIO (local command) and HTTP Remote MCP servers
166+
- **Tool Discovery** - List all available tools from the connected MCP server
167+
- **Tool Inspection** - View detailed information about tool parameters, types, and descriptions
168+
- **Interactive Tool Calling** - Call any MCP tool with custom parameters through guided prompts
169+
- **Configuration Options** - Adjust settings like debug mode, tool selection display size, and result parsing
170+
- **Library Loading** - Load additional OpenAF libraries for extended functionality using `libs=` parameter
171+
172+
### Available Options
173+
174+
- `mcp` - MCP server configuration (SLON/JSON string or object)
175+
- `libs` - Comma-separated list of libraries to load (e.g., `libs="@mini-a/custom.js,helper.js"`)
176+
- `debug` - Enable debug mode for detailed MCP connection logging (can be toggled in the interactive menu)
177+
178+
### Example Session
179+
180+
```bash
181+
# Launch the tester
182+
mini-a mcptest=true
183+
184+
# 1. Choose "New connection"
185+
# 2. Select "STDIO (local command)"
186+
# 3. Enter: ojob mcps/mcp-time.yaml
187+
# 4. Choose "List tools" to see available tools
188+
# 5. Choose "Call a tool" to test a specific tool
189+
# 6. Follow the prompts to enter parameters
190+
```
191+
192+
The tester includes automatic cleanup with shutdown handlers to properly close MCP connections when exiting.
193+
135194
## Features
136195

137196
- **Multi-Model Support** - Works with OpenAI, Google Gemini, GitHub Models, AWS Bedrock, Ollama, and more
@@ -184,6 +243,7 @@ Mini-A ships with complementary components:
184243

185244
- **`mini-a.yaml`** - Core oJob definition that implements the agent workflow
186245
- **`mini-a-con.js`** - Interactive console available through `opack exec mini-a` (or the `mini-a` alias)
246+
- **`mini-a-mcptest.js`** - Interactive MCP server tester for testing and debugging MCP servers
187247
- **`mini-a.sh`** - Shell wrapper script for running directly from a cloned repository
188248
- **`mini-a.js`** - Reusable library for embedding in other OpenAF jobs
189249
- **`mini-a-web.sh` / `mini-a-web.yaml`** - Lightweight HTTP server for browser UI

mini-a-con.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,10 @@ try {
158158
// Start model management mode
159159
load("mini-a-modelman.js")
160160
exit(0)
161+
} else if (toBoolean(args.mcptest) === true) {
162+
// Start MCP test mode
163+
load("mini-a-mcptest.js")
164+
exit(0)
161165
} else if (toBoolean(args.web) === true || toBoolean(args.onport) === true) {
162166
// Start web mode
163167
oJobRunFile(getOPackPath("mini-a") + "/mini-a-web.yaml", args, genUUID(), __, false)
@@ -351,6 +355,7 @@ try {
351355
onport: true,
352356
web: true,
353357
modelman: true,
358+
mcptest: true,
354359
resume: true,
355360
conversation: true,
356361
"--help": true,
@@ -397,6 +402,7 @@ try {
397402
{ option: "goal=<text>", description: "Execute a single goal in CLI mode and exit when done." },
398403
{ option: "onport=<port>", description: "Start the Mini-A web UI on the provided port (alias for web mode)." },
399404
{ option: "modelman=true", description: "Start the model manager instead of the console experience." },
405+
{ option: "mcptest=true", description: "Start the MCP test client instead of the console experience." },
400406
{ option: "resume=true", description: "Reuse the last conversation and continue from where you left." },
401407
{ option: "conversation=<fp>", description: "Path to a conversation JSON file to reuse/save." },
402408
{ option: "--help | -h", description: "Show this help text." }
@@ -421,7 +427,8 @@ try {
421427
const examples = [
422428
{ cmd: "mini-a mode=research goal=\"Summarize the project plan.\"", desc: "# Load research mode and run a goal." },
423429
{ cmd: "mini-a onport=9090", desc: "# Start web chat on port 9090." },
424-
{ cmd: "mini-a modelman=true", desc: "# Launch model manager UI." }
430+
{ cmd: "mini-a modelman=true", desc: "# Launch model manager UI." },
431+
{ cmd: "mini-a mcptest=true", desc: "# Launch MCP test client." }
425432
]
426433

427434
var maxCmdLength = examples.reduce(function(max, ex) {

0 commit comments

Comments
 (0)