Skip to main content
Glama
Martin MCP Toolbox

Martin MCP Toolbox

by 2234839

Martin MCP工具箱

English README | 中文说明

一个基于 Model Context Protocol (MCP) 的多模态 AI 工具箱,集成了智谱 GLM、Pollinations.AI、思源笔记和 Perplexity 网络搜索四大平台的强大能力。

🎯 为什么选择这个 MCP?

在使用 智谱 GLM 的 Claude Code 套餐时,我发现了一个限制:

  • Lite 版本价格更低,但不支持 图像/视频理解 和 联网搜索;

  • 如果要获得这些能力,就必须升级到 Pro(¥100/月) 或 Max(¥200/月);

  • 但对很多开发者来说,仅仅为了这两个功能升级套餐,成本偏高。

我认为:

  • 如果没有图像/视频理解,大模型就失去了"眼睛";

  • 如果没有联网搜索,大模型就失去了"更新知识的能力";

  • 这让 Lite 版本几乎成了一个"闭门造车"的模型,无法满足日常需求。

于是,我开发了这个 MCP 插件:

  • 即使只用 GLM Lite 套餐,配合这个 MCP,也能为 Claude Code 装上眼睛(图像/视频理解)和 搜索引擎(联网搜索);

  • 让 Lite 用户也能享受"最新知识 + 多模态理解"的体验;

  • 这大大提升了 Lite 套餐的性价比,也是我认为本项目最大的价值。

Related MCP server: SiYuan MCP Server

🚀 功能特性

Bigmodel (智谱 GLM)

  • 🖼️ 图片分析 - 使用 GLM-4.5V 模型进行图像识别和分析

  • 🎬 视频分析 - 支持视频内容分析和理解

  • 🎨 图片生成 - 使用 CogView-4 系列模型生成高质量图片

Pollinations.AI

  • 🖼️ 图片生成 - 支持多种模型和参数配置

  • 📝 文本生成 - 智能文本生成和对话

  • 🔊 音频生成 - 文字转语音,支持多种声音

  • 👁️ 图片分析 - OpenAI 兼容的视觉分析能力

思源笔记 (SiYuan)

  • 📚 块级内容获取 - 获取思源笔记块的 Kramdown 源码

  • 🔍 全文搜索 - 支持复杂查询语法的笔记搜索

  • ✏️ 内容更新 - 直接更新思源笔记块内容

网络搜索

  • 🔍 基础搜索 - 快速检索并返回原始搜索结果

  • 🧠 智能搜索 - 使用 Sonar 模型生成答案并提供引用

  • 🛡️ 安全过滤 - 内置安全机制防止恶意内容

  • ⚡ 缓存加速 - 智能缓存提高重复查询响应速度

通用特性

  • 🔧 灵活的环境变量配置

  • 📝 完整的日志记录系统

  • 🚀 轻量级,易于集成和部署

  • 🛡️ TypeScript 类型安全

📦 安装

pnpm install

⚙️ 配置

API Key 设置

智谱 GLM API Key

访问 智谱AI开放平台 获取 API Key:

export GLM_API_KEY=your_glm_api_key_here

Perplexity API Key (网络搜索工具必需)

访问 Perplexity AI 获取 API Key:

export PERPLEXITY_API_KEY=your_perplexity_api_key_here

模型配置(可选)

# GLM 模型配置
GLM_IMAGE_MODEL=glm-4.5v
GLM_VIDEO_MODEL=glm-4.5v
GLM_GENERATION_MODEL=cogview-3-flash

# 思源笔记配置(可选)
SIYUAN_API_TOKEN=your_siyuan_token
SIYUAN_API_BASE=http://127.0.0.1:6806

# 网络搜索配置(可选)
WEB_SEARCH_CACHE_TTL=30
WEB_SEARCH_RATE_LIMIT=5
WEB_SEARCH_RATE_WINDOW_MS=60000
WEB_SEARCH_RETRY_AFTER_MS=1000
WEB_SEARCH_TIMEOUT_MS=10000

环境变量优先级

  1. 系统环境变量(推荐)

  2. 执行目录下的 .env 文件

  3. 项目根目录下的 .env 文件

