@smcphub/white-noise
v0.0.9
Published
A MCP Server for white noise management assistant by SMCPHUB
Maintainers
Readme
@smcphub/white-noise
SMCPHub White Noise Toolkit.
SMCPHub White Noise is a white noise service toolkit based on the MCP protocol. It supports sound list retrieval, sound detail, and user preference settings.
🏠 Homepage
Install
Use the official MCP server to integrate this toolkit service:
npm i @smcphub/serverOR
yarn add @smcphub/serverMCP Server configuration
{
"mcpServers": {
"smcphub-server": {
"command": "npx",
"args": ["-y", "@smcphub/server@latest"],
"env": {
"SMCPHUB_API_KEY": "your api key",
}
}
}
}You can get your API Key from the API Key Page.
Usage
Use the official MCP Client to connect to this toolkit service:
// import the SDK
import SmcphubClient from '@smcphub/client';
// Instantiate the client
const smcphubClient = new SmcphubClient({
api_key: 'your-api-key'
});
// Connect the MCP Server
smcphubClient
.connect()
.then(tools => {
console.log(tools);
})
.catch(err => {
console.error(err);
});
// 调用getSoundList工具
smcphubClient
.callTool('getSoundList', {})
.then(content => {
console.log(content);
})
.catch(err => {
console.error(err);
});
// 调用getSoundDetailWithUrl工具 (使用id)
smcphubClient
.callTool('getSoundDetailWithUrl', {
id: 1
})
.then(content => {
console.log(content);
})
.catch(err => {
console.error(err);
});
// 调用getSoundDetailWithUrl工具 (使用keywords)
smcphubClient
.callTool('getSoundDetailWithUrl', {
keywords: ['雨声', '下雨']
})
.then(content => {
console.log(content);
})
.catch(err => {
console.error(err);
});- You must set the
SMCPHUB_API_KEYenvironment variable for authentication.
Tool List
getSoundList
获取白噪音声音列表,支持分类筛选和分页
- category: 声音分类,可选
- page: 页码,默认1
- pageSize: 每页数量,默认20,最大100
updateUserPreference
更新用户白噪音偏好设置
- soundId: 声音ID
- data: 偏好数据
- volume: 音量,0-100之间的整数
- isFavorite: 是否收藏
getSoundDetailWithUrl
获取白噪音声音详情并包含播放URL
- id: 声音ID,必须为正数,与keywords至少传入一个
- keywords: 声音名称关键词数组,支持模糊搜索,匹配任一关键词,非空数组,与id至少传入一个
Author
👤 SMCPHUB
License
Apache-2.0
