mcp-http-request mcp

v1.0.0 · MCP Tool · registry.pascalai.org

Make HTTP GET, POST, PUT, PATCH, DELETE requests to external APIs. Returns the status code, response headers and parsed JSON body. Suitable for integrating agents with any REST or HTTP-based service.

Input Parameters

ParameterTypeDescription
urlrequired string Full URL including protocol, e.g. https://api.example.com/v1/resource.
methodoptional string HTTP method: GET, POST, PUT, PATCH, DELETE, HEAD. Default: "GET".
headersoptional object Key-value map of request headers, e.g. {"Authorization": "Bearer sk-..."}.
bodyoptional string Request body string for POST, PUT, or PATCH requests.
timeout_secondsoptional integer Maximum seconds to wait for a response. Default: 30.
follow_redirectsoptional boolean Follow HTTP redirects automatically. Default: true.

Output Fields

FieldTypeDescription
status_code integer HTTP response status code (e.g. 200, 201, 404).
status_text string Human-readable status text, e.g. "OK", "Not Found".
headers object Response headers as a key-value map.
body string Raw response body text.
body_json object Parsed JSON object when the response Content-Type is application/json.
elapsed_ms integer Total request duration in milliseconds.
url string Final URL after following any redirects.

Example

// Input — POST JSON to an API
{
  "url": "https://api.example.com/v1/users",
  "method": "POST",
  "headers": {
    "Content-Type": "application/json",
    "Authorization": "Bearer sk-..."
  },
  "body": "{\"name\": \"Alice\", \"email\": \"alice@example.com\"}"
}

// Output
{
  "status_code": 201,
  "status_text": "Created",
  "elapsed_ms": 142,
  "body_json": { "id": "usr_abc123", "name": "Alice" }
}

Install & Discovery

Install

ppm install mcp-http-request

Get JSON Schema

GET /v1/packages/mcp-http-request/1.0.0/schema

Discover by keyword

GET /v1/mcp/discover?q=http+request
Discovery hint: Use this tool whenever an agent needs to call an external REST API, fetch a remote resource, submit form data, or interact with any HTTP-based service.

PascalAI Usage

uses toolslib;

var
  HTTP := LoadTool('mcp-http-request');

  // Fetch GitHub repo info
  var Repo := HTTP.Call(JsonObj([
    'url',     'https://api.github.com/repos/pascalai/compiler',
    'headers', JsonObj(['Accept', 'application/json'])
  ]));
  Writeln('Stars: ' + Repo['body_json']['stargazers_count']);