open-index/open-npm huggingface dataset:
npm package: @smcphub/white-noise
Description: A MCP Server for white noise management assistant by SMCPHUB
Author: SMCPHUB
Latest version: 0.0.9

# @smcphub/white-noise

![Version](https://img.shields.io/badge/version-0.0.1-blue.svg?cacheSeconds=2592000)
[![License: Apache-2.0](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](#)

> 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](https://smcphub.com)

## Install

Use the official MCP server to integrate this toolkit service:

```sh
npm i @smcphub/server
```
OR
```sh
yarn add @smcphub/server
```

## MCP Server configuration

```json
{
  "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](https://www.smcphub.com/user/api-key).

## Usage

Use the official MCP Client to connect to this toolkit service:

```js
// 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_KEY` environment 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**](https://smcphub.com)

## License

Apache-2.0