🛠️ 使用方法

开发模式

pnpm dev

注意: 开发模式使用 node --loader ts-node/esm 运行,确保 ES 模块导入正常工作。

构建

pnpm build

运行

pnpm start

作为 MCP 工具使用

./build/index.js

📚 工具参考

Bigmodel 工具

read_image - 图片分析

参数:

  • image_path (string): 图片文件路径

  • prompt (string): 分析提示文本

  • temperature (number, 可选): 采样温度 (0.0-1.0)

  • top_p (number, 可选): 采样参数 (0.0-1.0)

  • max_tokens (number, 可选): 最大输出令牌数

示例:

{
  "image_path": "/path/to/image.jpg",
  "prompt": "请详细描述这张图片的内容"
}

analyze_video - 视频分析

参数:

  • video_url (string): 视频文件 URL

  • prompt (string): 分析提示文本

  • temperature (number, 可选): 采样温度 (0.0-1.0)

  • top_p (number, 可选): 采样参数 (0.0-1.0)

  • max_tokens (number, 可选): 最大输出令牌数

示例:

{
  "video_url": "https://example.com/video.mp4",
  "prompt": "分析这个视频的主要内容"
}

generate_image - 图片生成

参数:

  • prompt (string): 图片描述文本

  • quality (string, 可选): 图片质量 (hd/standard)

  • size (string, 可选): 图片尺寸

  • save_path (string, 可选): 图片保存路径

示例:

{
  "prompt": "一只可爱的小猫咪,卡通风格",
  "quality": "standard",
  "size": "1024x1024",
  "save_path": "./cat.png"
}

Pollinations.AI 工具

pollinations_generate_image - 图片生成

参数:

  • prompt (string): 图片描述文本

  • model (string, 可选): 生成模型 (默认: flux)

  • width (number, 可选): 图片宽度 (64-2048)

  • height (number, 可选): 图片高度 (64-2048)

  • seed (number, 可选): 随机种子

  • nologo (boolean, 可选): 禁用 logo

  • private (boolean, 可选): 私有生成

  • enhance (boolean, 可选): 增强提示词

  • safe (boolean, 可选): 安全过滤

  • transparent (boolean, 可选): 透明背景

示例:

{
  "prompt": "A beautiful landscape with mountains",
  "model": "flux",
  "width": 1024,
  "height": 768
}

pollinations_generate_text - 文本生成

参数:

  • prompt (string): 文本提示

  • model (string, 可选): 生成模型 (默认: openai)

  • temperature (number, 可选): 随机性 (0.0-3.0)

  • top_p (number, 可选): 核心采样 (0.0-1.0)

  • json (boolean, 可选): JSON 格式输出

  • system (string, 可选): 系统提示词

  • stream (boolean, 可选): 流式输出

示例:

{
  "prompt": "写一首关于春天的诗",
  "model": "openai",
  "temperature": 0.8
}

pollinations_generate_audio - 音频生成

参数:

  • prompt (string): 要转换的文本

  • voice (string, 可选): 声音选择 (alloy/echo/fable/onyx/nova/shimmer)

  • model (string, 可选): 音频模型 (默认: openai-audio)

示例:

{
  "prompt": "你好,欢迎使用我们的服务!",
  "voice": "nova"
}

pollinations_analyze_image - 图片分析

参数:

  • image_path (string, 可选): 本地图片路径

  • image_url (string, 可选): 图片 URL

  • prompt (string): 分析提示文本

  • model (string, 可选): 分析模型 (默认: openai)

  • max_tokens (number, 可选): 最大输出令牌数

示例:

{
  "image_path": "/path/to/image.jpg",
  "prompt": "What's in this image?",
  "model": "openai"
}

网络搜索工具

参数:

  • q (string): 搜索查询文本

  • top_k (number, 可选): 返回结果数量 (1-20, 默认: 10)

  • time_range (string, 可选): 时间范围 (any/day/week/month/year, 默认: any)

  • site (string, 可选): 限制搜索站点

  • lang (string, 可选): 搜索语言 (默认: zh)

  • region (string, 可选): 搜索区域 (默认: CN)

  • safe_mode (boolean, 可选): 安全搜索模式 (默认: true)

  • include_snippets (boolean, 可选): 包含摘要片段 (默认: true)

