{"_id":"@ahmedshaikh/http-client-mcp","name":"@ahmedshaikh/http-client-mcp","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@ahmedshaikh/http-client-mcp","version":"0.1.0","type":"module","description":"Structured HTTP requests as an MCP server — auth (via env, not pasted secrets), retries, timeouts, query params, and parsed JSON responses, so agents stop doing fragile curl gymnastics.","bin":{"agent-http":"dist/cli.js"},"engines":{"node":">=18"},"scripts":{"serve":"tsx src/server.ts","http":"tsx src/cli.ts","build":"tsc","test":"node --import tsx --test --test-force-exit test/*.test.ts","prepublishOnly":"npm run build"},"dependencies":{"@modelcontextprotocol/sdk":"^1.0.0","zod":"^3.23.8"},"devDependencies":{"@types/node":"^20.11.0","tsx":"^4.7.0","typescript":"^5.4.0"},"license":"MIT","author":{"name":"ahmedshaikh"},"keywords":["mcp","model-context-protocol","claude","agent","ai","http","fetch","rest","api-client"],"repository":{"type":"git","url":"git+https://github.com/RaziStuff/http-client-mcp.git"},"homepage":"https://github.com/RaziStuff/http-client-mcp#readme","bugs":{"url":"https://github.com/RaziStuff/http-client-mcp/issues"},"publishConfig":{"access":"public"},"gitHead":"c104fc8ef9f2ad896486f20b850e47eccda7adbc","_id":"@ahmedshaikh/http-client-mcp@0.1.0","_nodeVersion":"24.18.0","_npmVersion":"11.16.0","dist":{"integrity":"sha512-fVgChNoi9IBoi+sCihcnDxjoNJM2ZtQTP8PhXaIcXFdUV+qGnJYWMM/t46BD30czb1rqFDGc1dFYGMCVY3SiTg==","shasum":"4e4cee6f9dcb797b040f557dd41858c7607d682d","tarball":"https://registry.npmjs.org/@ahmedshaikh/http-client-mcp/-/http-client-mcp-0.1.0.tgz","fileCount":6,"unpackedSize":11619,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCTvR9VLRe0wSP+VP3gENzVcT6RVG18koUI0qaPtZobxQIgLIJK9A5nF8o9+Mtqsy6vY5BoNXJ6dykoxtDW0B01KXg="}]},"_npmUser":{"name":"ahmedshaikh","email":"ahmed@shaikh1.com"},"directories":{},"maintainers":[{"name":"ahmedshaikh","email":"ahmed@shaikh1.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/http-client-mcp_0.1.0_1782701033600_0.5577783008067554"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-29T02:43:53.381Z","0.1.0":"2026-06-29T02:43:53.741Z","modified":"2026-06-29T02:43:53.975Z"},"maintainers":[{"name":"ahmedshaikh","email":"ahmed@shaikh1.com"}],"description":"Structured HTTP requests as an MCP server — auth (via env, not pasted secrets), retries, timeouts, query params, and parsed JSON responses, so agents stop doing fragile curl gymnastics.","homepage":"https://github.com/RaziStuff/http-client-mcp#readme","keywords":["mcp","model-context-protocol","claude","agent","ai","http","fetch","rest","api-client"],"repository":{"type":"git","url":"git+https://github.com/RaziStuff/http-client-mcp.git"},"author":{"name":"ahmedshaikh"},"bugs":{"url":"https://github.com/RaziStuff/http-client-mcp/issues"},"license":"MIT","readme":"# http-client\n\nStructured HTTP requests for agents — so they stop shelling out to `curl` and\nhand-parsing output. One tool, a clean request in, a **structured response out**\n(status, headers, parsed JSON body), with auth, retries, and timeouts built in.\n\n```\nhttp_request({ url: \"https://api.example.com/users\", query: { active: true }, bearer_env: \"API_TOKEN\" })\n→ { ok: true, status: 200, body: { users: [ … ] }, duration_ms: 180, attempts: 1 }\n```\n\n## Why\n\n`curl` works but is fragile from an agent: shell-escaping bodies, no structured\nresult, no retry, secrets pasted on the command line. This makes an HTTP call a\ntyped operation — and **auth via `bearer_env`** means the token comes from an\nenvironment variable, never the call itself.\n\n## The tool\n\n**`http_request`** — params: `url`, `method`, `headers`, `query`, `json` (body),\n`body`, `bearer_env` / `bearer_token`, `basic_user`/`basic_pass`, `timeout_ms`,\n`retries`. Returns `{ ok, status, status_text, headers, body (parsed if JSON),\nbody_truncated, content_type, duration_ms, attempts, error? }`.\n\n- **Retries** on 5xx and network errors (exponential-ish backoff).\n- **Timeout** via `AbortController` → a structured `error`, never a throw.\n- **JSON** request bodies (`json`) and auto-parsed JSON responses.\n- **Bodies capped** (default 100 KB) with `body_truncated` flagged.\n- `http`/`https` only.\n\n## Setup\n\n```bash\nnpm install\nnpm test    # runs against a local mock server — no network needed\n```\n\n```bash\nclaude mcp add http-client -- node /abs/path/http-client/dist/server.js\n# CLI: agent-http GET https://api.github.com/zen\n#      agent-http POST https://api.example.com/x --json '{\"a\":1}' --bearer-env API_TOKEN\n```\n\n## Honest limits\n\n- **No SSRF guard** — it'll request internal URLs. Fine for a local dev agent;\n  don't expose it to untrusted callers without an allowlist.\n- Response bodies are truncated past the cap (raise `max_body_kb` if needed).\n- No streaming — returns the (capped) full body.\n","readmeFilename":"README.md","_rev":"1-ec37fb778595b7d8fc56db86b7c71e26"}