Bilibili Mcp
Overview
What is bilibili-mcp-js?
bilibili-mcp-js is a public repository hosted on GitHub, created by the user 34892002. This project is designed for developers who want to interact with the Bilibili platform using JavaScript. It provides a set of tools and functions that simplify the process of accessing Bilibili's features and data, making it easier for developers to build applications or scripts that utilize the platform's capabilities.
Features of bilibili-mcp-js
- JavaScript Library: The repository offers a comprehensive JavaScript library that allows developers to easily integrate Bilibili functionalities into their applications.
- Public Access: Being a public repository, anyone can access the code, contribute to its development, or use it in their own projects.
- Active Community: With 105 stars and 17 forks, the project has an active community of developers who contribute to its growth and improvement.
- Documentation: The repository includes documentation that helps users understand how to use the library effectively, including examples and API references.
How to Use bilibili-mcp-js
-
Clone the Repository: Start by cloning the repository to your local machine using the command:
git clone https://github.com/34892002/bilibili-mcp-js.git
-
Install Dependencies: Navigate to the project directory and install any necessary dependencies. This can typically be done using npm:
cd bilibili-mcp-js npm install
-
Integrate into Your Project: Import the library into your JavaScript project. You can do this by including the script in your HTML or importing it in your JavaScript files.
-
Explore the API: Refer to the documentation provided in the repository to explore the available functions and how to use them to interact with Bilibili.
-
Contribute: If you want to contribute to the project, feel free to fork the repository, make your changes, and submit a pull request.
Frequently Asked Questions
What is the purpose of bilibili-mcp-js?
The purpose of bilibili-mcp-js is to provide developers with a JavaScript library that simplifies the interaction with the Bilibili platform, allowing for easier integration of its features into applications.
Is bilibili-mcp-js free to use?
Yes, bilibili-mcp-js is a public repository and is free to use for anyone interested in developing applications that utilize Bilibili's functionalities.
How can I contribute to the project?
You can contribute by forking the repository, making improvements or fixes, and then submitting a pull request to the original repository.
Where can I find the documentation?
The documentation is available within the repository itself, typically in a README file or a dedicated docs folder.
Can I report issues or request features?
Absolutely! You can report issues or request new features by opening an issue in the GitHub repository. The project maintainers will review your suggestions.
Details
Bilibili MCP
简介
这是一个基于 Model Context Protocol (MCP) 的 B站视频搜索服务器。该服务器提供了简单的 API 接口,允许用户搜索 B站 的视频内容。提供LangChain调用示例、测试脚本。
鸣谢
- LangChain 示例代码参考自 mcp-langchain-ts-client
功能特点
- B站视频搜索
- 支持分页查询
- 返回视频信息(标题、作者、播放量、时长等)
- 基于 MCP 协议的标准化接口
系统要求
- Node.js >= 20.12.0
npm package
感谢HQHC发布的npm包
{
"mcpServers": {
"bilibili-search": {
"command": "npx",
"args": ["bilibili-mcp"],
"description": "B站视频搜索 MCP 服务,可以在AI应用中搜索B站视频内容。"
}
}
}
快速开始
如果要运行langchain例子,请先配置llm模型,修改.\example.ts文件。
const llm = new ChatOpenAI({
modelName: "gpt-4o-mini",
temperature: 0,
openAIApiKey: "your_api_key", // 替换成你模型的密钥
configuration: {
baseURL: "https://www.api.com/v1", // 替换成你模型的API地址
},
});
bun:
bun i
bun index.ts
### 测试脚本
bun test.js
### MCP Inspector
bun run inspector
### 运行langchain例子
bun build:bun
bun example.ts
npm:
npm i
npm run start
### 测试脚本
npm run test
### MCP Inspector
npm run inspector
### 运行langchain例子
npm run build
node dist/example.js
截图
Server Config
{
"mcpServers": {
"bilibili-mcp-js": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"ghcr.io/metorial/mcp-container--34892002--bilibili-mcp-js--bilibili-mcp-js",
"bun run start"
],
"env": {}
}
}
}