MM

memtensor/memos-api-mcp

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

7 stars 5 forks 质量 73 趋势 19Apache-2.0

A Model Context Protocol (MCP) implementation for the Memos API service. This package provides a command-line interface to interact with Memos API using MCP standards.

概览

A Model Context Protocol (MCP) implementation for the MemOS API service. This package provides a command-line interface to interact with MemOS API using MCP standards. To use this package In MCP Client, use the following configuration: (You may need to install Node.js first) - command: Uses npx to run the package - args: Arguments passed to npx to run the package - env: Environment variables - MEMOS_API_KEY: Your Memos API key for authentication (Get your API Key in Dashboard[https://memos-dashboard.openmem.net/cn/apikeys/]) - MEMOS_USER_ID: Stable per-human identifier. MUST be deterministic and non-PII, and MUST remain the same for the same person across devices/sessions. NEVER reuse across different people. DO NOT use random values, device IDs, or model/chat session IDs. Recommended: SHA-256(lowercase(trim(email))) or your SSO subject/employee ID. - MEMOS_CHANNEL: The site where you are seeing this document.

README

以下为原文 README 节选,完整内容请查看原文。

MCP Server for MemOS API

A Model Context Protocol (MCP) implementation for the MemOS API service. This package provides a command-line interface to interact with MemOS API using MCP standards.

MCP Configuration

To use this package In MCP Client, use the following configuration: (You may need to install Node.js first)

{
  "mcpServers": {
    "memos-api-mcp": {
      "command": "npx",
      "args": ["-y", "@memtensor/memos-api-mcp"],
      "env": {
        "MEMOS_API_KEY": "your-api-key",
        "MEMOS_USER_ID": "your-user-id",
        "MEMOS_CHANNEL": "the-site-where-you-are-seeing-this-document"
      }
    }
  }
}

Configuration Explanation

  • command: Uses npx to run the package
  • args: Arguments passed to npx to run the package
  • env: Environment variables
    • MEMOS_API_KEY: Your Memos API key for authentication (Get your API Key in Dashboard[https://memos-dashboard.openmem.net/cn/apikeys/])
    • MEMOS_USER_ID: Stable per-human identifier. MUST be deterministic and non-PII, and MUST remain the same for the same person across devices/sessions. NEVER reuse across different people. DO NOT use random values, device IDs, or model/chat session IDs. Recommended: SHA-256(lowercase(trim(email))) or your SSO subject/employee ID.
    • MEMOS_CHANNEL: The site where you are seeing this document. Candidate values: MODELSCOPE, MCPSO, MCPMARKETCN, MCPMARKETCOM, GLAMA, PULSEMCP, MCPSERVERS,LOBEHUB,MEMOS(meaning the MemOS official website), GITHUB(meaning this README file)

Available MCP Tools

This package provides the following MCP tools:

  1. add_message

    • Adds a new message to a conversation
    • Parameters:
      • conversation_id: Unique identifier of the conversation associated with the feedback.
      • messages: Array of messages containing role and content information.
        • role: Role of the message sender (user or assistant).
        • content: Message content.
        • chat_time: (Optional) Message timestamp.
  2. search_memory

    • Searches for memories in a conversation.
    • Parameters:
      • query: Text content to search within the memories. The token limit for a single query is 4k.
      • filter: (Optional) Filter conditions, used to precisely limit the memory scope before retrieval.
      • knowledgebase_ids: (Optional) Array specifying the knowledge bases to search.
        • DO NOT USE THIS unless the user explicitly mentions “knowledge base” or “KB”.
          1. If the user explicitly asks to search ALL knowledge bases -> pass ["all"].
          1. If the user specifies particular KB IDs -> pass those IDs.
          1. If the user DOES NOT mention knowledge bases -> OMIT this parameter (do not send it).
      • include_preference: (Optional) Enable preference memory recall. Default: true.
      • preference_limit_number: (Optional) Max preference memories to return. Default: 9, max 25.
在 GitHub 查看完整 README

安装

npx -y @memtensor/memos-api-mcp
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "memos-api-mcp": { "command": "npx", "args": ["-y", "@memtensor/memos-api-mcp"], "env": { "MEMOS_API_KEY": "your-api-key", "MEMOS_USER_ID": "your-user-id", "MEMOS_CHANNEL": "the-site-where-you-are-seeing-this-document" } } } }