|
|
--- |
|
|
title: DpcMcpClient |
|
|
emoji: π€― |
|
|
colorFrom: pink |
|
|
colorTo: yellow |
|
|
sdk: docker |
|
|
pinned: false |
|
|
short_description: MCP-Client Test for DNext Product Catalog MCPServer |
|
|
--- |
|
|
|
|
|
# DPC MCP Client |
|
|
**Desinged to test the DNext Product Catalog REST API MCP Server.** |
|
|
|
|
|
A Gradio-based chatbot application designed to interact with Product Catalog APIs through FASTMC-Server's streamable-http protocol using LangChain MCP Client. |
|
|
|
|
|
## π Features |
|
|
|
|
|
- LangChain MCP Client integration |
|
|
- Gradio-based user interface |
|
|
- StreamableHTTP protocol support |
|
|
- Product Catalog API integration |
|
|
- Astral/UV package manager support |
|
|
- Python 3.13 compatibility |
|
|
|
|
|
## π Requirements |
|
|
|
|
|
- Python 3.13 or higher |
|
|
- UV package manager |
|
|
- The following environment variables: |
|
|
|
|
|
```env |
|
|
AGENT_DEBUG=true |
|
|
LLM_PROVIDER=OPENAI |
|
|
LLM_API_KEY=your_api_key_here |
|
|
LLM_MODEL=gpt-4.1 |
|
|
MCP_SERVER_URL=http://localhost:8080/mcp/ |
|
|
``` |
|
|
|
|
|
## π οΈ Installation |
|
|
|
|
|
1. Clone the repository: |
|
|
```bash |
|
|
git clone https://github.com/yourusername/dpc_mcp_client.git |
|
|
cd dpc_mcp_client |
|
|
``` |
|
|
|
|
|
2. Install dependencies using UV: |
|
|
```bash |
|
|
uv sync |
|
|
``` |
|
|
|
|
|
## π Usage |
|
|
|
|
|
To start the application: |
|
|
|
|
|
```bash |
|
|
uv run app.py |
|
|
``` |
|
|
|
|
|
* Once started, the Gradio interface will automatically open in your browser. You can query Product Catalog APIs through this interface. |
|
|
* Click the link to open the Gradio interface in your browser: [http://0.0.0.0:7860](http://0.0.0.0:7860) |
|
|
|
|
|
|
|
|
## π Project Structure |
|
|
|
|
|
``` |
|
|
dpc_mcp_client/ |
|
|
βββ app.py # Gradio UI and main application |
|
|
βββ mcp_client.py # MCP Client implementation |
|
|
βββ resources/ # Resource files |
|
|
β βββ instruction.txt |
|
|
β βββ dpc_restapi_summary.txt |
|
|
βββ pyproject.toml # Project dependencies |
|
|
βββ README.md |
|
|
``` |
|
|
|
|
|
## π§ Dependencies |
|
|
|
|
|
- environs>=14.2.0 |
|
|
- gradio>=5.32.1 |
|
|
- langchain-mcp-adapters>=0.1.4 |
|
|
- langchain-openai>=0.3.19 |
|
|
- langgraph>=0.4.8 |
|
|
- loguru>=0.7.3 |
|
|
|
|
|
## π€ Contributing |
|
|
|
|
|
1. Fork the repository |
|
|
2. Create your feature branch (`git checkout -b feature/amazing-feature`) |
|
|
3. Commit your changes (`git commit -m 'Add some amazing feature'`) |
|
|
4. Push to the branch (`git push origin feature/amazing-feature`) |
|
|
5. Open a Pull Request |
|
|
|
|
|
|