Skip to main content
Glama
EmjayAhn

Pensieve MCP Server

by EmjayAhn

save_conversation

Save conversation history to enable sharing between ChatGPT and Claude with secure multi-user support. Store messages, metadata, and manage conversations across AI platforms.

Instructions

대화 내역을 저장합니다

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
conversation_idNo대화 ID (없으면 자동 생성)
messagesYes저장할 메시지 목록
metadataNo대화에 대한 추가 메타데이터 (제목, 태그 등)

Implementation Reference

  • The core logic implementation of the save_conversation tool which saves the conversation to a JSON file and cache.
    def save_conversation(conversation_id: str, messages: List[Dict[str, Any]], metadata: Optional[Dict[str, Any]] = None) -> Dict[str, Any]:
        """대화를 파일 시스템에 저장"""
        conversation_data = {
            "id": conversation_id,
            "messages": messages,
            "metadata": metadata or {},
            "created_at": datetime.now().isoformat(),
            "updated_at": datetime.now().isoformat()
        }
        
        # 파일로 저장
        file_path = STORAGE_DIR / f"{conversation_id}.json"
        with open(file_path, 'w', encoding='utf-8') as f:
            json.dump(conversation_data, f, ensure_ascii=False, indent=2)
        
        # 캐시에도 저장
        conversation_cache[conversation_id] = conversation_data
        
        return conversation_data
  • MCP tool registration for save_conversation in the list_tools method.
    Tool(
        name="save_conversation",
        description="대화 내역을 저장합니다",
        inputSchema={
            "type": "object",
            "properties": {
                "conversation_id": {
                    "type": "string",
                    "description": "대화 ID (없으면 자동 생성)"
                },
                "messages": {
                    "type": "array",
                    "description": "저장할 메시지 목록",
                    "items": {
                        "type": "object",
                        "properties": {
                            "role": {"type": "string", "enum": ["user", "assistant", "system"]},

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/EmjayAhn/pensieve-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server