Skip to content

Any stdio client

The server uses the stdio transport only (the SSE transport was removed in v2.x). A client launches it as a subprocess and exchanges JSON-RPC messages over stdin and stdout; logs go to stderr.

Terminal window
doc-scraper mcp-server -config /path/to/config.yaml

Most clients take the command in this shape:

{
"command": "/path/to/doc-scraper",
"args": ["mcp-server", "-config", "/path/to/config.yaml"],
"env": {}
}

To let the agent add and fix sites with save_site, add -allow-config-writes after the config path.

Use absolute paths, both here and for output_base_dir and state_dir inside the config: the client decides the server’s working directory.

An initialize handshake followed by a list_sites call, piped straight into the server:

Terminal window
printf '%s\n' \
'{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-11-25","capabilities":{},"clientInfo":{"name":"demo","version":"0"}}}' \
'{"jsonrpc":"2.0","method":"notifications/initialized"}' \
'{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"list_sites","arguments":{}}}' \
| doc-scraper mcp-server -config /tmp/mcpdemo/config.yaml 2>/dev/null
{"jsonrpc":"2.0","id":1,"result":{"protocolVersion":"2025-11-25","capabilities":{"tools":{}},"serverInfo":{"name":"doc-scraper","version":"2.29.0"},"instructions":"Call describe_server first: it lists the configured sites, when each was last crawled, and recent crawl jobs. search_docs, list_pages and read_page work offline on stored crawls; run crawl_site for a site that has not been crawled yet. get_page fetches a URL live. For a docs site that is not configured, or one that extracts badly, draft_site previews an entry and save_site adds it."}}
{"jsonrpc":"2.0","id":2,"result":{"content":[{"type":"text","text":"{\"sites\":[{\"key\":\"demo\",\"domain\":\"example.com\",\"path_prefix\":\"\",\"start_urls_count\":1,\"max_depth\":0}],\"config_path\":\"/tmp/mcpdemo/config.yaml\",\"total_sites\":1}"}],"structuredContent":{"sites":[{"key":"demo","domain":"example.com","path_prefix":"","start_urls_count":1,"max_depth":0}],"config_path":"/tmp/mcpdemo/config.yaml","total_sites":1}}}

Output from doc-scraper 2.29.0, 2026-11-26. Each tool result except get_page and read_page carries the data twice: as structuredContent, which matches the tool’s outputSchema, and as the same JSON value in a text content block. get_page and read_page return a text block only (see MCP tools). The tools and their arguments are listed on MCP tools.

Send initialize before anything else. A request that comes before it is refused with JSON-RPC error -32600 (“server not initialized”), except ping, server/discover, and requests that carry protocol 2026-07-28 _meta (io.modelcontextprotocol/protocolVersion and io.modelcontextprotocol/clientCapabilities), which need no handshake. Writing initialize and the first call together, as above, is fine: the order on stdin is what counts.

Each message must fit on one line of at most 4 MiB. A longer line is discarded without being read into memory: if its id appears in the first 4 MiB, the request gets JSON-RPC error -32600 (“request too large”); otherwise it gets no reply and the server logs a warning.