A Model Context Protocol (MCP) server that exposes Solace Try-Me CLI (STM) functionality to Large Language Models through CLI command wrapping.
This proof of concept demonstrates how to integrate STM's event feed management capabilities with LLMs via the MCP protocol. The current implementation uses CLI command wrapping for rapid development, with a clear path to direct function integration in future iterations.
- Node.js 18+
- Solace Try-Me CLI (STM) v0.0.83 or later installed and available in PATH
- MCP Inspector for testing:
yarn global add @modelcontextprotocol/inspector
# Clone the repository with submodules
git clone --recurse-submodules https://github.com/your-org/solace-tryme-agent.git
cd solace-tryme-agent
# Or if already cloned, initialize submodules
git submodule update --init --recursive
# Install dependencies
yarn install
# Verify STM is available
stm --versionNote: This project includes the STM CLI source code as a git submodule (at solace-tryme-cli/) for reference purposes. The submodule is pinned to v0.0.83.
Get help information about STM CLI commands.
Parameters:
command(optional): Specific STM command to get help for
List available event feeds (local and community).
Parameters:
source(optional):"local","community", or"both"(default:"local")
Generate a new feed from an AsyncAPI document.
Parameters:
source(required): File path or URL to AsyncAPI documentfeed_name(optional): Name for the generated feed
Note: Currently shows limitation message due to interactive CLI prompts in POC approach.
Run an event feed to publish messages to Solace broker.
Parameters:
feed_name(required): Name of the feed to runcount(optional): Number of events to publish (default: 1, 0 for continuous)interval(optional): Time between publishes in milliseconds (default: 1000)event_names(optional): Array of specific event names to publish
Note: Currently shows limitation message due to broker connection requirements and interactive prompts.
Send/publish messages to Solace broker topics or queues.
Parameters:
topic(string): Topic to publish to (mutually exclusive with queue)queue(string): Queue to publish to (mutually exclusive with topic)message(string): Message payload as stringmessage_file(string): Path to file containing message payloadcount(number): Number of messages to send (default: 1, 0 for continuous)interval(number): Interval between messages in milliseconds (default: 1000)url(string): Broker URL (e.g., ws://localhost:8008)vpn(string): Message VPN nameusername(string): Client usernamepassword(string): Client passworddelivery_mode(string): DIRECT, PERSISTENT, or NON_PERSISTENTtime_to_live(number): Message TTL in millisecondsoutput_mode(string): DEFAULT, COMPACT, or FULL (default: DEFAULT)lint(boolean): Validate parameters without executing (default: true)
Receive/consume messages from Solace broker topics or queues.
Parameters:
topic(string): Topic to subscribe to (mutually exclusive with queue)queue(string): Queue to consume from (mutually exclusive with topic)count(number): Number of messages to receive (default: 1, 0 for continuous)timeout(number): Receive timeout in milliseconds (default: 60000)url(string): Broker URLvpn(string): Message VPN nameusername(string): Client usernamepassword(string): Client passwordoutput_mode(string): DEFAULT, COMPACT, or FULL (default: DEFAULT)lint(boolean): Validate parameters without executing (default: true)
Send request messages and wait for replies (request-reply pattern).
Parameters:
topic(string, required): Topic to send request tomessage(string): Request message payloadmessage_file(string): Path to file containing request payloadcount(number): Number of requests to send (default: 1)timeout(number): Request timeout in milliseconds (default: 5000)url(string): Broker URLvpn(string): Message VPN nameusername(string): Client usernamepassword(string): Client passwordoutput_mode(string): DEFAULT, COMPACT, or FULL (default: DEFAULT)lint(boolean): Validate parameters without executing (default: true)
Listen for requests and send replies (request-reply pattern responder).
Parameters:
topic(string, required): Topic to listen for requests onmessage(string): Reply message payloadmessage_file(string): Path to file containing reply payloadcount(number): Number of requests to reply to (default: 1, 0 for continuous)timeout(number): Wait timeout in milliseconds (default: 60000)url(string): Broker URLvpn(string): Message VPN nameusername(string): Client usernamepassword(string): Client passwordoutput_mode(string): DEFAULT, COMPACT, or FULL (default: DEFAULT)lint(boolean): Validate parameters without executing (default: true)
Note: All messaging tools default to lint: true for safe parameter validation. Set to false to actually execute commands (requires broker connectivity).
The MCP Inspector provides an interactive web interface to test our MCP server tools. Here's how to test each feature:
- Start the MCP Server:
# In the project directory
yarn startThe server will start and display: "Solace TryMe CLI MCP Server running on stdio"
- Start MCP Inspector in a new terminal:
npx @modelcontextprotocol/inspector node src/index.js- Open the Inspector: The inspector will open in your browser (typically http://localhost:3000)
Purpose: Verify basic STM CLI integration works
-
In the MCP Inspector, select the
stm_helptool -
Test basic help:
- Leave parameters empty
- Click "Call Tool"
- Expected Result: STM CLI help output with ASCII art banner and command list
-
Test specific command help:
- Set
commandto"feed" - Click "Call Tool"
- Expected Result: Detailed help for the
stm feedcommand
- Set
Purpose: Test feed discovery and output formatting
-
Select the
stm_feed_listtool -
Test local feeds:
- Set
sourceto"local" - Click "Call Tool"
- Expected Result:
Found X local feed(s): 1. **FeedName1** (asyncapi_feed) 2. **FeedName2** (asyncapi_feed) - Set
-
Test default behavior:
- Leave
sourceempty (defaults to local) - Click "Call Tool"
- Expected Result: Same as local feeds test
- Leave
-
Test both feeds:
- Set
sourceto"both" - Click "Call Tool"
- Expected Result: Local feeds + note about community feeds being skipped
- Set
-
Test community feeds (optional):
- Set
sourceto"community" - Click "Call Tool"
- Expected Result: Either community feeds list or timeout/error (network dependent)
- Set
Purpose: Test parameter validation and limitation documentation
-
Select the
stm_feed_generatetool -
Test missing parameters:
- Leave all parameters empty
- Click "Call Tool"
- Expected Result: Error message about required
sourceparameter
-
Test with file path:
- Set
sourceto"test/sample-asyncapi.yaml" - Leave
feed_nameempty - Click "Call Tool"
- Expected Result: POC limitation message with explanation
- Set
-
Test with feed name:
- Set
sourceto"test/sample-asyncapi.yaml" - Set
feed_nameto"MyTestFeed" - Click "Call Tool"
- Expected Result: POC limitation message including the feed name
- Set
-
Test with non-existent file:
- Set
sourceto"/nonexistent/file.yaml" - Click "Call Tool"
- Expected Result: POC limitation message (file validation happens in STM CLI)
- Set
Purpose: Test feed execution and broker communication capabilities
-
Select the
stm_feed_runtool -
Test missing feed name:
- Leave all parameters empty
- Click "Call Tool"
- Expected Result: Error message about required
feed_nameparameter
-
Test with existing feed:
- Set
feed_nameto"DynamicPricingEngine-0"(or another feed from your list) - Set
countto1 - Click "Call Tool"
- Expected Result: POC limitation message about broker connection requirements
- Set
-
Test with custom parameters:
- Set
feed_nameto"DynamicPricingEngine-0" - Set
countto3 - Set
intervalto500 - Click "Call Tool"
- Expected Result: POC limitation message with custom parameters shown
- Set
-
Test with non-existent feed:
- Set
feed_nameto"NonExistentFeed" - Click "Call Tool"
- Expected Result: Clear error message that feed was not found
- Set
Purpose: Test the complete workflow integration
- Run the comprehensive test:
node test/end-to-end-test.js- Expected workflow:
- Lists existing feeds β
- Attempts feed generation π§ (shows limitation)
- Verifies feed list unchanged β
- Attempts feed execution π§ (shows limitation)
- Provides comprehensive analysis β
| Test Case | Status | Expected Behavior |
|---|---|---|
stm_help (no params) |
β Working | STM help output with banner |
stm_help (specific command) |
β Working | Command-specific help |
stm_feed_list (local) |
β Working | Formatted list of local feeds |
stm_feed_list (both) |
β Working | Local feeds + community note |
stm_feed_list (community) |
May timeout or succeed | |
stm_feed_generate (missing params) |
β Working | Clear error message |
stm_feed_generate (valid params) |
π§ POC Limitation | Informative limitation message |
stm_feed_run (missing params) |
β Working | Clear error message |
stm_feed_run (valid params) |
π§ POC Limitation | Broker connection limitation message |
stm_feed_run (invalid feed) |
β Working | Feed not found error |
| End-to-end workflow | β POC Complete | Demonstrates integration + limitations |
- Verify STM is installed:
stm --version - Check PATH includes STM installation directory
- On macOS with Homebrew:
brew install stm
- Ensure the MCP server is running (
yarn start) - Check that no other process is using the stdio transport
- Try restarting both server and inspector
- Some STM commands (especially community feeds) may be slow
- Default timeout is 30 seconds
- Network-dependent operations may fail in offline environments
- STM CLI commands with interactive prompts are not supported in POC
- These are documented as limitations in the tool responses
- Will be resolved in Phase 2 (direct integration)
# Run all tests
yarn test
# Run specific test suites
node test/feed-list-test.js
node test/feed-generate-test.js
node test/mcp-test.js# Test STM CLI wrapper directly
node -e "
const { executeSTMCommand } = require('./src/stm-cli.js');
executeSTMCommand('--help').then(console.log);
"
# Test server instantiation
node -e "
const { STMServer } = require('./src/index.js');
const server = new STMServer();
console.log('Server created successfully');
"- Basic MCP Server: Properly configured with stdio transport
- STM CLI Integration: Robust command execution with error handling
- Feed Listing: Local feeds discovery with formatted output
- Parameter Validation: Proper input validation and error messages
- Documentation: Clear limitation messaging for unsupported features
- Interactive Commands: STM commands with prompts not supported via CLI wrapping
- Community Feeds: Network-dependent, may be slow or fail
- Real-time Feedback: No progress updates for long-running operations
- Advanced Error Handling: Basic CLI error parsing only
- Add
stm_feed_runtool - Execute feeds (if non-interactive) - Implement MCP Resources - Expose feed metadata as resources
- Enhanced Error Handling - Better CLI output parsing
- Phase 2 Planning - Direct STM function integration design
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β LLM Client β β MCP Server β β STM CLI β
β (Claude) βββββΊβ (Node.js) βββββΊβ (Installed) β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β β β
β MCP Protocol β Child Process β Solace Broker
β (JSON-RPC) β Execution β Connection
β β β
βββββββββββ βββββββββββ βββββββββββ
β Natural β β CLI β β Event β
βLanguage β βWrapper β β Feeds β
β Queries β β Layer β β & Data β
βββββββββββ βββββββββββ βββββββββββ
This POC demonstrates the feasibility of MCP integration with STM while identifying the clear benefits of direct function integration for future development.
This is not an officially supported Solace product.
For more information try these resources:
- Ask the Solace Community
- The Solace Developer Portal website at: https://solace.dev
Contributions are encouraged! Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
See the list of contributors who participated in this project.
See the LICENSE file for details.