mdMagic MDfull context preserved
Home
[ plugin directory ]

Plugins

这里集中展示所有内置插件,直接查看能力、动作和使用示例。

total
55
selected
ai-agent
runtime
Sidecar-backed
🤖
[ selected plugin ]

ai-agent

通用 AI 对话代理 — 支持 DeepSeek / OpenAI / Moonshot / MiniMax / GLM 等多供应商

Sidecar-backedaiai
功能概述

在 Magic MD 文档中嵌入完整的 AI Agent 对话。支持多供应商(DeepSeek、OpenAI、Moonshot、MiniMax、GLM 及自定义端点),可通过 mcp-explorer 引用 MCP 工具实现工具调用,支持流式输出、推理过程展示、交互审批、取消与重试。

核心特性
多供应商 LLM 支持(DeepSeek / OpenAI / Moonshot / MiniMax / GLM / 自定义)
通过 $ref{} 引用 mcp-explorer 输出,自动获取 MCP 工具
流式输出 + 推理过程(chain-of-thought)展示
工具调用审批模式(auto / approve-mutations / approve-all)
对话上下文管理(发送 / 取消 / 重试 / 清空)
Token 用量统计与调试日志面板
Actions
ActionLabelDescription
compute发送发送消息给 AI Agent 并获取回复
cancel停止取消当前正在进行的 AI 生成
approve审批审批 Agent 的工具调用请求
respond💬 回复回复 Agent 的用户输入请求
clear🗑️ 清空会话清空当前对话历史并重置会话
使用示例
基本对话

配置 DeepSeek 进行简单对话

example.mdmarkdown
::define[agent]{plugin="ai-agent"}
```config
{
  "provider": {
    "type": "deepseek",
    "model": "deepseek-chat",
    "apiKey": "sk-xxx"
  },
  "systemPrompt": "你是一个有帮助的助手。"
}
```
::

::render[agent]::
带 MCP 工具的 Agent

通过 mcp-explorer 引用 MCP 工具实现 Agent 工具调用

example.mdmarkdown
::define[mcp]{plugin="mcp-explorer"}
```config
{
  "transport": "stdio",
  "command": "npx",
  "args": ["-y", "@modelcontextprotocol/server-everything"]
}
```
::

::define[agent]{plugin="ai-agent"}
```config
{
  "provider": {
    "type": "openai",
    "model": "gpt-4o",
    "apiKey": "sk-xxx"
  },
  "mcpExplorers": [
    { "explorerRef": "$ref{mcp.output}" }
  ],
  "interactionMode": "approve-mutations"
}
```
::

::render[agent]::
渲染
Inline
Supported
Block
Supported