### Install Wenyan MCP Source: https://github.com/caol64/wenyan-mcp/blob/main/README.md Install the Wenyan MCP package globally using npm. ```bash npm install -g @wenyan-md/mcp ``` -------------------------------- ### Claude Desktop MCP Server Configuration Source: https://github.com/caol64/wenyan-mcp/blob/main/_autodocs/errors.md Provides an example of how to configure Wenyan MCP servers within Claude Desktop settings, including the command and arguments for specifying the server URL and API key. ```json { "mcpServers": { "wenyan-mcp": { "command": "wenyan-mcp", "args": ["--server", "https://your-server.com", "--api-key", "your-key"] } } } ``` -------------------------------- ### Wenyan MCP Theme List Response Source: https://github.com/caol64/wenyan-mcp/blob/main/_autodocs/quick-reference.md Example response for listing available themes, showing theme IDs, names, and descriptions. ```json { "content": [ { "type": "text", "text": "{\"id\":\"default\",\"name\":\"Default\",\"description\":\"...\"}" }, { "type": "text", "text": "{\"id\":\"orangeheart\",\"name\":\"OrangeHeart\",\"description\":\"...\"}" } ] } ``` -------------------------------- ### Main Stdio Function Signature Source: https://github.com/caol64/wenyan-mcp/blob/main/_autodocs/module-exports.md Signature for the function that starts the MCP server in stdio mode. ```typescript async function mainStdio(): Promise ``` -------------------------------- ### Docker Mode Configuration Source: https://github.com/caol64/wenyan-mcp/blob/main/_autodocs/configuration.md This configuration uses Docker to run the Claude Desktop instance. Ensure Docker is installed and the image is downloaded. ```json { "mcpServers": { "wenyan-mcp": { "command": "docker", "args": [ "run", "--rm", "-i", "-v", "/Users/yourname/Documents:/mnt/host-downloads", "-e", "WECHAT_APP_ID=wxabcd1234efgh5678", "-e", "WECHAT_APP_SECRET=abcd1234efgh5678abcd1234efgh5678", "-e", "HOST_FILE_PATH=/Users/yourname/Documents", "caol64/wenyan-mcp:latest" ] } } } ``` -------------------------------- ### Markdown Frontmatter Example Source: https://github.com/caol64/wenyan-mcp/blob/main/README.md Example of frontmatter required at the top of Markdown files for proper article uploading. The 'cover' field supports local paths or network URLs. ```markdown --- title: 在本地跑一个大语言模型(2) - 给模型提供外部知识库 cover: /Users/xxx/image.jpg author: xxx source_url: http:// --- ``` -------------------------------- ### Local Mode Configuration Source: https://github.com/caol64/wenyan-mcp/blob/main/_autodocs/configuration.md Use this configuration for initial setup and local development. It requires the WeChat App ID and Secret. ```json { "mcpServers": { "wenyan-mcp": { "command": "wenyan-mcp", "env": { "WECHAT_APP_ID": "wxabcd1234efgh5678", "WECHAT_APP_SECRET": "abcd1234efgh5678abcd1234efgh5678" } } } } ``` -------------------------------- ### Wenyan MCP Publish Success Response Source: https://github.com/caol64/wenyan-mcp/blob/main/_autodocs/quick-reference.md Example of a successful response when an article is published, including the content and media ID. ```json { "content": [{ "type": "text", "text": "Your article was successfully published to '公众号草稿箱'. The media ID is 123456." }] } ``` -------------------------------- ### Wenyan MCP Error Response Source: https://github.com/caol64/wenyan-mcp/blob/main/_autodocs/quick-reference.md Example of an error response, indicating a failure during tool execution, such as missing input content. ```json { "content": [{ "type": "text", "text": "执行工具失败: missing input-content (...)" }] } ``` -------------------------------- ### Initialize Marked with Highlight.js Source: https://github.com/caol64/wenyan-mcp/blob/main/tests/publish.md Initializes the Marked library with marked-highlight for syntax highlighting using highlight.js. Ensure highlight.js is imported. ```javascript import { Marked } from "marked"; import { markedHighlight } from "marked-highlight"; import hljs from 'highlight.js'; // or UMD script // // // const { Marked } = globalThis.marked; // const { markedHighlight } = globalThis.markedHighlight; const marked = new Marked( markedHighlight({ emptyLangClass: 'hljs', langPrefix: 'hljs language-', highlight(code, lang, info) { const language = hljs.getLanguage(lang) ? lang : 'plaintext'; return hljs.highlight(code, { language }).value; } }) ); ``` -------------------------------- ### Run Wenyan MCP in Client Mode Source: https://github.com/caol64/wenyan-mcp/blob/main/_autodocs/00-START-HERE.md This command runs Wenyan MCP in client mode, recommended for team collaboration. It does not require IP whitelisting and supports multiple official accounts. Replace 'https://api.example.com' with your server URL and 'your-key' with your API key. ```bash wenyan-mcp --server https://api.example.com --api-key your-key # 无需环保证 IP 白名单 # 支持:多个公众号 ``` -------------------------------- ### Claude Desktop Configuration for Client Mode Source: https://github.com/caol64/wenyan-mcp/blob/main/_autodocs/configuration.md Configure the --server and --api-key arguments for Wenyan MCP within the Claude Desktop configuration file for client mode operation. ```json { "mcpServers": { "wenyan-mcp": { "command": "wenyan-mcp", "args": [ "--server", "https://api.example.com", "--api-key", "your-api-key" ] } } } ``` -------------------------------- ### Global State Initialization Logic Source: https://github.com/caol64/wenyan-mcp/blob/main/_autodocs/configuration.md Illustrates how global states like client mode, server URL, and API key are initialized from command-line arguments in the main function. ```typescript const args = process.argv.slice(2); const isClientMode = args.includes("--server"); if (isClientMode) { globalStates.isClientMode = true; // 解析 --server 参数 const serverIndex = args.indexOf("--server"); if (serverIndex !== -1 && args[serverIndex + 1]) { globalStates.serverUrl = args[serverIndex + 1]; } // 解析 --api-key 参数 const apiKeyIndex = args.indexOf("--api-key"); if (apiKeyIndex !== -1 && args[apiKeyIndex + 1]) { globalStates.apiKey = args[apiKeyIndex + 1]; } } ``` -------------------------------- ### Wenyan MCP Common Commands Source: https://github.com/caol64/wenyan-mcp/blob/main/_autodocs/quick-reference.md Provides essential commands for building, type checking, formatting, debugging, and testing the Wenyan MCP project. ```bash # 构建 pnpm build ``` ```bash # 类型检查 pnpm typecheck ``` ```bash # 代码格式化 pnpm lint ``` ```bash # 运行 Inspector 调试 pnpm inspector ``` ```bash # 运行测试 pnpm test:publish pnpm test:list pnpm test:register pnpm test:remove ``` -------------------------------- ### 列出所有公众号主题 Source: https://github.com/caol64/wenyan-mcp/blob/main/_autodocs/configuration.md 通过 Claude Desktop 的交互式命令或 MCP Inspector 工具的 `list_themes` 命令来查看所有可用的公众号主题。 ```bash # 在 Claude Desktop 中 # 告诉 Claude: "列出所有可用的公众号主题" # 或通过 MCP Inspector 工具调用 list_themes ``` -------------------------------- ### 验证环境变量和连接 Source: https://github.com/caol64/wenyan-mcp/blob/main/_autodocs/configuration.md 通过打印环境变量 `WECHAT_APP_ID` 和 `WECHAT_APP_SECRET` 来检查配置。使用 MCP Inspector 工具测试与服务器的连接,并调用 `list_themes` 进行进一步验证。 ```bash # 1. 检查环境变量 echo $WECHAT_APP_ID echo $WECHAT_APP_SECRET # 2. 使用 Inspector 测试连接 npx @modelcontextprotocol/inspector wenyan-mcp # 3. 在 Inspector 中调用 list_themes 进行测试 ``` -------------------------------- ### Client Mode Configuration Source: https://github.com/caol64/wenyan-mcp/blob/main/_autodocs/configuration.md Recommended for team collaboration, this mode connects to a remote Wenyan Server. Ensure you have the server URL and API key. ```json { "mcpServers": { "wenyan-mcp": { "command": "wenyan-mcp", "args": [ "--server", "https://wenyan-server.example.com", "--api-key", "sk-your-secret-api-key" ] } } } ``` -------------------------------- ### 注册自定义 CSS 主题 Source: https://github.com/caol64/wenyan-mcp/blob/main/_autodocs/configuration.md 使用 Claude Desktop 的交互式命令或 MCP Inspector 工具的 `register_theme` 命令来注册一个自定义的 CSS 主题,需要提供 CSS 文件链接和新主题名称。 ```bash # 在 Claude Desktop 中 # 告诉 Claude: "把这个CSS (https://example.com/theme.css) 注册为新主题,名称为: mytheme" # 或使用 register_theme 工具 ``` -------------------------------- ### Handle Missing Server URL Error Source: https://github.com/caol64/wenyan-mcp/blob/main/_autodocs/errors.md Shows how to correctly invoke the wenyan-mcp command with the required --server argument to avoid the 'Missing server URL' error. This error occurs when the server address is not specified in client mode. ```bash # ✅ 正确:指定服务器 URL wenyan-mcp --server https://api.example.com ``` -------------------------------- ### Wenyan MCP Workflow Source: https://github.com/caol64/wenyan-mcp/blob/main/_autodocs/00-START-HERE.md Illustrates the interaction flow between a Claude user, Claude Desktop, the Wenyan MCP Server, and the WeChat Official Account API for publishing articles. ```text Claude 用户 ↓ "用 orangeheart 主题发布这篇文章" ↓ Claude Desktop ↓ MCP 调用 ↓ Wenyan MCP Server ↓ 工具处理 ↓ 微信公众号 API ↓ 文章发布 ↓ 公众号草稿箱 ✅ ``` -------------------------------- ### Docker Configuration with Environment Variables Source: https://github.com/caol64/wenyan-mcp/blob/main/_autodocs/configuration.md Run Wenyan MCP in a Docker container and pass environment variables using the -e flag. This includes setting the host file path for Docker mode. ```bash docker run \ -e WECHAT_APP_ID="your_app_id" \ -e WECHAT_APP_SECRET="your_app_secret" \ -e HOST_FILE_PATH="/your/host/path" \ -v "/your/host/path:/mnt/host-downloads" \ caol64/wenyan-mcp:latest ``` -------------------------------- ### Claude Desktop Configuration Source: https://github.com/caol64/wenyan-mcp/blob/main/README.md Configure Claude Desktop to use Wenyan MCP servers. Ensure you replace 'your_app_id' and 'your_app_secret' with your actual WeChat credentials. ```json { "mcpServers": { "wenyan-mcp": { "command": "wenyan-mcp", "env": { "WECHAT_APP_ID": "your_app_id", "WECHAT_APP_SECRET": "your_app_secret" } } } } ``` -------------------------------- ### Import Statements for Index File Source: https://github.com/caol64/wenyan-mcp/blob/main/_autodocs/module-exports.md Imports necessary modules and types for the main entry point file. ```typescript import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"; import { createServer } from "./mcpServer.js"; import { globalStates } from "./utils.js"; ``` -------------------------------- ### Wenyan MCP Data Flow Source: https://github.com/caol64/wenyan-mcp/blob/main/_autodocs/quick-reference.md Illustrates the request and response flow within the Wenyan MCP system, from client request to server response. ```text 客户端请求 ↓ ListTools / CallTool ↓ createServer() → 返回 Server ↓ RequestHandler ↓ publish_article → publishArticle() → buildMcpResponse() list_themes → listThemes() → buildMcpResponse() register_theme → addTheme() → buildMcpResponse() remove_theme → removeTheme() → buildMcpResponse() ↓ ResponseObject ↓ 返回客户端 ``` -------------------------------- ### 文章元数据配置 (YAML Frontmatter) Source: https://github.com/caol64/wenyan-mcp/blob/main/_autodocs/configuration.md 发布 Markdown 文章时,必须包含 YAML frontmatter 来配置文章的元数据,如标题、封面、作者、来源链接等。可以指定文章类型为 'image' 以发布为小绿书格式。 ```yaml --- title: 文章标题(必填) cover: 封面图片路径(可选,支持本地路径和 URL) author: 作者名(可选) source_url: 原文链接(可选) type: image(可选,设为 "image" 时发布为小绿书) image_list:(可选,小绿书专用) - ./image1.jpg - ./image2.jpg need_open_comment: true(可选,是否打开评论) only_fans_can_comment: false(可选,是否仅粉丝可评论) --- ``` -------------------------------- ### Handle AppID Mode Conflict Error Source: https://github.com/caol64/wenyan-mcp/blob/main/_autodocs/errors.md Demonstrates the correct usage of the 'publish_article' tool, showing how to avoid the 'AppID is only supported in remote client mode' error. This involves either omitting 'app_id' in local mode or using the client mode with '--server'. ```bash # ✅ 正确做法 1:本地模式,不提供 app_id wenyan-mcp tools/call { name: "publish_article", arguments: { file: "./article.md", theme_id: "orangeheart" // 不提供 app_id } } ``` ```bash # ✅ 正确做法 2:客户端模式,可提供 app_id wenyan-mcp --server https://api.example.com tools/call { name: "publish_article", arguments: { file: "./article.md", theme_id: "orangeheart", app_id: "wxabcd1234" // ✅ 在客户端模式下支持 } } ``` -------------------------------- ### Publish Article Rendering and Publishing Steps Source: https://github.com/caol64/wenyan-mcp/blob/main/_autodocs/README.md Details the steps involved in rendering Markdown content and publishing it to a WeChat official account, including image uploads and draft posting. ```plaintext renderAndPublish() 或 renderAndPublishToServer() ├── 渲染 Markdown 为富文本 ├── 上传图片到微信素材库 └── 发布到微信公众号草稿箱 ``` -------------------------------- ### Running Wenyan MCP in Client Mode Source: https://github.com/caol64/wenyan-mcp/blob/main/_autodocs/configuration.md Configure Wenyan MCP to connect to a remote Wenyan Server using the --server and optional --api-key arguments. This bypasses local IP restrictions. ```bash wenyan-mcp --server [--api-key ] ``` -------------------------------- ### Main Entry Point Function Signature Source: https://github.com/caol64/wenyan-mcp/blob/main/_autodocs/module-exports.md Signature for the main entry point function which handles command-line arguments and mode selection. ```typescript async function main(): Promise ``` -------------------------------- ### Built-in and Custom Themes Source: https://github.com/caol64/wenyan-mcp/blob/main/_autodocs/00-START-HERE.md Lists the default themes available in Wenyan MCP and mentions the possibility of adding custom CSS themes using the `register_theme` tool. ```text default, orangeheart, rainbow, lapis, pie, maize, purple, phycat ``` -------------------------------- ### 删除指定名称的主题 Source: https://github.com/caol64/wenyan-mcp/blob/main/_autodocs/configuration.md 通过 Claude Desktop 的交互式命令或 MCP Inspector 工具的 `remove_theme` 命令来删除一个已注册的主题,需要提供主题的名称。 ```bash # 在 Claude Desktop 中 # 告诉 Claude: "删除名为 'mytheme' 的主题" # 或使用 remove_theme 工具 ``` -------------------------------- ### ResponseObject 与 buildMcpResponse 的关系 Source: https://github.com/caol64/wenyan-mcp/blob/main/_autodocs/types.md 对比手动构建 ResponseObject 和使用 buildMcpResponse 函数构建的方式,推荐使用后者。 ```typescript // 手动构建 const manual: ResponseObject = { content: [ { type: "text", text: "Success message" } ] }; // 使用 buildMcpResponse 构建(推荐) const builderVersion = buildMcpResponse("Success message"); // 两者等价 ``` -------------------------------- ### Using a .env File for Environment Variables Source: https://github.com/caol64/wenyan-mcp/blob/main/_autodocs/configuration.md Store environment variables in a .env file and load it using the --env-file flag with Node.js. This is useful for managing environment-specific configurations. ```dotenv WECHAT_APP_ID=your_app_id WECHAT_APP_SECRET=your_app_secret ``` ```bash node --env-file=.env ./dist/index.js ``` -------------------------------- ### Running Wenyan MCP in Local Mode Source: https://github.com/caol64/wenyan-mcp/blob/main/_autodocs/configuration.md Execute Wenyan MCP directly without any arguments to run in local mode. This mode requires WeChat API credentials and local IP whitelisting. ```bash wenyan-mcp ``` ```bash wenyan-mcp --local ``` -------------------------------- ### Run Wenyan MCP in Local Mode Source: https://github.com/caol64/wenyan-mcp/blob/main/_autodocs/00-START-HERE.md Use this command to run Wenyan MCP in local mode. Ensure WECHAT_APP_ID and WECHAT_APP_SECRET environment variables are set, and your IP is whitelisted by WeChat Official Account. This mode supports a single official account. ```bash wenyan-mcp # 需要:WECHAT_APP_ID、WECHAT_APP_SECRET 环境变量 # 需要:IP 在微信公众号白名单中 # 支持:单个公众号 ``` -------------------------------- ### Setting System Environment Variables Source: https://github.com/caol64/wenyan-mcp/blob/main/_autodocs/configuration.md Set environment variables directly in your system before launching the MCP. This method is suitable for shell-based environments. ```bash export WECHAT_APP_ID="your_app_id" export WECHAT_APP_SECRET="your_app_secret" wenyan-mcp ``` -------------------------------- ### MCP Server API Reference Source: https://github.com/caol64/wenyan-mcp/blob/main/_autodocs/README.md The main interface for the MCP server, including functions to create server instances and manage articles and themes. ```APIDOC ## createServer() ### Description Creates and configures an MCP server instance. ### Method Not specified (likely a function call within the SDK) ### Endpoint N/A ### Parameters None explicitly defined in this summary. ### Request Example N/A ### Response Returns an MCP server instance. ## publish_article, list_themes, register_theme, remove_theme ### Description Detailed descriptions for the four tools available through the MCP server. ### Method Not specified (likely function calls or API endpoints). ### Endpoint Not specified. ### Parameters Details for each tool's parameters are found in their respective documentation files. ### Request Example N/A ### Response Depends on the specific tool called. ``` -------------------------------- ### Global Utility Functions Source: https://github.com/caol64/wenyan-mcp/blob/main/_autodocs/README.md Global utility functions and state management class. ```APIDOC ## buildMcpResponse() ### Description Builds a standard MCP response. ### Method Not specified (likely a function call within the SDK). ### Endpoint N/A ### Parameters None explicitly defined in this summary. ### Request Example N/A ### Response Returns a structured MCP response object. ## GlobalStates ### Description Class for global state management. ### Method Methods for managing global states are not detailed here. ### Endpoint N/A ### Parameters N/A ### Request Example N/A ### Response Provides access to and manipulation of global states. ## getInputContent() ### Description Function to read article content. ### Method Not specified (likely a function call within the SDK). ### Endpoint N/A ### Parameters None explicitly defined in this summary. ### Request Example N/A ### Response Returns the content of the article. ``` -------------------------------- ### Publish Article Input Content Processing Source: https://github.com/caol64/wenyan-mcp/blob/main/_autodocs/README.md Illustrates how the `getInputContent` function handles article content, prioritizing direct content over files or URLs. ```plaintext getInputContent(inputContent, file) ``` -------------------------------- ### Correct Usage for publishArticle Source: https://github.com/caol64/wenyan-mcp/blob/main/_autodocs/errors.md Illustrates the correct ways to call the publishArticle function by providing at least one content source. This avoids the 'missing input-content' error. ```typescript // ✅ 正确:至少提供一个内容源 const result = await publishArticle("", "", "# 文章内容", "orangeheart"); // 或 const result = await publishArticle("", "./article.md", "", "orangeheart"); // 或 const result = await publishArticle("https://example.com/article.md", "", "", "orangeheart"); ``` -------------------------------- ### 查询公网 IP Source: https://github.com/caol64/wenyan-mcp/blob/main/_autodocs/configuration.md 在 Linux 或 Mac 系统中,可以使用 curl 命令查询您的公网 IP 地址。您也可以访问指定的网站进行查询。 ```bash # Linux/Mac curl https://api.ipify.org # 或访问网站 https://checkip.amazonaws.com ``` -------------------------------- ### Theme Management Module Source: https://github.com/caol64/wenyan-mcp/blob/main/_autodocs/README.md Schema definitions for theme management tools. ```APIDOC ## LIST_THEMES_SCHEMA ### Description Tool interface schema for listing themes. ### Method N/A ### Endpoint N/A ### Parameters N/A ### Request Example N/A ### Response Schema definition for listing themes. ## REGISTER_THEME_SCHEMA ### Description Tool interface schema for registering a theme. ### Method N/A ### Endpoint N/A ### Parameters N/A ### Request Example N/A ### Response Schema definition for registering a theme. ## REMOVE_THEME_SCHEMA ### Description Tool interface schema for removing a theme. ### Method N/A ### Endpoint N/A ### Parameters N/A ### Request Example N/A ### Response Schema definition for removing a theme. ``` -------------------------------- ### Handle Missing Input Content Error Source: https://github.com/caol64/wenyan-mcp/blob/main/_autodocs/errors.md Demonstrates how to catch and handle the 'missing input-content' error when publishing an article. This error occurs if no content source (argument, file, or URL) is provided. ```typescript try { const result = await publishArticle("", "", "", "orangeheart"); } catch (error: any) { if (error.message.includes("missing input-content")) { console.error("请提供文章内容(content、file 或 content_url 之一)"); } } ``` -------------------------------- ### OutputObject 使用场景:工具执行失败 Source: https://github.com/caol64/wenyan-mcp/blob/main/_autodocs/types.md 用于表示工具执行失败时的输出对象。 ```typescript const output: OutputObject = { type: "text", text: "执行工具失败: 文件不存在" }; ``` -------------------------------- ### OutputObject 接口定义 Source: https://github.com/caol64/wenyan-mcp/blob/main/_autodocs/types.md 表示 MCP 响应中的单个输出对象,包含类型和文本内容。 ```typescript interface OutputObject { type: OutputType; text: string; } ``` -------------------------------- ### OutputObject 使用场景:工具执行成功 Source: https://github.com/caol64/wenyan-mcp/blob/main/_autodocs/types.md 用于表示工具执行成功时的输出对象。 ```typescript const output: OutputObject = { type: "text", text: "Theme \"xiuluochang\" has been added successfully." }; ``` -------------------------------- ### Article Publishing Module Source: https://github.com/caol64/wenyan-mcp/blob/main/_autodocs/README.md Module for publishing Markdown articles to WeChat Official Accounts. ```APIDOC ## publishArticle() ### Description Publishes a Markdown article to a WeChat Official Account. ### Method Not specified (likely a function call within the SDK). ### Endpoint N/A ### Parameters Requires article content in Markdown format. ### Request Example N/A ### Response Details on the response format can be found in `endpoints.md`. ## PUBLISH_ARTICLE_SCHEMA ### Description Schema definition for the article publishing tool. ### Method N/A ### Endpoint N/A ### Parameters N/A ### Request Example N/A ### Response Schema definition for the publishing tool. ``` -------------------------------- ### ResponseObject 接口定义 Source: https://github.com/caol64/wenyan-mcp/blob/main/_autodocs/types.md 表示 MCP 工具的完整响应,包含一个或多个 OutputObject。 ```typescript interface ResponseObject { content: OutputObject[]; } ``` -------------------------------- ### OutputObject 使用场景:在响应对象中 Source: https://github.com/caol64/wenyan-mcp/blob/main/_autodocs/types.md 展示 OutputObject 如何嵌套在 ResponseObject 中。 ```typescript const response: ResponseObject = { content: [ { type: "text", text: "Your article was successfully published to '公众号草稿箱'. The media ID is xxx." } ] }; ``` -------------------------------- ### ResponseObject 完整示例:发布文章成功响应 Source: https://github.com/caol64/wenyan-mcp/blob/main/_autodocs/types.md 展示发布文章成功时 ResponseObject 的结构。 ```typescript const response: ResponseObject = { content: [ { type: "text", text: "Your article was successfully published to '公众号草稿箱'. The media ID is 123456789." } ] }; ``` -------------------------------- ### OutputType 类型定义 Source: https://github.com/caol64/wenyan-mcp/blob/main/_autodocs/types.md 定义了输出对象的类型标识符。目前仅支持 'text' 类型。 ```typescript type OutputType = "text"; ``` -------------------------------- ### Publish Article Tool Call Schema Source: https://github.com/caol64/wenyan-mcp/blob/main/_autodocs/README.md This represents the schema for the `publish_article` tool call within the MCP client request flow. It details the parameters accepted by the `publishArticle` function. ```plaintext publishArticle(contentUrl, file, content, themeId, appId) ``` -------------------------------- ### Publish Article MCP Response Building Source: https://github.com/caol64/wenyan-mcp/blob/main/_autodocs/README.md Describes the structure of the response generated after a successful article publication, including success messages and media IDs. ```plaintext buildMcpResponse(成功消息 + 媒体ID) ``` -------------------------------- ### ResponseObject 完整示例:列出主题响应 Source: https://github.com/caol64/wenyan-mcp/blob/main/_autodocs/types.md 展示列出多个主题时 ResponseObject 的结构,其中每个主题都作为单独的 OutputObject。 ```typescript const response: ResponseObject = { content: [ { type: "text", text: JSON.stringify({ id: "default", name: "Default(默认)", description: "简洁经典的排版,适合长文阅读,通用性强。" }) }, { type: "text", text: JSON.stringify({ id: "orangeheart", name: "OrangeHeart(橙心)", description: "暖橙色调,优雅而富有活力,适合情感、生活类内容。" }) } // ... 更多主题 ] }; ``` -------------------------------- ### ResponseObject 完整示例:注册主题成功响应 Source: https://github.com/caol64/wenyan-mcp/blob/main/_autodocs/types.md 展示注册主题成功时 ResponseObject 的结构。 ```typescript const response: ResponseObject = { content: [ { type: "text", text: "Theme \"mytheme\" has been added successfully." } ] }; ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.