quote-mcp-server

Iamkrmayank/quote-mcp-server

3.1

If you are the rightful owner of quote-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

The Quote MCP Server is a FastAPI-based Model Control Protocol server designed to manage the lifecycle of quote processing, from scraping to metadata generation and storage.

πŸ“¦ Quote MCP Server

A Model Control Protocol (MCP) server built with FastAPI that manages the full lifecycle of quote processing:

  • πŸ•ΈοΈ Scraping quotes from QuoteFancy
  • πŸ“Š Structuring quotes by author
  • 🧠 Generating metadata using Azure OpenAI
  • ☁️ Uploading results to Azure Blob Storage
  • πŸ–ΌοΈ Downloading images and uploading to AWS S3 + CDN transformation
  • πŸ“… Merging metadata back into the dataset

πŸš€ How to Run

# Step 1: Clone the repo
$ git clone https://github.com/Iamkrmayank/quote-mcp-server
$ cd quote-mcp-server

# Step 2: Create virtual environment and install dependencies
$ python -m venv env
$ source env/bin/activate  # On Windows: env\Scripts\activate
$ pip install -r requirements.txt

# Step 3: Run the server
$ uvicorn main:app --reload

Server will start at http://127.0.0.1:8000


πŸ“˜ API Endpoints

πŸ•ΈοΈ /quotes/scrape

Method: POST
Description: Scrape quotes from QuoteFancy.

{
  "urls": ["https://quotefancy.com/author-name"],
  "max_pages": 5
}

🧠 /metadata/generate

Method: POST
Description: Generate metadata using Azure OpenAI.
Payload: Base64-encoded CSV containing quote blocks.

{
  "csv_base64": "..."
}

πŸ“¦ /azure/fetch-result

Method: POST
Description: Retrieve Azure batch result and upload to Blob Storage.

{
  "tracking_json": "..."  # base64 encoded
}

πŸ–ΌοΈ /images/download-upload-transform

Method: POST
Description: Download images, upload to S3, and generate transformed CDN URLs.

{
  "keywords": ["cat", "dog"],
  "count": 5
}

πŸ“… /merge/merge

Method: POST
Description: Merge structured CSV and metadata from JSONL.

{
  "csv_base64": "...",
  "jsonl_base64": "..."
}

πŸ” Secrets & Credentials

Store the following securely in environment variables or a secrets manager:

  • AZURE_OPENAI_API_KEY
  • AZURE_BLOB_CONNECTION_STRING
  • AZURE_BLOB_ACCOUNT_KEY
  • AWS_ACCESS_KEY
  • AWS_SECRET_KEY

You can load these with .env or through your CI/CD secrets.


πŸ“‚ Project Structure

mcp_server/
β”œβ”€β”€ main.py
β”œβ”€β”€ routers/
β”‚   β”œβ”€β”€ quotes.py
β”‚   β”œβ”€β”€ metadata.py
β”‚   β”œβ”€β”€ azure.py
β”‚   β”œβ”€β”€ images.py
β”‚   └── merge.py
β”œβ”€β”€ services/
β”‚   β”œβ”€β”€ quote_scraper.py
β”‚   β”œβ”€β”€ azure_batch.py
β”‚   β”œβ”€β”€ s3_uploader.py
β”‚   └── utils.py
β”œβ”€β”€ models/
β”‚   └── schemas.py
β”œβ”€β”€ requirements.txt
└── README.md

πŸ§ͺ Testing

Use Swagger UI for testing endpoints:

http://127.0.0.1:8000/docs

πŸ› οΈ Future Improvements

  • Add job queuing with Celery
  • Add authentication
  • Add Redis caching for batch status
  • Add logging middleware

πŸ‘¨β€πŸ’» Author

Built by Kumar Mayank ✨


πŸ“„ License

MIT License