xfyun-chinese-asr-mcp
v0.1.2
Published
Xunfei Chinese ASR MCP server for Xingchen cloud hosting
Readme
xfyun-chinese-asr-mcp
Node.js stdio MCP Server for Xingchen MCP cloud hosting. It calls Xunfei Chinese/English ASR large model and returns only recognition text.
MCP Tool
Tool name:
recognize_chinese_speechInput:
{
"audioBase64": "AAAA...",
"sampleRate": 16000
}Output:
{
"text": "识别结果"
}The audio must be raw PCM base64:
- 16 kHz or 8 kHz
- 16 bit
- mono
- raw PCM, no WAV header required
- short audio is recommended; keep each workflow call under 60 seconds
audioBase64 may include a data:audio/...;base64, prefix. The server strips that prefix before calling Xunfei.
Local Development
Install dependencies:
npm installRun tests:
npm testBuild:
npm run buildRun locally over stdio:
XFYUN_APP_ID=your_app_id \
XFYUN_API_KEY=your_api_key \
XFYUN_API_SECRET=your_api_secret \
npm run devXingchen MCP Cloud Hosting
Publish this package to npm, then create a cloud-hosted MCP Server at:
Use this startup configuration:
command: npx
args: -y xfyun-chinese-asr-mcpEnvironment variables:
XFYUN_APP_ID=your_app_id
XFYUN_API_KEY=your_api_key
XFYUN_API_SECRET=your_api_secretAfter hosting succeeds, add the MCP tool in the Xingchen workflow Agent intelligent decision node. The workflow should pass the board-side raw PCM base64 into audioBase64 and read only the returned text.
Board-Side Contract
The board should send raw PCM base64, not local file paths:
{
"audioBase64": "AAAA...",
"sampleRate": 16000
}If the board captures WAV, remove the WAV header or encode the PCM payload only. If the board captures another format, convert it to 16-bit mono PCM before calling the workflow.
