π§ͺ MCP Server Testing Framework - Multi-platform Docker image for testing Model Context Protocol s
3.3K
π·πΊ Π ΡΡΡΠΊΠ°Ρ Π²Π΅ΡΡΠΈΡβ
A high-performance tool for testing MCP servers with SSE-HTTP-STDIO protocol support, Bearer token authorization, and test scenario writing through configuration files without programming.
Created by @ii_pomogatorβ - AI Assistant Channel on Telegram
npm install -g mcp-server-tester-sse-http-stdio
pip install mcp-server-tester
docker pull stgmt/mcp-server-tester
npx mcp-server-tester-sse-http-stdio test --test test.yaml --server-config config.json
mcp-server-tester test --test test.yaml --server-config config.json
docker run -v $(pwd):/workspace stgmt/mcp-server-tester test --test /workspace/test.yaml
name: "MCP Server Basic Test"
description: "Testing basic MCP server functionality"
timeout: 30000
tests:
- name: "Initialize connection"
type: "initialize"
params:
protocolVersion: "1.0.0"
capabilities:
tools: true
expect:
status: "success"
capabilities:
tools: true
- name: "List available tools"
type: "tools/list"
expect:
status: "success"
tools:
- name: "echo"
description: "Echo tool"
- name: "Call echo tool"
type: "tools/call"
params:
name: "echo"
arguments:
message: "Hello, MCP!"
expect:
status: "success"
result:
message: "Hello, MCP!"
{
"mcpServers": {
"test-server": {
"command": "node",
"args": ["server.js"],
"env": {
"BEARER_TOKEN": "your-secret-token"
},
"transport": {
"type": "sse",
"config": {
"url": "http://localhost:3000/sse",
"headers": {
"Authorization": "Bearer your-secret-token"
}
}
}
}
}
}
mcp-server-tester test --test <test-file> --server-config <config-file> [options]
Options:
--server-name <name> Server name from configuration
--verbose Verbose output
--json-output Output results in JSON format
--timeout <ms> Test timeout (default: 30000)
mcp-server-tester validate --test <test-file>
mcp-server-tester tools --server-config <config-file> --server-name <name>
docker run -v $(pwd):/workspace stgmt/mcp-server-tester \
test --test /workspace/test.yaml --server-config /workspace/config.json
version: '3.8'
services:
mcp-tester:
image: stgmt/mcp-server-tester
volumes:
- ./tests:/workspace/tests
- ./config:/workspace/config
command: test --test /workspace/tests/test.yaml --server-config /workspace/config/server.json
| Platform | Architecture | Status |
|---|---|---|
| Linux | amd64 | β |
| Linux | arm64 | β |
| macOS | amd64 | β |
| macOS | arm64 | β |
| Windows | amd64 | β |
name: MCP Server Tests
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run MCP Server Tests
run: |
docker run -v ${{ github.workspace }}:/workspace \
stgmt/mcp-server-tester test \
--test /workspace/tests/test.yaml \
--server-config /workspace/config.json
mcp-tests:
image: stgmt/mcp-server-tester
script:
- mcp-server-tester test --test tests/test.yaml --server-config config.json
expect:
status: "success"
result:
type: "object"
properties:
message:
type: "string"
pattern: "^Hello.*"
count:
type: "number"
minimum: 0
expect:
tools:
type: "array"
minItems: 1
items:
type: "object"
required: ["name", "description"]
expect:
oneOf:
- status: "success"
result: { processed: true }
- status: "pending"
result: { queued: true }
tests:
- name: "Test with env variables"
env:
API_KEY: "${TEST_API_KEY}"
BASE_URL: "${TEST_BASE_URL:-http://localhost:3000}"
tests:
- name: "Create resource"
id: "create"
type: "tools/call"
params:
name: "create_resource"
capture:
resource_id: "$.result.id"
- name: "Get created resource"
depends_on: ["create"]
type: "tools/call"
params:
name: "get_resource"
arguments:
id: "${resource_id}"
parallel_groups:
- name: "Performance tests"
tests:
- name: "Test 1"
- name: "Test 2"
- name: "Test 3"
We welcome contributions to the project! See CONTRIBUTING.mdβ for details.
MIT License - see LICENSEβ file.
Developed with β€οΈ by @ii_pomogatorβ
Content type
Image
Digest
sha256:bbe3cd926β¦
Size
193.8 MB
Last updated
10 months ago
docker pull stgmt/mcp-server-tester-sse-http-stdio