@mcp1.ai/remote
v1.1.0
Published
A remote package for MCP1 project
Readme
@mcp1.ai/remote
A CLI tool for receiving JSON data and forwarding it to a remote endpoint.
Installation
npm install -g @mcp1.ai/remoteFeatures
- Accepts an endpoint parameter that specifies the remote server address to receive JSON data
- Listens to standard input (stdin) for incoming data
- Validates whether the received data is in valid JSON format
- If the data is valid JSON, it POSTs the data to the specified endpoint
- Outputs the JSON data returned from the remote server to standard output (stdout)
Usage
# Basic usage
mcp1-remote --endpoint https://your-api-endpoint.com/path
# Or using the short form
mcp1-remote -e https://your-api-endpoint.com/pathExamples
Start the service in a terminal window:
mcp1-remote -e https://your-api-endpoint.com/apiThen manually input JSON data:
{"message": "Hello Server", "data": 123}Or pipe JSON data:
echo '{"message": "Hello Server", "data": 123}' | mcp1-remote -e https://your-api-endpoint.com/apiProgrammatic Usage
You can also use it directly in a Node.js project:
const remote = require('@mcp1.ai/remote');
// Validate a JSON string
const isValid = remote.validateJson('{"name": "test"}');
console.log(isValid); // Returns the parsed object or false
// Start the JSON processor
remote.startJsonProcessor('https://your-api-endpoint.com/api');License
ISC
