转录员的 MCP 服务器
Transcripter 项目的模型上下文协议 (MCP) 服务器实现。此软件包提供使用 MCP 标准的 AI 功能所需的工具和资源。
特征
工具
- test-api :测试 API 端点并返回结果
- 转录搜索:通过过滤和分页搜索转录
- 转录摘要:使用人工智能生成转录摘要
资源
- transcript://{id} :通过 ID 访问转录数据
- analysis://{id} :通过ID访问分析数据
要求
- Node.js >= 18.0.0
- npm >= 7.0.0
安装
建筑
# Build for both ESM and CommonJS
npm run build
# Build for ESM only
npm run build:esm
# Build for CommonJS only
npm run build:cjs
跑步
# Start the MCP server on the default port (3500)
npm run server
# Start the MCP server on a custom port
npm run server 4000
测试
使用示例
使用 test-api 工具
import { Client } from "@modelcontextprotocol/sdk/client";
import { SSEClientTransport } from "@modelcontextprotocol/sdk/client/sse";
async function testApiEndpoint() {
// Connect to the MCP server
const transport = new SSEClientTransport("http://localhost:3500/sse", "http://localhost:3500/message");
const client = new Client();
await client.connect(transport);
// Use the test-api tool
const result = await client.tools.execute("test-api", {
endpoint: "transcriptions",
method: "GET",
});
console.log(result);
}
使用转录资源
import { Client } from "@modelcontextprotocol/sdk/client";
import { SSEClientTransport } from "@modelcontextprotocol/sdk/client/sse";
async function getTranscription(id: number) {
// Connect to the MCP server
const transport = new SSEClientTransport("http://localhost:3500/sse", "http://localhost:3500/message");
const client = new Client();
await client.connect(transport);
// Access the transcription resource
const transcription = await client.resources.get(`transcription://${id}`);
console.log(transcription);
}
与 Transcripter 集成
该 MCP 服务器与 Transcripter 项目集成,提供 AI 驱动的转录和分析功能。它作为 AI 模型交互的标准化接口。
项目结构
src/cli.ts
:用于启动 MCP 服务器的命令行界面src/tools/
:MCP 工具的实现src/resources/
:MCP 资源提供者的实现src/tests/
:工具和资源的测试
执照
麻省理工学院