@yusufstar07/request-mcp
v1.0.0
Published
MCP server: HTTP client for AI agents (Postman + curl adapter)
Downloads
60
Readme
request-mcp
Postman-like API client as MCP. Send HTTP requests via JSON (method, URL, headers, body, params) or paste a curl command. Response body is auto-formatted (JSON/HTML/text) and truncated at 500 chars.
- http_request – method, url, headers, body, params, optional timeout. Default headers merged in.
- curl_import – parse a curl command string and run it.
- headers_set / headers_clear / headers_get – session default headers.
Prerequisites: Node.js 18+
Install
npm install -g @yusufstar07/request-mcp
# or: npm install @yusufstar07/request-mcpCursor / Claude Desktop
MCP config (use the full package name with npx):
{
"mcpServers": {
"request-mcp": {
"command": "npx",
"args": ["-y", "@yusufstar07/request-mcp"]
}
}
}To run from a local build instead:
{
"mcpServers": {
"request-mcp": {
"command": "node",
"args": ["/path/to/request-mcp/dist/index.js"]
}
}
}Run npm run build in the project first so dist/index.js exists.
Tools
| Tool | Description | |------|-------------| | http_request | method, url, headers, body, params, timeout (optional). Default headers merged in. Response body formatted and truncated. | | curl_import | Parse curl string and run the request. | | headers_set | Set/merge default headers (e.g. Authorization, Content-Type). | | headers_clear | Remove default headers. | | headers_get | Get current default headers. |
Examples
http_request (JSON)
{
"method": "POST",
"url": "https://api.example.com/users",
"headers": { "Content-Type": "application/json", "Authorization": "Bearer YOUR_TOKEN" },
"body": { "name": "John", "email": "[email protected]" }
}With query params (URL-encoded by default):
{
"method": "GET",
"url": "https://api.example.com/search",
"params": { "q": "hello", "limit": "10" }
}curl_import (curl string)
Paste a curl command; the server parses it and runs the request:
curl -X POST https://api.example.com/login \
-H "Content-Type: application/json" \
-H "Authorization: Bearer xxx" \
-d '{"username":"jane","password":"secret"}'Another example:
curl -X GET "https://api.github.com/user" -H "Authorization: Bearer ghp_xxxx"headers_set / headers_clear
Set default headers once; they apply to every http_request and curl_import until cleared:
- Set:
headers_setwith{ "Authorization": "Bearer xxx", "Content-Type": "application/json" } - Clear:
headers_clear(no args) - Get:
headers_getto see current defaults
Behavior
- Params: Sent as query string; axios URL-encodes them by default.
- Response body: Detected as JSON, HTML, or text; prettified when possible and truncated at 500 characters.
- Timeout: Default 30s per request; override with
timeout(ms) inhttp_request.
License
MIT
