Content
# bilibili-mcp
Bilibili MCP Server, supports getting hot rankings, searching videos, getting user upload lists and other functions
## Prerequisites
Install `Chromium` dependency:
```bash
npx playwright install chromium
```
Log in to your Bilibili account and obtain Cookies:
```bash
# Install
npm i -g @lianginx/bilibili-mcp
# Log in to your Bilibili account
bili-cli login
```
## Function List
- [x] Get hot rankings
- [x] Search videos
- [x] Search users
- [x] Search anime
- [ ] Search movies and TV shows
- [x] Get user upload list
- [x] Get user information
## MCP Server
Take OpenCode as an example to configure MCP Server:
```json
// ~/.config/opencode/opencode.json
{
"mcp": {
"bilibili": {
"type": "local",
"enabled": true,
"command": ["bili-mcp"]
}
}
}
```
Restart OpenCode after configuration.
## Uninstallation and Cleanup
Clean up `Chromium` cache:
```bash
npx playwright uninstall
```
Clean up `bilibili-mcp` cache:
```bash
rm -rf ~/.config/bilibili-mcp
```