Metadata-Version: 2.4
Name: brillai_mcp
Version: 0.1.4
Summary: An MCP server used to obtain end-to-end information on most recent diamonds listed on Brilliant Earth. More functionalities to come...
Requires-Python: >=3.13
Description-Content-Type: text/markdown
Requires-Dist: fastmcp>=3.4.4
Requires-Dist: jsonpatch>=1.33
Requires-Dist: langchain>=1.3.14
Requires-Dist: langchain-core>=1.5.1
Requires-Dist: langchain-mcp-adapters>=0.3.0
Requires-Dist: pandas>=3.0.5
Requires-Dist: pip>=26.2.1
Requires-Dist: playwright>=1.62.0
Requires-Dist: playwright-stealth>=2.0.3
Requires-Dist: camoufox

# brillai_mcp

An MCP server providing end-to-end information on recently listed
diamonds from Brilliant Earth. 

## Features

- Retrieve recent diamond listings of requested shapes (300 each) that have 360° view
- Access real diamond specifications through the end-to-end product information
- Get the most valuable and complete data that could exist online
- Proven to be effective in training ML models for various use cases
- This server is deployed for education purposes ONLY

## Installation and How to Get Started

### STEP 1: Create a virtual environment using uv

Create an empty folder and make a new Python project with basic files using __init__ :

```bash
uv init
```

Next, create a virtual environment. Keep the default name preferably

```bash
uv venv
```


### STEP 2: Install brillai_mcp

Go to the terminal and paste the following command.

```bash
pip install brillai_mcp
```
or

```bash
uv add brillai_mcp
```

### STEP 3: Making changes in the pyproject.toml file

Go to the .toml file in your project folder and change the following lines.

- Change the requires-python to:

```bash
requires-python = ">=3.13,<3.14"
```

- Change the dependencies to:

```bash
dependencies = [
    "brillai-mcp=={latest_version_here}",
    "mcp<2.0.0",
]
```

### STEP 4: Back to the terminal

In the terminal run the following commands one after the other

```bash
uv lock
```

```bash
uv sync
```

### STEP 5: Boilerplate Code

Make a new .py file within the same project folder and paste the following code

```bash
from langchain_mcp_adapters.client import MultiServerMCPClient
import asyncio

async def main():

    client = MultiServerMCPClient(

    {
        "brillai_mcp": {
            "transport": "stdio",
            "command": "python",
            "args": ["-m", "brillai_mcp.main"]
        }
    }
    )

    tools = await client.get_tools()
    get_diamonds = tools[0]



    result = await get_diamonds.ainvoke({"shapes": ["round", "heart"], "filename": "first_run.json"})
    print(result)

    

if __name__ == "__main__":
    asyncio.run(main())
```

This code will create a JSON file within your project that has all the data.

## More about the tools

The current version has one tool with the following parameters:

### Parameters

| Parameter | Type              | Default          | Description                          | Options                                                                 |
|-----------|-------------------|------------------|---------------------------------------|--------------------------------------------------------------------------|
| `shapes`  | `str \| list[str]` | *required*       | Diamond shape(s) to search for        | "oval", "round", "marquise", "emerald-cut", "elongated-cushion", "radiant", "pear", "cushion", "antique", "princess", "asscher", "heart"              |
| `filename`| `str`             | `"products.json"`| Output file name for the results      | Any valid filename ending in `.json`                                    |


## Caution

- The function currently retrieves ~300 diamonds of every shape except for 'antique' as there are few listings for it.
- The list obtained might contain duplicate entries that could be dealt using data preprocessing techniques
- Please verify the data type of each column before getting started

## Connect with the Author

[LinkedIn](https://www.linkedin.com/in/yash-shah-00816523b/) | [Github](https://github.com/YashKS119) | [Website](https://yashmasteruniversa.wixstudio.com/resume)
