File size: 3,047 Bytes
e66a6af
00fb7aa
e66a6af
 
 
 
 
 
00fb7aa
e66a6af
00fb7aa
 
e66a6af
 
cee4c0c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b399bf7
b4b1660
 
 
 
 
b399bf7
cee4c0c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b399bf7
 
 
 
 
 
 
cee4c0c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b399bf7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
---
title: MAL Agent
emoji: πŸš€
colorFrom: red
colorTo: red
sdk: docker
app_port: 8501
tags:
- streamlit
pinned: false
short_description: MyAnimeList Based Agent
license: mit
---

# MAL Agent πŸš€

A Streamlit-powered assistant for managing your [MyAnimeList](https://myanimelist.net/) anime list, discovering new anime, and getting recommendationsβ€”all in a friendly chat interface.

---

## Features

- **MyAnimeList Management:**  
  - View, add, and remove anime from your personal MAL list.
  - Filter your list by status (Watching, Completed, etc.).
- **Anime Recommendations:**  
  - Get personalized anime suggestions.
  - Display recommendations as visually appealing cards.
- **Web Search:**  
  - Search for additional anime info using DuckDuckGo.
- **Watch Links:**  
  - Get streaming links exclusively from HiAnime.
- **Secure Authentication:**  
  - OAuth2 login with your MAL account.

---

## Screenshots
![Login](https://github.com/user-attachments/assets/924b90c4-2443-4da9-a0f1-db264ea6a646)

![Homepage](https://github.com/user-attachments/assets/5dffd346-0d27-411e-925d-b9aa346907a1)

![My Anime List Query](https://github.com/user-attachments/assets/2f7a1199-467e-48a4-8d50-1e53d93049fe)

## Getting Started

### 1. Clone the Repository

```sh
# Using PowerShell
git clone https://github.com/yourusername/MAL-Agent.git
cd MAL_Agent
```

### 2. Set Up Environment Variables

Copy `example.env` to `.env` and fill in your API keys and MAL credentials:

```sh
Copy-Item example.env .env
```

Edit `.env` and provide your keys:
```
GEMINI_API_KEY=your_gemini_api_key
DEEPSEEK_API_KEY=your_deepseek_api_key
MAL_CLIENT_ID=your_mal_client_id
MAL_CLIENT_SECRET=your_mal_client_secret
MAL_REDIRECT_URI=http://localhost:8080/callback
MAL_PORT=8080
```

### 3. Install Dependencies

```sh
pip install -r requirements.txt
```

### 4. Run the App

```sh
streamlit run src/streamlit_app.py
```

The app will be available at [http://localhost:8501](http://localhost:8501).

---

## Project Structure

```
MAL_Agent/
β”œβ”€β”€ .env
β”œβ”€β”€ Dockerfile
β”œβ”€β”€ README.md
β”œβ”€β”€ requirements.txt
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ agent.py
β”‚   β”œβ”€β”€ auth.py
β”‚   β”œβ”€β”€ streamlit_app.py
β”‚   └── tools.py
```

---

## Docker

You can also run the app in Docker:

```sh
docker build -t mal-agent .
docker run -p 8501:8501 --env-file .env mal-agent
```

---

### Important Note
> **This app can only be run locally.**

> Due to the way MyAnimeList OAuth and PKCE authentication works, you must run this app on your own machine (localhost). Hosting on Streamlit Community Cloud or other remote servers is not supported for full authentication functionality.



## License

MIT

---

## Credits

- [Streamlit](https://streamlit.io/)
- [MyAnimeList API](https://myanimelist.net/apiconfig/references/api/v2)
- [smolagents](https://github.com/smol-ai/smol-agents)

---

## Support Me

If you like this project, consider supporting me on Ko-fi!

[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/Y8Y6IPAOF)