http_post
Send data to a URL using an HTTP POST request. Accepts raw string or JSON body, custom headers, authentication, and retry logic. Understand that each call submits twice—not idempotent.
Instructions
Perform an HTTP POST. Body can be given as a raw string (body) or as a JSON value (body_json — auto-sets content-type to application/json). NOT idempotent: calling twice submits twice.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | Target URL (http:// or https://) | |
| body | No | Raw request body as a string | |
| headers | No | Extra request headers as a key/value object | |
| retries | No | Retries on 408/425/429/500/502/503/504 with exponential backoff (default 0) | |
| body_json | No | Request body as a JSON value — sets content-type to application/json if none given | |
| max_bytes | No | Max response body size in bytes before the body is truncated (default 5MiB, ceiling 100MiB) | |
| basic_auth | No | HTTP Basic auth credentials | |
| timeout_ms | No | Request timeout in ms (default 10000, max 120000) | |
| user_agent | No | User-Agent override (default identifies as @yawlabs/fetch-mcp) | |
| decode_text | No | Force text decoding (true) or binary base64 (false). Defaults to auto — text for text/*, json, xml, etc; binary otherwise. | |
| bearer_token | No | Bearer token sent as Authorization: Bearer <token> | |
| content_type | No | Content-Type header to send with the body (e.g. application/json, text/plain, application/x-www-form-urlencoded) | |
| max_redirects | No | Max redirect hops to follow (default 5) | |
| allow_private_hosts | No | Allow requests to loopback / private / link-local addresses. SSRF protection is on by default — only flip this when intentionally talking to localhost. |