トランスクリプター用MCPサーバー
Transcripterプロジェクト用のModel Context Protocol(MCP)サーバー実装。このパッケージは、MCP標準を使用したAI活用機能のためのツールとリソースを提供します。
特徴
ツール
- test-api : APIエンドポイントをテストし、結果を返す
- transcription-search : フィルタリングとページ付けによる転写の検索
- transcription-summary : AIを使用して転写の要約を生成する
リソース
- transcription://{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);
}
トランスクリプターとの統合
このMCPサーバーはTranscripterプロジェクトと統合され、AIを活用した文字起こしと分析機能を提供します。AIモデルとのやり取りのための標準化されたインターフェースとして機能します。
プロジェクト構造
src/cli.ts
: MCP サーバーを起動するためのコマンドラインインターフェースsrc/tools/
: MCPツールの実装src/resources/
: MCP リソースプロバイダーの実装src/tests/
: ツールとリソースのテスト
ライセンス
マサチューセッツ工科大学