{"_id":"@abhishekmcp/http","name":"@abhishekmcp/http","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@abhishekmcp/http","version":"0.1.0","description":"MCP server for HTTP/REST APIs — ad-hoc requests plus saved collections and environments, with a required host allowlist and SSRF protection, from any MCP client.","mcpName":"io.github.Abhishekkumar2021/http","type":"module","bin":{"mcp-http":"dist/index.js"},"publishConfig":{"access":"public","provenance":true},"scripts":{"build":"tsc","watch":"tsc --watch","start":"node dist/index.js","dev":"tsc && node dist/index.js","test":"npm run build && node --test test/*.test.mjs","build:mcpb":"node scripts/build-mcpb.mjs","prepublishOnly":"npm run build"},"keywords":["mcp","modelcontextprotocol","http","rest","api","claude"],"author":{"name":"Abhishek","url":"https://github.com/Abhishekkumar2021"},"license":"MIT","homepage":"https://github.com/Abhishekkumar2021/mcp-suite/tree/main/servers/http#readme","repository":{"type":"git","url":"git+https://github.com/Abhishekkumar2021/mcp-suite.git","directory":"servers/http"},"bugs":{"url":"https://github.com/Abhishekkumar2021/mcp-suite/issues"},"engines":{"node":">=18"},"dependencies":{"@modelcontextprotocol/sdk":"^1.29.0","zod":"^3.23.8"},"devDependencies":{"@types/node":"^22.0.0","typescript":"^5.6.0"},"gitHead":"dec6a82cefe5cbf0359b7120c788721c8e59c147","_id":"@abhishekmcp/http@0.1.0","_nodeVersion":"24.13.0","_npmVersion":"11.17.0","dist":{"integrity":"sha512-qZAloX+NsXlTvUIhviWYSROJDFTJC2mTYrgj6XrMm5YmLYEYG7/npFPlqThPtzqd35f0VJY0wMo1iAaJN+cjtg==","shasum":"4bcad64b8c2b4b9e8bfd5eed5b3dbb312c0a5352","tarball":"https://registry.npmjs.org/@abhishekmcp/http/-/http-0.1.0.tgz","fileCount":32,"unpackedSize":72612,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIAoRNxkInyOp0+QBRs2Db2lnHrPjaHZuVbnoset1s7DbAiAdubGIH8PqRAGxewjde3iTLBXbA6kamIOrzu/P3sNQdw=="}]},"_npmUser":{"name":"abhishek.opensource","email":"abhishek.opensource.dev@gmail.com"},"directories":{},"maintainers":[{"name":"abhishek.opensource","email":"abhishek.opensource.dev@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/http_0.1.0_1783194381568_0.6035767660399438"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-04T19:46:21.387Z","0.1.0":"2026-07-04T19:46:21.727Z","modified":"2026-07-04T19:46:21.964Z"},"maintainers":[{"name":"abhishek.opensource","email":"abhishek.opensource.dev@gmail.com"}],"description":"MCP server for HTTP/REST APIs — ad-hoc requests plus saved collections and environments, with a required host allowlist and SSRF protection, from any MCP client.","homepage":"https://github.com/Abhishekkumar2021/mcp-suite/tree/main/servers/http#readme","keywords":["mcp","modelcontextprotocol","http","rest","api","claude"],"repository":{"type":"git","url":"git+https://github.com/Abhishekkumar2021/mcp-suite.git","directory":"servers/http"},"author":{"name":"Abhishek","url":"https://github.com/Abhishekkumar2021"},"bugs":{"url":"https://github.com/Abhishekkumar2021/mcp-suite/issues"},"license":"MIT","readme":"# @abhishekmcp/http\n\nAn HTTP/REST client [MCP](https://modelcontextprotocol.io) server: make ad-hoc requests and run **saved\nrequests** organized into collections, with per-**environment** variables and secrets. Built on pure Node\nbuilt-ins (`node:http`/`node:https`/`node:dns`/`node:zlib`) — **no dependencies beyond the MCP SDK + Zod**,\nnothing to compile.\n\nEvery request is confined to a **required host allowlist** and validated against **SSRF** (private,\nloopback, link-local, and cloud-metadata addresses are refused). Reads (`GET`/`HEAD`/`OPTIONS`) are the\ndefault; mutating methods (`POST`/`PUT`/`PATCH`/`DELETE`) are **off unless you opt in** with `HTTP_WRITABLE=1`.\n\n## Tools\n\n- `request` — make an ad-hoc HTTP request to an allowlisted host (supports `${var}` + `${secret.name}`)\n- `run_request` — execute a saved request, resolving `${var}`/`${secret}` with optional field overrides\n- `save_request` — persist a request definition into a collection\n- `list_requests` — list saved requests (optionally within one collection)\n- `get_request` — return a saved request definition\n- `delete_request` — delete a saved request\n- `list_collections` — list saved collections\n- `set_environment` — create or replace an environment's (non-secret) variables\n- `get_environment` — return an environment's variables\n- `list_environments` — list environments\n- `delete_environment` — delete an environment\n- `import_curl` — parse a `curl` command into a request definition (saved if `collection`+`name` given)\n- `export_curl` — render a saved request as a `curl` command (secrets masked)\n\n> **Mutating methods** (`POST`/`PUT`/`PATCH`/`DELETE`) are refused unless `HTTP_WRITABLE=1`. `GET`/`HEAD`/`OPTIONS`\n> always work. The gate applies to `request` and `run_request` alike (whatever method the saved request carries).\n\n## Configuration\n\n| Variable | Required | Default | Effect |\n|----------|----------|---------|--------|\n| `HTTP_ALLOW_HOSTS` | **yes** | — | Comma-separated hosts the client may reach. Exact (`api.github.com`) or wildcard (`*.example.com`). The server **refuses to start** without it. |\n| `HTTP_WRITABLE` | no | `0` | `1`/`true` allows the mutating methods (`POST`/`PUT`/`PATCH`/`DELETE`). |\n| `HTTP_ALLOW_PRIVATE` | no | `0` | `1`/`true` permits private/loopback/link-local IPs (for talking to `localhost`/internal services). **Off by default.** |\n| `HTTP_SECRET_<name>` | no | — | Defines a secret referenced as `${secret.<name>}` in URLs/headers/body. Lives only in the environment — never written to disk, never returned, redacted in all output. |\n| `HTTP_DIR` | no | `~/.mcp-http` | Directory for saved collections + environments (on-disk JSON). |\n| `HTTP_MAX_RESPONSE_BYTES` | no | `1048576` (1 MB) | Response body size cap — the body is truncated (and flagged) past this. Also caps decompression output. |\n| `HTTP_TIMEOUT_MS` | no | `30000` | Per-request timeout. |\n| `HTTP_MAX_REDIRECTS` | no | `5` | Max redirects followed; **each hop is re-validated** against the allowlist + SSRF checks. |\n| `HTTP_AUDIT_LOG` | no | — | Path to a JSON-lines file; each executed request (method/url/status) is appended (secrets redacted). |\n\n## Security / SSRF\n\nRequests are locked down at two layers:\n\n1. **Host allowlist (required).** `HTTP_ALLOW_HOSTS` must be set or the server won't boot. A host matches if\n   it equals an allowlist entry, or matches a `*.example.com` wildcard (the wildcard covers subdomains, not\n   the bare apex). The target host of every request — and of **every redirect hop** — is checked.\n2. **IP validation + pinning.** DNS names are resolved through a custom `lookup`; the **resolved IP** is\n   validated and then **pinned** for the actual connection (so a name that passes the check can't be\n   re-resolved to a different address — no TOCTOU rebind). Literal IPs in the URL (including bracketed IPv6,\n   e.g. `http://[::1]/`) are validated directly. Private, loopback, link-local, unique-local, and\n   cloud-metadata (`169.254.169.254`) ranges are **refused unless `HTTP_ALLOW_PRIVATE=1`**.\n\nOn a redirect, the new location is re-validated from scratch (allowlist + IP checks); a redirect to a\ndisallowed host or private IP fails the request rather than following it.\n\n## Secrets & variables\n\n- **Secrets** come **only** from the environment as `HTTP_SECRET_<name>` and are referenced as\n  `${secret.<name>}` anywhere in a request (URL, headers, body). They are never persisted to disk, never\n  returned in tool output, and are redacted from responses, `export_curl`, and the audit log.\n- **Variables** are per-environment, non-secret values referenced as `${var}` (or `${name}`). They are stored\n  on disk with the environment (`set_environment`) and resolved when a request runs with that `environment`.\n\n```jsonc\n// save a request that uses a secret + a var, then run it against an environment\nsave_request  { \"collection\": \"gh\", \"name\": \"me\",\n                \"request\": { \"method\": \"GET\", \"url\": \"https://api.github.com/user\",\n                             \"headers\": { \"Authorization\": \"Bearer ${secret.gh_token}\" } } }\nset_environment { \"name\": \"prod\", \"vars\": { \"base\": \"https://api.github.com\" } }\nrun_request   { \"collection\": \"gh\", \"name\": \"me\", \"environment\": \"prod\" }\n// with HTTP_SECRET_gh_token set in the environment\n```\n\n## Usage\n\n```bash\n# Claude Code (plugin):  /plugin marketplace add Abhishekkumar2021/mcp-suite  →  /plugin install http\n# Claude Code (manual):\nclaude mcp add http --env HTTP_ALLOW_HOSTS=api.github.com -- npx -y @abhishekmcp/http\n```\n\n```json\n{\n  \"mcpServers\": {\n    \"http\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@abhishekmcp/http\"],\n      \"env\": {\n        \"HTTP_ALLOW_HOSTS\": \"api.github.com,*.example.com\",\n        \"HTTP_WRITABLE\": \"0\",\n        \"HTTP_SECRET_gh_token\": \"ghp_…\"\n      }\n    }\n  }\n}\n```\n\n**Claude Desktop (MCPB):** drag `http-*.mcpb` from the [latest release](https://github.com/Abhishekkumar2021/mcp-suite/releases) into Settings → Extensions, then set the allowed hosts and, optionally, enable writes. Build it locally with `npm run build:mcpb -w servers/http`.\n\n## License\n\nMIT\n","readmeFilename":"README.md","_rev":"1-484ff9ffff06af680f39ab35d6725d39"}