Test any MCP server - discover tools and call them interactively.
Visit the main.ts endpoint and enter an MCP server URL to test.
# 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"
// 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);
The test.ts file demonstrates testing the dice MCP server. Run it from the Val Town UI to verify everything works.
| Endpoint | Method | Description |
|---|---|---|
/?url=<mcp-url> | POST | Run MCP operations (see body params below) |
/api/test?url=<mcp-url> | GET | Quick discovery test |
/ | GET | Interactive UI |
| Field | Description |
|---|---|
method | "discover" or "call" (or raw MCP method like "tools/list") |
tool | Tool name (required for "call") |
args | Tool arguments object (optional for "call") |
params | Raw params for passthrough MCP methods |