Skip to main content

Test an MCP server

Hitspec can test local stdio servers and remote Streamable HTTP endpoints from the same CLI. probe completes protocol negotiation, follows every tools/list page, resolves each advertised input/output JSON Schema, and returns a failed test when a required tool is missing.
Put the server executable and each argument after --. Hitspec executes the argv directly and does not invoke a shell.
The client uses the official Go SDK, whose current release supports stable MCP 2025-11-25, and reports the protocol version actually negotiated with the server in both human and JSON output.

Call a tool

call first verifies that the server advertises the exact, case-sensitive tool name, then sends one explicit tools/call request:
Arguments must be a JSON object and are limited to 1 MiB when read from a file. Before execution, Hitspec validates them against the advertised inputSchema; successful structured output is validated against outputSchema when present. Hitspec prints tool content before exiting. A protocol or transport error exits with code 4; a contract mismatch, an advertised tool that returns isError: true, an unknown tool, or a missing --require-tool exits with code 1. This preserves MCP’s distinction between a failed tool execution and a failed protocol request.
mcp call executes the selected tool and may cause external changes. Review the tool and arguments before running it. Tool annotations, descriptions, and output are server-provided data, not trusted authorization metadata.

Client flags

HTTP redirects are rejected so credentials cannot cross endpoint boundaries. URLs containing credentials are also rejected; send authorization explicitly with --header. For repeatable automation, inject sensitive values through the calling environment or secret manager and avoid committing them to scripts.

Run Hitspec as an MCP server

Run Hitspec as a workspace-scoped Model Context Protocol server:
stdout is reserved exclusively for MCP JSON-RPC. The server does not start run history or a file watcher or execute shell hooks or database assertions. In v2.18.0, web search and durable capture are registered only when their operator-owned provider and artifact sink, respectively, are configured at startup. MCP initialization instructions are built from that registered surface, so clients are not prompted to use unconfigured search or capture tools. They also state whether hitspec_fetch is public-only or has operator-enabled non-public HTTP(S) authority, including private, loopback, link-local, and reserved targets; this does not broaden the public-only capture policy.

Tools

Hitspec is the only model-visible web surface. Tavily is the initial internal search provider and can be replaced without changing these tool names or schemas.

hitspec_fetch input

A file containing multiple requests requires name or index. A saved request that declares @depends is rejected. Assertions, captures, conditions, hooks, shell blocks, database assertions, and @waitFor are not executed. hitspec_fetch never persists the response; use hitspec_capture_webpage for a durable artifact.

Live web search and capture

hitspec_search_web has this provider-neutral tool input: The tool does not accept a provider, endpoint, API key, authorization header, arbitrary headers, generated-answer switch, or raw-content switch. Tavily is an internal adapter selected by the server operator, not a separate model-visible tool. The JSON document is capped at 64 KiB. It contains kind: "discovery", normalized query, results, and truncated. Each result contains only title, url, domain, snippet, optional published_at, and a response-local citation_id. truncated is true whenever candidates are omitted by the result limit or response cap; for the latter, Hitspec removes trailing results. Provider-specific request IDs and scores, generated answers, raw page content, and credentials are never exposed. Search snippets are discovery candidates, not verified or durable evidence. hitspec_capture_webpage has this compatibility-preserving input: The tool performs one public-network GET, renders static HTML as Markdown, and saves it through the fixed file.cheap adapter. It returns a compact receipt, not the page body or rendered Markdown:
The stash object includes file_count and total_size and may also include expires_at. Inspect status, indexed, and failed when present before deciding whether follow-up is needed.

Request discovery and validation input

  • hitspec_list_requests accepts an optional path: a workspace-relative directory or .http/.hitspec file. It defaults to the workspace root and searches directories recursively. If any discovered Hitspec file is invalid, the tool returns an error instead of an incomplete list.
  • hitspec_validate requires file, a workspace-relative .http or .hitspec file. Its result reports the file, validity, request count, and parse or structural errors.
Saved file, dotenv, config, and discovery paths are workspace-relative and are checked after symlink resolution.

Tool result content

Every successful tool call includes an MCP TextContent representation so clients that do not pass through structured output can still consume it:
  • hitspec_fetch with raw returns a JSON text envelope containing sanitized source, status, content type, byte size, encoding: "base64", and data.
  • text and markdown return their rendered documents as text content. json returns the machine-safe response envelope serialized as text content.
  • Discovery and validation return their JSON documents serialized as text content.
  • Search returns the bounded discovery JSON as text content. Webpage capture also publishes its typed compact receipt as structured content when the client supports it.

Server flags

Tavily authentication comes only from the server process’s TAVILY_API_KEY. The key is never accepted as a tool argument or returned in output. The file.cheap child receives an allowlisted environment that excludes this key.

Limits and network policy

  • The default body limit is 1 MiB (--max-body-bytes). Crossing it is an error, never a truncated success.
  • The default request timeout is 30 seconds (--timeout).
  • Direct URLs and saved requests allow only public HTTP(S) destinations by default. The initial host, redirects, DNS answers, and dial target are checked.
  • URL credentials are rejected and response provenance omits URL query strings.
  • A saved request that uses digest, AWS, or OAuth2 authentication, multipart data, or a configured proxy is rejected under the public-only policy. The proxy is not silently ignored.
  • Redirect chains are limited to 10; callers can set no_follow to disable redirects entirely.
To test a local API, the person starting the server must grant that authority:
This operator grant also switches saved requests to the standard Hitspec HTTP client, enabling configured proxies and digest, AWS, OAuth2, and multipart request modes. Grant it only to agents and workspaces that need that authority. hitspec_fetch and durable webpage capture are intentionally not marked read-only because HTTP requests and artifact writes can have external effects. The discovery-only hitspec_search_web tool is marked read-only and open-world.

Approval boundaries

AUTO never enables private-network access or relaxes URL, redirect, DNS, body, or workspace checks.

Direct MCP client configuration

Inject TAVILY_API_KEY into the server process through the MCP host or tvault; do not write its value into this configuration. See Agent artifact workflow for MCPHub, Local Agent, and file.cheap composition.
Last modified on July 19, 2026