MCP Tester

Test any MCP server - discover tools and call them interactively.

What this does

  1. Enter any MCP server URL
  2. Discover available tools via the MCP protocol
  3. Call tools with custom arguments
  4. See raw JSON-RPC responses

Usage

Interactive UI

Visit the main.ts endpoint and enter an MCP server URL to test.

Programmatic API

# Get the endpoint URL from main.ts, then: # Discover tools curl -X POST "YOUR_ENDPOINT/?url=https://dicemcp.val.run" \ -H "Content-Type: application/json" \ -d '{"method": "discover"}' # Call a tool curl -X POST "YOUR_ENDPOINT/?url=https://dicemcp.val.run" \ -H "Content-Type: application/json" \ -d '{"method": "call", "tool": "roll_dice", "args": {"count": 3}}' # Quick connectivity test curl "YOUR_ENDPOINT/api/test?url=https://dicemcp.val.run"

From Another Val

// Get endpoint URL from main.ts file details const TESTER = "https://your-endpoint.web.val.run"; const MCP_URL = "https://your-mcp.val.run"; // Discover tools const discovery = await fetch(`${TESTER}/?url=${encodeURIComponent(MCP_URL)}`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ method: "discover" }), }).then(r => r.json()); console.log(discovery.tools); // Call a tool const result = await fetch(`${TESTER}/?url=${encodeURIComponent(MCP_URL)}`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ method: "call", tool: "your_tool_name", args: { foo: "bar" } }), }).then(r => r.json()); console.log(result);

Run the Test Script

The test.ts file demonstrates testing the dice MCP server. Run it from the Val Town UI to verify everything works.

API Reference

EndpointMethodDescription
/?url=<mcp-url>POSTRun MCP operations (see body params below)
/api/test?url=<mcp-url>GETQuick discovery test
/GETInteractive UI

POST Body Parameters

FieldDescription
method"discover" or "call" (or raw MCP method like "tools/list")
toolTool name (required for "call")
argsTool arguments object (optional for "call")
paramsRaw params for passthrough MCP methods

See Also