示例:

{
  "q": "人工智能最新发展",
  "top_k": 5,
  "time_range": "month",
  "lang": "zh",
  "region": "CN"
}

参数:

  • q (string): 搜索查询文本

  • top_k (number, 可选): 返回结果数量 (1-20, 默认: 10)

  • time_range (string, 可选): 时间范围 (any/day/week/month/year, 默认: any)

  • site (string, 可选): 限制搜索站点

  • lang (string, 可选): 搜索语言 (默认: zh)

  • region (string, 可选): 搜索区域 (默认: CN)

  • safe_mode (boolean, 可选): 安全搜索模式 (默认: true)

  • include_snippets (boolean, 可选): 包含摘要片段 (默认: true)

  • operators (array, 可选): 搜索操作符 (OR/AND)

  • exclude_sites (array, 可选): 排除站点列表

  • from (string, 可选): 起始日期 (YYYY-MM-DD)

  • to (string, 可选): 结束日期 (YYYY-MM-DD)

  • dedupe (string, 可选): 去重策略 (none/domain/title, 默认: none)

  • aggregate (boolean, 可选): 聚合相似结果

  • engine (string, 可选): 搜索引擎 (raw_search/sonar_answer)

  • sonar_model (string, 可选): Sonar模型 (sonar/sonar-pro/sonar-reasoning/sonar-reasoning-pro/sonar-deep-research)

示例:

{
  "q": "机器学习研究论文",
  "top_k": 10,
  "time_range": "year",
  "exclude_sites": ["example.com", "spam.com"],
  "from": "2023-01-01",
  "to": "2023-12-31",
  "dedupe": "domain",
  "engine": "sonar_answer",
  "sonar_model": "sonar-reasoning-pro"
}

思源笔记工具

get_block_kramdown - 获取块级内容

参数:

  • block_id (string|array): 单个块ID或块ID数组

示例:

{
  "block_id": "20240825123456-1a2b3c4d"
}

多块获取示例:

{
  "block_id": ["20240825123456-1a2b3c4d", "20240825123456-5e6f7g8h"]
}

update_block - 更新块内容

参数:

  • block_id (string): 要更新的块ID

  • data (string): 新的Kramdown内容数据

  • data_type (string, 可选): 数据类型 (markdown/dom,默认: markdown)

示例:

{
  "block_id": "20240825123456-1a2b3c4d",
  "data": "# 新标题\n\n更新后的内容",
  "data_type": "markdown"
}

siyuan_search_blocks - 全文搜索

参数:

  • query (string): 搜索查询文本,支持完整全文查询语法

  • paths (array, 可选): 指定搜索路径

  • page (number, 可选): 分页页码

搜索语法示例:

{
  "query": "机器学习 OR 深度学习",
  "paths": ["/笔记/技术/"],
  "page": 1
}

高级查询示例:

{
  "query": "NEAR(人工智能 算法, 10) -广告",
  "page": 1
}

支持的查询操作符:

  • OR - 逻辑或:包含任一即可

  • NEAR(词1 词2, N) - 邻近搜索:距离在N词内

  • AND - 逻辑与:必须同时包含

  • ^词 - 权重提升:提高重要性

  • -词 - 排除:明确排除

  • (查询) - 分组:组合逻辑

siyuan_database_query - 数据库查询

参数:

  • stmt (string): SQL 查询语句,例如: SELECT * FROM blocks WHERE type = 'av' LIMIT 10

  • limit (number, 可选): 限制返回结果的数量

  • offset (number, 可选): 偏移量,用于分页查询

示例:

{
  "stmt": "SELECT * FROM blocks WHERE type = 'av'",
  "limit": 10
}

高级查询示例:

{
  "stmt": "SELECT b.id, b.content, a.name, a.value FROM blocks b JOIN attributes a ON b.id = a.block_id WHERE b.parent_id = '数据库块ID'",
  "limit": 20,
  "offset": 0
}

