# gladiaio
## 基本信息
- Slug: `gladiaio-gladia-mcp`
- Source: modelscope
- Publisher: @gladiaio/gladia-mcp
- Categories: speech-processing / audio-processing / language-translation
- Hosted: No
- License: MIT License
- Source URL: https://www.modelscope.cn/mcp/servers/@gladiaio/gladia-mcp
## 简介
暂无描述。
## MCP Server 详情

# Gladia MCP

<div class="title-block" style="text-align: center;" align="center">

  [![PyPI](https://img.shields.io/badge/PyPI-gladia--mcp-000000.svg?style=for-the-badge&logo=pypi&labelColor=000)](https://pypi.org/project/gladia-mcp)
  [![Tests](https://img.shields.io/badge/tests-passing-000000.svg?style=for-the-badge&logo=github&labelColor=000)](https://github.com/gladia/gladia-mcp/actions/workflows/test.yml)

</div>

<p align="center">
  官方Gladia <a href="https://github.com/modelcontextprotocol">模型上下文协议 (MCP)</a> 服务器，支持与强大的语音转文字和音频智能API进行交互。该服务器允许像<a href="https://www.anthropic.com/claude">Claude Desktop</a>、<a href="https://www.cursor.so">Cursor</a>、<a href="https://codeium.com/windsurf">Windsurf</a>、<a href="https://github.com/openai/openai-agents-python">OpenAI Agents</a>等MCP客户端进行音频转录、语音分析、内容翻译等功能。
</p>

## 功能

- 带有说话人分割的音频转录
- 实时语音转文字
- 音频智能功能：
  - 翻译
  - 摘要
  - 命名实体识别
  - 情感分析
  - 内容审核
  - 分章节
  - 音频到大语言模型（LLM）集成
- 使用FastAPI的异步API
- 易于使用的命令行界面
- 可配置的日志记录
- CORS支持
- 健康检查端点

## Claude Desktop快速入门

1. 从[Gladia](https://app.gladia.io/settings/api-keys)获取您的API密钥。提供免费层级。
2. 安装`uv`（Python包管理器），使用`curl -LsSf https://astral.sh/uv/install.sh | sh`安装或参见`uv`[仓库](https://github.com/astral-sh/uv)以获取更多安装方法。
3. 转到Claude > 设置 > 开发者 > 编辑配置 > claude_desktop_config.json，包含以下内容：

json
{
  "mcpServers": {
    "Gladia": {
      "command": "uvx",
      "args": ["gladia-mcp"],
      "env": {
        "GLADIA_API_KEY": "<在此插入您的API密钥>"
      }
    }
  }
}


如果您使用的是Windows系统，则需要在Claude Desktop中启用“开发者模式”才能使用MCP服务器。点击左上角的汉堡菜单中的“帮助”，然后选择“启用开发者模式”。

## 其他MCP客户端

对于其他客户端如Cursor和Windsurf，请运行：
1. `pip install gladia-mcp`
2. `python -m gladia_mcp --api-key={{PUT_YOUR_API_KEY_HERE}} --print` 获取配置。将其粘贴到由您的MCP客户端指定的适当配置目录中。

## 示例用法

尝试向Claude提问：

- “转录这个音频文件并识别不同的说话人”
- “将这段录音转换为文本并翻译成西班牙语”
- “分析这段讲话的情感和情绪”
- “从这个长音频文件中提取关键主题并创建章节”
- “转录这段对话并总结主要观点”

## 可选功能

您可以在`claude_desktop_config.json`中添加`GLADIA_MCP_BASE_PATH`环境变量，以指定MCP服务器应查找和输出文件的基本路径。

## 贡献

如果您想贡献代码或从源码运行：

1. 克隆仓库：
bash
git clone https://github.com/gladia/gladia-mcp
cd gladia-mcp


2. 创建虚拟环境并安装依赖项[使用uv](https://github.com/astral-sh/uv)：
bash
uv venv
source .venv/bin/activate
uv pip install -e ".[dev]"


3. 将`.env.example`复制到`.env`并添加您的Gladia API密钥：
bash
cp .env.example .env
# 编辑.env并添加您的API密钥


4. 运行测试以确保一切正常：
bash
./scripts/test.sh
# 或者带选项运行
./scripts/test.sh --verbose --fail-fast


5. 在Claude Desktop中安装服务器：`mcp install gladia_mcp/server.py`

6. 使用MCP Inspector本地调试和测试：`mcp dev gladia_mcp/server.py`

## API端点

### 健康检查

GET /health


### 转录音频

POST /transcribe


参数：
- `file`: 音频文件 (multipart/form-data)- `diarization`: 启用说话人日记化（布尔值，可选）
- `language`: 语言代码（字符串，可选）

使用 curl 的示例：
bash
curl -X POST "http://localhost:8000/transcribe" 
  -H "accept: application/json" 
  -H "Content-Type: multipart/form-data" 
  -F "file=@audio.wav" 
  -F "diarization=true"


## 故障排除

运行 Claude Desktop 时的日志位置如下：
- **Windows**: `%APPDATA%Claudelogsmcp-server-gladia.log`
- **macOS**: `~/Library/Logs/Claude/mcp-server-gladia.log`

### MCP Gladia: spawn uvx ENOENT

如果您遇到错误 "MCP Gladia: spawn uvx ENOENT"，请通过在终端中运行以下命令来确认其绝对路径：
bash
which uvx


一旦您获得了绝对路径（例如 `/usr/local/bin/uvx`），请更新您的配置以使用该路径（例如 `"command": "/usr/local/bin/uvx"`）。这确保引用了正确的可执行文件。

## 开发

### 运行测试
bash
pytest


### 代码风格
项目遵循 PEP 8 风格指南。使用 flake8 进行代码检查：
bash
flake8 gladia_mcp


## 许可证

MIT 许可证

