Memos MCP Server

Memos MCP Server

MCP server for creating, listing, updating, deleting memos, and managing attachments via the Memos API.

Category
访问服务器

README

Memos MCP Server

A Model Context Protocol (MCP) server for interacting with Memos API.

Features

  • Create Memos: Create new memos with Markdown content
  • List Memos: List memos with pagination, sorting, and CEL filter support
  • Get Memo: Retrieve a specific memo by ID
  • Update Memo: Update existing memo content and metadata
  • Delete Memo: Delete memos
  • Memo Attachments: List and set memo attachments
  • Attachment Service: Create, list, get, update, and delete individual attachments

Installation

  1. Clone this repository or download the files

  2. Install dependencies:

npm install
  1. Build the project:
npm run build
  1. Set up environment variables:
export MEMOS_BASE_URL="https://your-memos-instance.com"
export MEMOS_API_KEY="your-api-token"

For Memos API key, go to your Memos instance -> Settings -> API to generate a token.

Configuration

The server uses the following environment variables:

Variable Required Default Description
MEMOS_BASE_URL No https://demo.usememos.com Your Memos instance base URL
MEMOS_API_KEY No (empty) Your Memos API access token

Usage

Running the Server

npm start

Or for development with auto-reload:

npm run dev

MCP Tools

The server provides the following tools:

create_memo

Create a new memo.

Parameters:

  • content (required): The memo content in Markdown format
  • visibility (optional): Visibility level - PRIVATE, PROTECTED, or PUBLIC (default: PRIVATE)
  • state (optional): Memo state - NORMAL or ARCHIVED (default: NORMAL)
  • pinned (optional): Whether to pin the memo (default: false)

Example:

{
  "content": "# My First Memo\n\nThis is a **markdown** memo.",
  "visibility": "PRIVATE",
  "pinned": false
}

list_memos

List memos with pagination, sorting, and CEL filter support.

Parameters:

  • pageSize (optional): Maximum number of memos to return (default: 50, max: 1000)
  • pageToken (optional): Page token from previous response for pagination
  • state (optional): Filter by state - NORMAL or ARCHIVED (default: NORMAL)
  • orderBy (optional): Sort order (default: display_time desc). Supports: pinned, display_time, create_time, update_time, name
  • filter (optional): CEL expression for advanced filtering (e.g., visibility == 'PUBLIC')
  • show_deleted (optional): Include deleted memos (default: false)

Examples:

// Basic list
{
  "pageSize": 50,
  "state": "NORMAL"
}

// With CEL filter
{
  "filter": "visibility == 'PUBLIC' && content.contains('meeting')",
  "orderBy": "pinned desc, display_time desc"
}

// Pagination
{
  "pageSize": 50,
  "pageToken": "eyJwYWdlU2l6ZSI6IDUwfQ=="
}

get_memo

Get a specific memo by ID.

Parameters:

  • memoId (required): The memo ID (e.g., 123 or memos/123)

update_memo

Update an existing memo.

Parameters:

  • memoId (required): The memo ID to update
  • content (optional): New content for the memo
  • visibility (optional): New visibility setting
  • state (optional): New state setting
  • pinned (optional): New pinned state

delete_memo

Delete a memo.

Parameters:

  • memoId (required): The memo ID to delete

list_memo_attachments

List all attachments for a specific memo.

Parameters:

  • memoId (required): The memo ID (e.g., 123 or memos/123)
  • pageSize (optional): Maximum number of attachments to return (default: 50, max: 1000)
  • pageToken (optional): Page token for pagination

Example:

{
  "memoId": "123",
  "pageSize": 100
}

set_memo_attachments

Set attachments for a memo (replaces all existing attachments).

Parameters:

  • memoId (required): The memo ID
  • attachments (required): List of attachment objects (use camelCase for attachment fields)
    • filename (required): The filename
    • type (required): MIME type (e.g., image/png, application/pdf)
    • content (optional): Base64 encoded file content
    • externalLink (optional): External URL (camelCase)

Note: Use content OR externalLink, not both. Do NOT include size or createTime (these are server-generated).

Important: Attachment fields must use camelCase (externalLink, not external_link) as they match the API specification.

Example:

{
  "memoId": "123",
  "attachments": [
    {
      "filename": "document.pdf",
      "type": "application/pdf",
      "externalLink": "https://example.com/doc.pdf"
    },
    {
      "filename": "small-image.png",
      "type": "image/png",
      "content": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg=="
    }
  ]
}

create_attachment

Create a new attachment (can be linked to memos later).

Parameters:

  • filename (required): The filename
  • type (required): MIME type (e.g., image/png, application/pdf)
  • attachment_id (optional): Custom attachment ID
  • external_link (optional): External URL
  • memo (optional): Related memo resource name (format: memos/{memo})

Example:

{
  "filename": "document.pdf",
  "type": "application/pdf",
  "external_link": "https://example.com/doc.pdf",
  "memo": "memos/123"
}

get_attachment

Get a specific attachment by ID.

Parameters:

  • attachment_id (required): The attachment ID (e.g., 123 or attachments/123)

list_attachments

List all attachments with pagination, filtering, and sorting.

Parameters:

  • page_size (optional): Maximum number of attachments to return (default: 50, max: 1000)
  • page_token (optional): Page token for pagination
  • filter (optional): CEL expression for filtering
  • order_by (optional): Sort order (e.g., create_time desc, filename asc)

Examples:

// Basic list
{
  "page_size": 100
}

// With CEL filter
{
  "filter": "mime_type==\"image/png\"",
  "orderBy": "create_time desc"
}

// Filter by memo
{
  "filter": "memo==\"memos/123\""
}

update_attachment

Update an existing attachment.

Parameters:

  • attachment_id (required): The attachment ID to update
  • update_mask (required): Comma-separated list of fields to update (e.g., filename,type,externalLink)
  • filename (optional): New filename
  • type (optional): New MIME type
  • external_link (optional): New external URL
  • memo (optional): New related memo resource name

Example:

{
  "attachmentId": "123"",
  "update_mask": "filename,externalLink",
  "filename": "updated-name.pdf",
  "external_link": "https://example.com/new-url.pdf"
}

delete_attachment

Delete an attachment by ID.

Parameters:

  • attachment_id (required): The attachment ID to delete

MCP Resources

The server provides the following resources:

  • memos://memos: All memos from your Memos instance
  • memos://config: Current server configuration

Claude Desktop Integration

To use this server with Claude Desktop, add it to your Claude Desktop config file:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "memos": {
      "command": "node",
      "args": ["/path/to/memos-mcp/dist/index.js"],
      "env": {
        "MEMOS_BASE_URL": "https://your-memos-instance.com",
        "MEMOS_API_KEY": "your-api-token"
      }
    }
  }
}

Development

Project Structure

memos-mcp/
├── package.json           # Node.js project configuration
├── tsconfig.json          # TypeScript configuration
├── src/
│   ├── index.ts           # Entry point
│   ├── server.ts          # MCP server definition
│   ├── memos-client.ts    # Memos API client
│   ├── types.ts           # TypeScript type definitions
│   └── tools/
│       ├── memo-tools.ts      # Memo-related tools
│       └── attachment-tools.ts # Attachment-related tools
└── dist/                  # Compiled JavaScript output

License

MIT License

References

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选
mcp-server-qdrant

mcp-server-qdrant

这个仓库展示了如何为向量搜索引擎 Qdrant 创建一个 MCP (Managed Control Plane) 服务器的示例。

官方
精选
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选