← Docs · Markdown · Agent register · Home
# Fetch

Remote web fetch for agents: given an http(s) URL, downloads the page, extracts the main article with Mozilla Readability, and returns clean markdown. Supports max_length / start_index pagination and optional raw HTML. Respects robots.txt; blocks private/local addresses (SSRF guard).

**Service id:** `fetch`  
**Version:** `0.1.0`  
**Status:** `available`

## Authentication

MCP endpoint: `https://mcp.glc-rag.hu/mcp` (streamable HTTP)

**Agents (recommended):** self-register with `account_type=agent` to get an
auto-approved token — see [https://mcp.glc-rag.hu/guide/agent](https://mcp.glc-rag.hu/guide/agent).

Or register as a human on the public site, request this service in Admin,
wait for system-admin approval, then create a token.

```http
Authorization: Bearer mcp_...
```

Cursor `mcp.json` example:

```json
{
  "mcpServers": {
    "fetch": {
      "url": "https://mcp.glc-rag.hu/mcp",
      "headers": {
        "Authorization": "Bearer mcp_YOUR_TOKEN"
      }
    }
  }
}
```

## Tools

### `fetch`

Fetches a URL from the internet and extracts its contents as markdown. Although originally you did not have internet access, this tool grants you access to public web pages. Returns title, markdown content, size, and truncation metadata (compatible with the official MCP fetch server).

**Input schema:**

```json
{
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "description": "URL to fetch (http or https)"
    },
    "max_length": {
      "type": "integer",
      "description": "Maximum number of characters to return (default 5000).",
      "minimum": 1,
      "maximum": 1000000,
      "default": 5000
    },
    "start_index": {
      "type": "integer",
      "description": "Start returning output at this character index (use after a truncated fetch).",
      "minimum": 0,
      "default": 0
    },
    "raw": {
      "type": "boolean",
      "description": "Return raw page body without Readability simplification.",
      "default": false
    }
  },
  "required": [
    "url"
  ],
  "additionalProperties": false
}
```

**Examples:**

```json
{
  "url": "https://example.com"
}
```

```json
{
  "url": "https://example.com",
  "max_length": 2000
}
```

```json
{
  "url": "https://example.com",
  "start_index": 5000,
  "max_length": 5000
}
```

### `fetch_status`

Fetch service health and default limits.

**Input schema:**

```json
{
  "type": "object",
  "properties": {},
  "additionalProperties": false
}
```

**Examples:**

```json
{}
```

## Usage notes

Call `fetch` with `url`. If `truncated` is true, call again with `start_index` = `next_start_index` to continue. Set `raw: true` for unsimplified HTML. Same extraction stack as @modelcontextprotocol/server-fetch (httpx + readabilipy + markdownify).

## Errors / limits

Non-http(s), private IPs, robots.txt disallow, HTTP ≥400, oversized body, or DNS failure → error object with `error` string. Invalid API key → platform 401.

## Agent discovery

- Agent registration: `https://mcp.glc-rag.hu/guide/agent`
- Markdown: `https://mcp.glc-rag.hu/guide/fetch.md`
- Index: `https://mcp.glc-rag.hu/llms.txt`
- MCP resource: `docs://fetch`