mcp-multi-protocol-test
v0.1.0
Published
MCP server to test REST, GraphQL, gRPC, and WebSocket endpoints in batch.
Maintainers
Readme
mcp-multi-protocol-test
Node.js MCP server package for testing REST, GraphQL, gRPC (unary), and WebSocket endpoints in one batch.
Features
- Batch execution across mixed protocols
- Automatic protocol detection for each test case
- Per-test status code and normalized status
- Authentication support:
- Headers
- Bearer token
- Cookies
- gRPC metadata
- Equivalent command output:
- curl
- grpcurl
- wscat
- websocat
- Optional OpenAPI discovery tool from Swagger/OpenAPI URL
- Auto-shutdown after batch completion (default behavior)
Install
npm install mcp-multi-protocol-testUse As MCP Server
This package is a stdio MCP server. MCP clients should run it as a command.
Option 1: Use with npx (recommended)
npx -y mcp-multi-protocol-testUse this in your MCP client config:
{
"mcpServers": {
"multi-protocol-test": {
"command": "npx",
"args": ["-y", "mcp-multi-protocol-test"]
}
}
}Option 2: Use after global npm install
npm install -g mcp-multi-protocol-test
mcp-multi-protocol-testUse this in your MCP client config:
{
"mcpServers": {
"multi-protocol-test": {
"command": "mcp-multi-protocol-test",
"args": []
}
}
}Option 3: Use local source (development)
From this project folder:
npm install
npm run build
node dist/index.jsUse this in your MCP client config while developing locally:
{
"mcpServers": {
"multi-protocol-test-local": {
"command": "node",
"args": ["D:/code/node/multi-protocol-test/dist/index.js"]
}
}
}Test In MCP Inspector
Run Inspector:
npx @modelcontextprotocol/inspectorThen configure server command as one of:
npx -y mcp-multi-protocol-testmcp-multi-protocol-testnode dist/index.js
After connection, call tools:
run_batch_testsdiscover_openapi
Build
npm run buildRun MCP server (stdio)
npm run devor after build:
npm startMCP Tools
run_batch_tests
Runs one batch request containing one or more tests.
Example input:
{
"autoShutdown": true,
"concurrency": 2,
"defaults": {
"timeoutMs": 20000,
"headers": {
"x-env": "dev"
}
},
"tests": [
{
"id": "rest-1",
"url": "https://jsonplaceholder.typicode.com/posts/1",
"protocol": "auto",
"method": "GET"
},
{
"id": "graphql-1",
"url": "https://countries.trevorblades.com/",
"query": "query { country(code: \"IN\") { name capital } }"
},
{
"id": "grpc-1",
"url": "grpc://localhost:50051",
"protocol": "grpc",
"rpcMethod": "helloworld.Greeter/SayHello",
"protoFile": "./protos/helloworld.proto",
"body": {
"name": "world"
},
"grpcMetadata": {
"x-tenant": "acme"
}
},
{
"id": "ws-1",
"url": "wss://echo.websocket.events",
"protocol": "websocket",
"ws": {
"message": {
"hello": "world"
},
"expectContains": "hello",
"timeoutMs": 5000
}
}
]
}discover_openapi
Extracts endpoints from a Swagger/OpenAPI URL.
Example input:
{
"specUrl": "https://petstore3.swagger.io/api/v3/openapi.json"
}Output shape
Each test result includes:
- protocol
- detectedBy
- status
- statusCode
- statusMessage
- durationMs
- timestamp
- responseBody or errors
- command equivalents
NPM publish
- Update package version.
- Build and test.
- Dry run package.
- Publish.
npm run build
npm test
npm pack
npm publish --access publicNotes
- gRPC support is unary request/response in this version.
- Private/internal targets are allowed by default.
- Auto-shutdown is enabled by default after each batch run.