siyuan_query_sql - SQL查询

参数:

  • stmt (string): SQL 查询语句,例如: SELECT * FROM blocks WHERE content LIKE '%content%' LIMIT 7

示例:

{
  "stmt": "SELECT * FROM blocks WHERE type = 'd' LIMIT 5"
}

高级查询示例:

{
  "stmt": "SELECT distinct B.* from blocks as B join attributes as A on B.id = A.block_id where A.name like 'custom-dailynote-%' and B.type='d' and A.value >= '20231010' and A.value <= '20231013' order by A.value desc"
}

📝 日志系统

项目包含完整的日志记录系统,所有工具调用都会记录到项目根目录的 mcpserver.log 文件中:

  • INFO: 工具调用和成功操作

  • ERROR: 错误和异常信息

  • DEBUG: 详细调试信息

  • WARN: 警告信息

🔍 项目结构

src/
├── config/
│   ├── index.ts              # GLM 配置和默认参数
│   └── pollinations.ts       # Pollinations.AI 配置
├── tools/
│   ├── bigmodel/             # 智谱 GLM 工具
│   │   ├── image-analysis.ts     # 图片分析工具
│   │   ├── video-analysis.ts     # 视频分析工具
│   │   └── image-generation.ts   # 图片生成工具
│   ├── pollinations/         # Pollinations.AI 工具
│   │   ├── image-generation.ts   # 图片生成工具
│   │   ├── text-generation.ts    # 文本生成工具
│   │   ├── audio-generation.ts   # 音频生成工具
│   │   └── image-analysis.ts     # 图片分析工具
│   ├── siyuan/              # 思源笔记工具
│   │   ├── block-kramdown.ts     # 块级 Kramdown 获取工具
│   │   ├── database-query.ts     # 数据库查询工具
│   │   ├── sql-query.ts          # SQL 查询工具
│   │   ├── search.ts             # 全文搜索工具
│   │   ├── client.ts             # 思源 API 客户端
│   │   └── index.ts              # 思源工具索引
│   └── web-search/           # 网络搜索工具
│       ├── web-search.ts         # 网络搜索工具实现
│       ├── advanced-web-search.ts # 高级网络搜索工具实现
│       ├── client.ts             # Perplexity API 客户端
│       ├── sonar-client.ts       # Sonar 模型客户端
│       ├── cache.ts              # 缓存实现
│       ├── rate-limiter.ts       # 限速器实现
│       ├── security.ts           # 安全工具
│       ├── errors.ts             # 错误处理
│       └── types.ts              # 类型定义
├── utils/
│   ├── helpers.ts           # 通用助手函数
│   ├── common.ts            # 响应格式化函数
│   └── logger.ts            # 日志系统
└── index.ts                 # 主服务器入口,工具注册

📄 许可证

ISC

🤝 贡献

欢迎提交 Issue 和 Pull Request!

📞 支持

如有问题,请创建 Issue 或联系维护者。

🙏 致谢

本项目 fork 自 2234839 崮生 的项目,在此基础上进行了功能增强和扩展,已向原项目提交了 feature PR。

感谢原作者的杰出工作!🎉

Available Tools

14 tools
analyze_videoC

Analyze a video using GLM-4.5V model

Inputs: prompt (required), video_url (required), top_p, max_tokens, +1 more.

generate_imageC

Generate an image from text prompt using CogView-4 model

Inputs: prompt (required), size, quality, save_path.

get_block_kramdownA

Get kramdown source code of one or multiple SiYuan note blocks

Inputs: block_id (required).

pollinations_analyze_imageC

Analyze an image using Pollinations.AI Vision API

Inputs: prompt (required), model, image_url, image_path, +1 more.

pollinations_generate_audioA

Generate speech audio from text using Pollinations.AI API

Inputs: prompt (required), model, voice.

pollinations_generate_imageC

Generate an image using Pollinations.AI API

Inputs: prompt (required), safe, seed, model, +6 more.

pollinations_generate_textC

Generate text using Pollinations.AI API

Inputs: prompt (required), json, seed, model, +7 more.

