Metadata-Version: 2.4
Name: scrapy-mcp-middleware
Version: 0.1.0
Summary: Scrapy middleware for MCP request tracking
Author: Fabien Vauchelles
Project-URL: Homepage, https://github.com/scrapoxy/scrapy-mcp-middleware
Keywords: scrapy,mcp,middleware,tracking,debugging
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: License :: Other/Proprietary License
Classifier: Operating System :: OS Independent
Classifier: Framework :: Scrapy
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: scrapy>=2.0.0
Requires-Dist: requests>=2.25.0
Dynamic: license-file

# Scrapy MCP Middleware

Scrapy middleware for tracking requests and responses with MCP (Model Context Protocol) integration.

## Installation

```bash
pip install scrapy-mcp-middleware
```

## Usage

Add the middleware to your Scrapy settings:

```python
SPIDER_MIDDLEWARES = {
    'scrapy_mcp_middleware.SessionTrackerMiddleware': 100,
}

# Optional: Configure the session store URL (defaults to http://127.0.0.1:8765)
SESSION_STORE_URL = 'http://127.0.0.1:8765'
```

## Features

- Tracks all requests and responses
- Hierarchical request tree tracking
- Base64 encoding for request/response bodies
- Configurable session store URL
- Automatic storage cleanup on spider start

## Requirements

- Python >= 3.8
- Scrapy >= 2.0.0
- requests >= 2.25.0
