Metadata-Version: 2.4
Name: fetch-clean-markdown-mcp
Version: 1.0.0
Summary: A Python wrapper for the fetch-clean-markdown-mcp MCP server — fetches URLs and returns clean, LLM-optimized Markdown
Author: bigdub96
License: MIT
Project-URL: Homepage, https://github.com/bigdub96/fetch-clean-markdown-mcp
Project-URL: Repository, https://github.com/bigdub96/fetch-clean-markdown-mcp
Project-URL: BugTracker, https://github.com/bigdub96/fetch-clean-markdown-mcp/issues
Keywords: mcp,mcp-server,model-context-protocol,fetch,markdown,html-to-markdown,context-grounding,llm,agent-tool
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Description-Content-Type: text/markdown

# fetch-clean-markdown-mcp

An MCP (Model Context Protocol) server that fetches URLs and returns clean, LLM-optimized Markdown.

## Features

- **Clean extraction** — Strips HTML, scripts, and boilerplate from any public URL
- **Security hardened** — SSRF protection, redirect validation, prompt injection sanitization, payload size limits
- **Edge deployed** — Runs on Cloudflare Workers for global low-latency access
- **Locally runnable** — Can also run via stdio for local MCP client integration

## Usage

### Configuration for Cline / MCP clients

Add to your `cline_mcp_settings.json`:

```json
{
  "mcpServers": {
    "fetch-clean-markdown-mcp": {
      "command": "node",
      "args": ["dist/local.js"],
      "env": {}
    }
  }
}
```

Or use the npm package globally:

```json
{
  "mcpServers": {
    "fetch-clean-markdown-mcp": {
      "command": "npx",
      "args": ["fetch-clean-markdown-mcp"],
      "env": {}
    }
  }
}
```

### Remote (Cloudflare Worker)

```
https://fetch-clean-markdown-mcp.yourbuttstinks69420.workers.dev
```

## Tool

### `fetch_clean_markdown`

**CRITICAL**: Use this tool to extract clean, readable text/markdown from any public URL.

**Input:**
- `url` (string, required) — The public web URL to fetch

**Returns:**
- Clean Markdown text with HTML stripped, injection sanitization applied, and size-limited to 512 KB

## Local Development

```bash
# Install dependencies
npm install

# Build
npm run build

# Run locally
npm start

# Run with hot-reload
npm run start:dev
```

## Deploy to Cloudflare

```bash
npx wrangler login
npm run deploy
```

## License

MIT