read_imageC

Analyze an image using GLM-4.5V model

Inputs: prompt (required), image_path (required), top_p, max_tokens, +1 more.

siyuan_database_queryA

思源数据库查询工具 - 执行 SQLite 查询语句来查询思源笔记的数据库(树形视图/属性视图)

功能说明

此工具允许您查询思源笔记中的数据库(也称为树形视图或属性视图)。您可以使用标准的 SQLite 语法来查询数据库中的数据。

支持的表

  • blocks: 内容块表

  • attributes: 属性表

  • refs: 引用表

数据库表结构

blocks 表

  • id: 内容块 ID

  • parent_id: 父块 ID

  • root_id: 文档块 ID

  • box: 笔记本 ID

  • path: 内容块路径

  • hpath: 人类可读路径

  • name: 内容块名称

  • alias: 别名

  • memo: 备注

  • tag: 标签

  • content: 内容文本

  • fcontent: 第一个子块内容

  • markdown: Markdown 格式内容

  • length: 内容长度

  • type: 块类型 (d:文档, h:标题, p:段落, l:列表, t:表格, b:引述, s:超级块, c:代码块, m:数学公式, av:数据库)

  • subtype: 子类型

  • ial: 内联属性列表

  • sort: 排序权重

  • created: 创建时间

  • updated: 更新时间

attributes 表

  • id: 属性 ID

  • name: 属性名称 (自定义属性需加 custom- 前缀)

  • value: 属性值

  • type: 类型

  • block_id: 块 ID

  • root_id: 文档 ID

  • box: 笔记本 ID

  • path: 文档路径

refs 表

  • id: 引用 ID

  • def_block_id: 被引用块 ID

  • def_block_root_id: 被引用块文档 ID

  • def_block_path: 被引用块路径

  • block_id: 引用块 ID

  • root_id: 引用块文档 ID

  • box: 笔记本 ID

  • path: 引用块路径

  • content: 引用锚文本

使用示例

  1. 查询所有数据库块: SELECT * FROM blocks WHERE type = 'av' LIMIT 10

  2. 查询特定数据库中的记录: SELECT * FROM blocks WHERE parent_id = '数据库块ID' LIMIT 20

  3. 查询具有特定属性的块: SELECT * FROM attributes WHERE name = 'custom-status' AND value = '完成'

  4. 查询数据库中的记录及其属性: SELECT b.id, b.content, a.name, a.value FROM blocks b JOIN attributes a ON b.id = a.block_id WHERE b.parent_id = '数据库块ID' LIMIT 10

安全注意事项

  • 只允许执行 SELECT 查询语句

  • 禁止执行修改数据的语句 (INSERT, UPDATE, DELETE, DROP等)

  • 查询结果会自动限制返回的行数以防止过大响应

Inputs: stmt (required), limit, offset.

siyuan_query_sqlA

思源 SQL 查询工具 - 执行 SQLite 查询语句

你是思源小助手,你需要根据用户需求,编写符合思源笔记数据库结构的 SQL 查询语句。在必要时,解释查询结果的含义和用途。

要求 SQL 语法规范:

