역할별 컨텍스트 MCP 서버
시스템의 에이전트 역할에 따라 컨텍스트 경계를 정의하고 관리하는 MCP(모델 컨텍스트 프로토콜) 서버입니다.
개요
이 MCP 서버는 AI 에이전트에 대한 역할 기반 컨텍스트 관리를 지원하여 다음을 수행할 수 있습니다.
각 AI 에이전트(마케팅 전문가, 작곡가, 전무 비서 등)에 대한 명확한 지침, 목표 및 도메인 지식을 확립합니다.
역할 관련 메모리를 분할하고 범위를 지정하여 다양한 에이전트 역할 간 교차 오염을 방지합니다.
역할에 따라 톤 프로필을 프롬프트에 내장하여 톤과 스타일을 동적으로 조정합니다(진지함, 재치 있음, 비꼬는 것).
Related MCP server: MCP Toolkit
특징
역할 관리
사용자 정의 역할 생성, 업데이트 및 삭제
특정 전문 분야를 갖춘 미리 정의된 역할
역할별 시스템 프롬프트 및 지침
사용자 정의 가능한 톤 프로필
메모리 관리
역할별 메모리 저장
현재 쿼리와의 관련성을 기반으로 한 메모리 검색
기억의 수명(TTL)
역할별 메모리 제한
MCP 통합
MCP 리소스로서의 역할을 공개합니다.
역할 관리 및 쿼리 처리를 위한 도구를 제공합니다.
역할 기반 상호작용에 대한 프롬프트를 제공합니다.
시작하기
필수 조건
노드.js 18+
OpenAI API 키
설치
지엑스피1
서버 실행
# Run the MCP server
npm start
# Run the HTTP server for testing
npm run start:http구성
src/config.ts 수정하여 서버를 구성할 수 있습니다. 주요 구성 옵션은 다음과 같습니다.
기본 역할 및 해당 속성
사용 가능한 톤 프로필
메모리 관리 설정
OpenAI 모델 선택
MCP 통합
자원
서버는 다음과 같은 리소스를 제공합니다.
role://{roleId}- 특정 역할에 대한 정보role://tones- 사용 가능한 톤 프로필
도구
서버는 다음과 같은 도구를 제공합니다.
process-with-role- 특정 역할을 사용하여 쿼리를 처리합니다.create-role- 새로운 역할 생성update-role- 기존 역할 업데이트delete-role- 사용자 정의 역할 삭제change-role-tone- 역할의 톤을 변경합니다store-memory- 특정 역할에 대한 메모리를 저장합니다.clear-role-memories- 역할에 대한 모든 메모리를 지웁니다.
프롬프트
서버는 다음과 같은 프롬프트를 제공합니다.
role-{roleId}- 특정 역할을 사용하여 요청을 처리합니다.create-custom-role- 새로운 사용자 정의 역할 생성
사용 예
역할이 있는 쿼리 처리(MCP)
// Example of using the process-with-role tool
const result = await client.executeToolRequest({
name: 'process-with-role',
parameters: {
roleId: 'marketing-expert',
query: 'How can I improve my social media engagement?',
customInstructions: 'Focus on B2B strategies'
}
});역할이 있는 쿼리 처리(HTTP API)
// Example of using the HTTP API
const response = await axios.post('http://localhost:3000/process', {
roleId: 'marketing-expert',
query: 'How can I improve my social media engagement?',
customInstructions: 'Focus on B2B strategies'
});
console.log(response.data.response);사용자 정의 역할 생성
// Example of using the create-role tool
const result = await client.executeToolRequest({
name: 'create-role',
parameters: {
id: 'tech-writer',
name: 'Technical Writer',
description: 'Specializes in clear, concise technical documentation',
instructions: 'Create documentation that is accessible to both technical and non-technical audiences',
domains: ['technical-writing', 'documentation', 'tutorials'],
tone: 'technical',
systemPrompt: 'You are an experienced technical writer with expertise in creating clear, concise documentation for complex systems.'
}
});특허
MIT