cevheri commited on
Commit
a877914
·
1 Parent(s): 8a3b182

docs: add readme

Browse files
Files changed (3) hide show
  1. .env.example +2 -2
  2. README.md +36 -46
  3. mcp_client.py +6 -0
.env.example CHANGED
@@ -5,5 +5,5 @@ LLM_API_KEY=sk-proj-
5
  # end LLM configuration
6
 
7
  # MCP server configuration for local testing
8
- MCP_SERVER_URL=https://dpc-restapi-mcp-server-75k7y.ondigitalocean.app/mcp/
9
- #MCP_SERVER_URL=http://0.0.0.0:8000/mcp/
 
5
  # end LLM configuration
6
 
7
  # MCP server configuration for local testing
8
+ # MCP_SERVER_URL=https://dpc-restapi-mcp-server-75k7y.ondigitalocean.app/mcp/
9
+ MCP_SERVER_URL=http://0.0.0.0:8000/mcp/
README.md CHANGED
@@ -1,71 +1,70 @@
1
  # DPC MCP Client
 
2
 
3
- Bu proje, LangChain MCP Client kullanarak FASTMC-Server'ın streamablehttp protokolü üzerinden Product Catalog API'lerini çağırmak için tasarlanmış bir Gradio tabanlı chatbot uygulamasıdır.
4
 
5
- ## 🚀 Özellikler
6
 
7
- - LangChain MCP Client entegrasyonu
8
- - Gradio tabanlı kullanıcı arayüzü
9
- - StreamableHTTP protokolü desteği
10
- - Product Catalog API entegrasyonu
11
- - Astral/UV paket yöneticisi desteği
12
- - Python 3.13 uyumluluğu
13
 
14
- ## 📋 Gereksinimler
15
 
16
- - Python 3.13 veya üzeri
17
- - UV paket yöneticisi
18
- - Aşağıdaki çevre değişkenleri:
19
 
20
  ```env
21
  AGENT_DEBUG=true
22
  LLM_PROVIDER=OPENAI
23
  LLM_API_KEY=your_api_key_here
24
- LLM_MODEL=your_model_name_here
25
- MCP_SERVER_URL=your_mcp_server_url_here
26
  ```
27
 
28
- ## 🛠️ Kurulum
29
 
30
- 1. Projeyi klonlayın:
31
  ```bash
32
  git clone https://github.com/yourusername/dpc_mcp_client.git
33
  cd dpc_mcp_client
34
  ```
35
 
36
- 2. UV ile bağımlılıkları yükleyin:
37
  ```bash
38
- uv venv
39
- source .venv/bin/activate # Linux/Mac
40
- # veya
41
- .venv\Scripts\activate # Windows
42
- uv pip install -e .
43
  ```
44
 
45
- ## 🚀 Kullanım
46
 
47
- Uygulamayı başlatmak için:
48
 
49
  ```bash
50
  uv run app.py
51
  ```
52
 
53
- Uygulama başlatıldığında, tarayıcınızda Gradio arayüzü otomatik olarak açılacaktır. Bu arayüz üzerinden Product Catalog API'lerini sorgulayabilirsiniz.
 
54
 
55
- ## 📁 Proje Yapısı
 
56
 
57
  ```
58
  dpc_mcp_client/
59
- ├── app.py # Gradio UI ve ana uygulama
60
- ├── mcp_client.py # MCP Client implementasyonu
61
- ├── resources/ # Kaynak dosyaları
62
  │ ├── instruction.txt
63
  │ └── dpc_restapi_summary.txt
64
- ├── pyproject.toml # Proje bağımlılıkları
65
  └── README.md
66
  ```
67
 
68
- ## 🔧 Bağımlılıklar
69
 
70
  - environs>=14.2.0
71
  - gradio>=5.32.1
@@ -74,20 +73,11 @@ dpc_mcp_client/
74
  - langgraph>=0.4.8
75
  - loguru>=0.7.3
76
 
77
- ## 🤝 Katkıda Bulunma
78
-
79
- 1. Bu depoyu fork edin
80
- 2. Yeni bir özellik dalı oluşturun (`git checkout -b feature/amazing-feature`)
81
- 3. Değişikliklerinizi commit edin (`git commit -m 'Add some amazing feature'`)
82
- 4. Dalınıza push yapın (`git push origin feature/amazing-feature`)
83
- 5. Bir Pull Request oluşturun
84
-
85
- ## 📝 Lisans
86
-
87
- Bu proje MIT lisansı altında lisanslanmıştır. Daha fazla bilgi için `LICENSE` dosyasına bakın.
88
-
89
- ## 📞 İletişim
90
 