在默认的情况下,用户可以在思源的嵌入块中输入 SQL 代码查询,此时 SQL 查询语句必须以 select * from blocks 开头:只允许查询 block 表,且不允许单独查询字段 面向开发者的高级用法:用户还可以调用后端 API 接口,发送 SQL 查询,此时是可以使用更普遍的 SQL 语法结构的(查询别的表,返回特定字段) 使用 SQLite 的语法,如 strftime 函数处理时间。 默认情况下,查询结果最多返回 64 个块,除非明确指定了 limit xxx 输出:将查询语句放在一个 ```SQL 的 markdown 代码块当中,方便用户直接复制

表结构 blocks 表:

id: 内容块 ID,格式为 时间-随机字符,例如 20210104091228-d0rzbmm。

parent_id: 双亲块 ID,格式同 id

root_id: 文档块 ID,格式同 id

box: 笔记本 ID,格式同 id

path: 内容块所在文档路径,例如 /20200812220555-lj3enxa/20210808180320-abz7w6k/20200825162036-4dx365o.sy

hpath: 人类可读的内容块所在文档路径,例如 /0 请从这里开始/编辑器/排版元素

name: 内容块名称

alias: 内容块别名

memo: 内容块备注

tag: 标签,例如 #标签1 #标签2# #标签3#

content: 去除了 Markdown 标记符的文本

fcontent: 存储容器块第一个子块的内容

markdown: 包含完整 Markdown 标记符的文本

length: markdown 字段文本长度

type: 内容块类型

d: 文档, h: 标题, m: 数学公式, c: 代码块, t: 表格块, l: 列表块, b: 引述块, s: 超级块,p:段落块,av:树形视图(俗称数据库,注意区分,这只是一个内容块的叫法) subtype: 特定类型的内容块还存在子类型

标题块的 h1 到 h6 列表块的 u (无序), t (任务), o (有序) ial: 内联属性列表,形如 {: name="value"},例如 {: id="20210104091228-d0rzbmm" updated="20210604222535"}

sort: 排序权重,数值越小排序越靠前

created: 创建时间,格式为 YYYYMMDDHHmmss,例如 20210104091228

updated: 更新时间,格式同 created

refs 表:

id: 引用 ID,格式为 时间-随机字符,例如 20211127144458-idb32wk def_block_id: 被引用块的块 ID,格式同 id def_block_root_id: 被引用块所在文档的 ID,格式同 id def_block_path: 被引用块所在文档的路径,例如 /20200812220555-lj3enxa/20210808180320-fqgskfj/20200905090211-2vixtlf.sy block_id: 引用所在内容块 ID,格式同 id root_id: 引用所在文档块 ID,格式同 id box: 引用所在笔记本 ID,格式同 id path: 引用所在文档块路径,例如 /20200812220555-lj3enxa/20210808180320-fqgskfj/20200905090211-2vixtlf.sy content: 引用锚文本 attributes 表:

id: 属性 ID,格式为 时间-随机字符,例如 20211127144458-h7y55zu

name: 属性名称

注意:思源中的用户自定义属性必须加上 custom- 前缀 例如 name 是块的内置属性,但 custom-name 就是用户的自定义属性了 value: 属性值

type: 类型,例如 b

block_id: 块 ID,格式同 id

root_id: 文档 ID,格式同 id

box: 笔记本 ID,格式同 id

path: 文档文件路径,例如 /20200812220555-lj3enxa.sy。

查询要点提示 所有 SQL 查询语句如果没有明确指定 limit,则会被思源查询引擎默认设置 limit 64

块属性格式相关

块 ID 格式统一为 时间-随机字符, 例如 20210104091228-d0rzbmm 块的时间属性,如 created updated 的格式为 YYYYMMDDHHmmss 例如 20210104091228 块之间的关系

层级关系:块大致可以分为

内容块(叶子块):仅包含内容的块,例如段落 p,公式块 m,代码块 c,标题块 h,表格块 t 等

内容块的 content 和 markdown 字段为块的内容 容器块:包含其他内容块或者容器块的块,例如 列表块 l,列表项块 i,引述块/引用块 b,超级块 s

每个块的 parent_id 指向他直接上层的容器块 容器块的 content 和 markdown 字段为容器内所有块的内容 文档块:包含同一文档中所有内容块和容器块的块,d

每个块的 root_id 指向他所在的文档 容器块的 content 字段为文档的标题 引用关系:当一个块引用了另一个块的时候,会在 refs 表中建立联系

如果有多个块引用了同一个块,那么对这个被引用的块而言,这些引用它的块构成了它的反向链接(反链) 所有引用关系被存放在 ref 表当中;使用的时候将 blocks 表和 ref 表搭配进行查询 Daily Note:又称日记,每日笔记,是一种特殊的文档块

daily note 文档有特殊属性:custom-dailynote-=;被标识了这个属性的文档块(type='d'),会被视为是对应日期的 daily note 文档 例如 custom-dailynote-20240101=20240101 的文档,被视为 2024-01-01 这天的 daily note 文档 请注意! daily note (日记)是一个文档块!如果要查询日记内部的内容,请使用 root_id 字段来关联日记文档和内部的块的关系 书签:含有属性 bookmark=<书签名> 的块会被加入对应的书签

SQL 示例 查询所有文档块

select * from blocks where type='d' ​ 查询所有二级标题块

select * from blocks where subtype = 'h2' ​ 查询某个文档的子文裆

select * from blocks where path like '%/<当前文档id>/%' and type='d' ​ 随机漫游某个文档内所有标题块

SELECT * FROM blocks WHERE root_id LIKE '<文档 id>' AND type = 'h' ORDER BY random() LIMIT 1 ​ 查询含有关键词「唯物主义」的段落块

select * from blocks where markdown like '%唯物主义%' and type ='p' ORDER BY updated desc ​ 查询过去 7 天内没有完成的任务(任务列表项)

注:思源中,任务列表项的 markdown 为 * [ ] Task text 如果是已经完成的任务,则是 * [x] Task Text

SELECT * from blocks WHERE type = 'l' AND subtype = 't' AND created > strftime('%Y%m%d%H%M%S', datetime('now', '-7 day')) AND markdown like'* [ ] %' AND parent_id not in ( select id from blocks where subtype = 't' ) ​ 查询某个块所有的反链块(引用了这个块的所有块)

select * from blocks where id in ( select block_id from refs where def_block_id = '<被引用的块ID>' ) limit 999 ​ 查询某个时间段内的 daily note(日记)

注意由于没有指定 limit,最大只能查询 64 个

select distinct B.* from blocks as B join attributes as A on B.id = A.block_id where A.name like 'custom-dailynote-%' and B.type='d' and A.value >= '20231010' and A.value <= '20231013' order by A.value desc; ​ 查询某个笔记本下没有被引用过的文档,限制 128 个

select * from blocks as B where B.type='d' and box='<笔记本 BoxID>' and B.id not in ( select distinct R.def_block_id from refs as R ) order by updated desc limit 128

Inputs: stmt (required).

siyuan_search_blocksB

Search for blocks in SiYuan notes using full-text search

Inputs: query (required), page, paths.

update_blockB

Update a SiYuan note block with new content while preserving IAL metadata

Inputs: data (required), block_id (required), preserve_id, preserve_ial.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3/5.0

    Scored across 14 tools

    Disambiguation2/5

    Several tools have overlapping purposes: siyuan_query_sql and siyuan_database_query both execute SQLite queries on the same tables, read_image and pollinations_analyze_image both analyze images, generate_image and pollinations_generate_image both generate images, and web_search/advanced_web_search are near-duplicates. This causes confusion about which tool an agent should select for a given task.

    Naming Consistency3/5

    Naming is mixed: some tools follow verb_noun (read_image, update_block) while others use noun_verb (web_search, siyuan_database_query). Prefixes like siyuan_ and pollinations_ are inconsistent, and 'advanced_web_search' does not follow the verb-first pattern of its counterpart.

    Tool Count4/5

    14 tools is within the reasonable range, but the server spans multiple unrelated domains (SiYuan notes, media AI, web search). The count is not excessive, though it feels like a collection of utilities rather than a focused toolset.

    Completeness3/5

    For SiYuan notes, query, search, get, and update are covered but create/delete operations are missing. The media tools cover image generation/analysis and video analysis but lack video generation or audio analysis. Web search is adequately covered.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      Not graded
      maintenance
      An MCP server for SiYuan Note that enables comprehensive management of notebooks, documents, and blocks through AI integration. It supports advanced operations like SQL querying, OCR, multi-format exports, and automated content searching for intelligent knowledge management.
      16 npm
      5
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      A Model Context Protocol server that enables AI assistants like Claude and Cursor to interact seamlessly with SiYuan Note through 15 specialized tools. It supports comprehensive note operations including unified search, document management, daily notes, and tag manipulation.
      Apache 2.0
    • A
      license
      Not graded
      quality
      D
      maintenance
      MCP server for SiYuan Note, enabling AI integration and smart knowledge management with note, block, search, template, export, asset, SQL, and file operations.
      MIT