Iamkrmayank/quote-mcp-server
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