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.
- stdio
- Streamable HTTP
Put the server executable and each argument after
--. Hitspec executes
the argv directly and does not invoke a shell.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:
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.
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: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:
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_requestsaccepts an optionalpath: a workspace-relative directory or.http/.hitspecfile. 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_validaterequiresfile, a workspace-relative.httpor.hitspecfile. Its result reports the file, validity, request count, and parse or structural errors.
Tool result content
Every successful tool call includes an MCPTextContent representation so
clients that do not pass through structured output can still consume it:
hitspec_fetchwithrawreturns a JSON text envelope containing sanitized source, status, content type, byte size,encoding: "base64", anddata.textandmarkdownreturn their rendered documents as text content.jsonreturns 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_followto disable redirects entirely.
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
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.