91
- Proje Sahibi - [@yourusername](https://github.com/yourusername)
 
 
 
 
92
 
93
- Proje Linki: [https://github.com/yourusername/dpc_mcp_client](https://github.com/yourusername/dpc_mcp_client)
 
1
  # DPC MCP Client
2
+ **Desinged to test the DNext Product Catalog REST API MCP Server.**
3
 
4
+ A Gradio-based chatbot application designed to interact with Product Catalog APIs through FASTMC-Server's streamable-http protocol using LangChain MCP Client.
5
 
6
+ ## 🚀 Features
7
 
8
+ - LangChain MCP Client integration
9
+ - Gradio-based user interface
10
+ - StreamableHTTP protocol support
11
+ - Product Catalog API integration
12
+ - Astral/UV package manager support
13
+ - Python 3.13 compatibility
14
 
15
+ ## 📋 Requirements
16
 
17
+ - Python 3.13 or higher
18
+ - UV package manager
19
+ - The following environment variables:
20
 
21
  ```env
22
  AGENT_DEBUG=true
23
  LLM_PROVIDER=OPENAI
24
  LLM_API_KEY=your_api_key_here
25
+ LLM_MODEL=gpt-4.1
26
+ MCP_SERVER_URL=http://localhost:8080/mcp/
27
  ```
28
 
29
+ ## 🛠️ Installation
30
 
31
+ 1. Clone the repository:
32
  ```bash
33
  git clone https://github.com/yourusername/dpc_mcp_client.git
34
  cd dpc_mcp_client
35
  ```
36
 
37
+ 2. Install dependencies using UV:
38
  ```bash
39
+ uv sync
 
 
 
 
40
  ```
41
 
42
+ ## 🚀 Usage
43
 
44
+ To start the application:
45
 
46
  ```bash
47
  uv run app.py
48
  ```
49
 
50
+ * Once started, the Gradio interface will automatically open in your browser. You can query Product Catalog APIs through this interface.
51
+ * Click the link to open the Gradio interface in your browser: [http://0.0.0.0:7860](http://0.0.0.0:7860)
52
 
53
+
54
+ ## 📁 Project Structure
55
 
56
  ```
57
  dpc_mcp_client/
58
+ ├── app.py # Gradio UI and main application
59
+ ├── mcp_client.py # MCP Client implementation
60
+ ├── resources/ # Resource files
61
  │ ├── instruction.txt
62
  │ └── dpc_restapi_summary.txt
63
+ ├── pyproject.toml # Project dependencies
64
  └── README.md
65
  ```
66
 
67
+ ## 🔧 Dependencies
68
 
69
  - environs>=14.2.0
70
  - gradio>=5.32.1
 
73
  - langgraph>=0.4.8
74
  - loguru>=0.7.3
75
 
76
+ ## 🤝 Contributing
 
 
 
 
 
 
 
 
 
 
 
 
77
 
78
+ 1. Fork the repository
79
+ 2. Create your feature branch (`git checkout -b feature/amazing-feature`)
80
+ 3. Commit your changes (`git commit -m 'Add some amazing feature'`)
81
+ 4. Push to the branch (`git push origin feature/amazing-feature`)
82
+ 5. Open a Pull Request
83
 
 
mcp_client.py CHANGED
@@ -74,6 +74,12 @@ class MCPClient:
74
 
75
  async def initialize(self):
76
  logger.info("Initializing MCP client...")
 
 
 
 
 
 
77
  self.system_message = "".join([self.instruction, "\n\n", self.api_description])
78
 
79
  async def invoke(self, input_messages):
 
74
 
75
  async def initialize(self):
76
  logger.info("Initializing MCP client...")
77
+ logger.info("Print Environment Variables: \n")
78
+ logger.info(f"LLM_PROVIDER: {LLM_PROVIDER}")
79
+ logger.info(f"LLM_API_KEY: {LLM_API_KEY[:12]}...")
80
+ logger.info(f"LLM_MODEL: {LLM_MODEL}")
81
+ logger.info(f"MCP_SERVER_URL: {MCP_SERVER_URL}")
82
+
83
  self.system_message = "".join([self.instruction, "\n\n", self.api_description])
84
 
85
  async def invoke(self, input_messages):