전사자를 위한 MCP 서버
Transcripter 프로젝트를 위한 모델 컨텍스트 프로토콜(MCP) 서버 구현입니다. 이 패키지는 MCP 표준을 사용하는 AI 기반 기능을 위한 도구와 리소스를 제공합니다.
특징
도구
- test-api : API 엔드포인트를 테스트하고 결과를 반환합니다.
- transcription-search : 필터링 및 페이지 매김을 통해 전사본 검색
- transcription-summary : AI를 사용하여 전사본 요약 생성
자원
- transcription://{id} : ID로 전사 데이터에 접근
- analysis://{id} : ID로 분석 데이터에 접근
요구 사항
- 노드.js >= 18.0.0
- npm >= 7.0.0
설치
지엑스피1
건물
# 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
테스트
사용 예
테스트 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/
: 도구 및 리소스에 대한 테스트
특허
MIT