Hermes如何配置MarkItDown-MCP服务

环境信息:

    Mac OS Apple M2    Python v3.11.9    Hermes Agent v0.16.0    

步骤:

 一、安装和启动MarkItDown-MCP 服务:

   1、"MarkItDown" 是微软 AutoGen 团队开源的 Python 库,专门用于将各种文件格式转换为结构清晰的 Markdown,特别适合给 LLM(大语言模型)使用。安装需要的Python的版本在3.11+,否则在安装的过程中会出错。

   2、安装分为本地安装和Docker安装,我使用的是本地安装。启动MCP Server 分为STDIO方式、 HTTP and SSE方式,启动方式不同,在Hermes中配置MCP服务的脚本也不同,我这里使用的是STDIO的方式

#To install the package, use pip:
~ pip install markitdown-mcp
#To run the MCP server, using STDIO (default), use the following command:
~ markitdown-mcp

   

  二、配置Hermes的MCP服务

  1、Hermes Agent 原生支持 MCP(Model Context Protocol),MarkItDown-MCP 是微软官方提供的文档转 Markdown MCP 服务,二者通过 stdio 子进程(推荐)或 SSE/HTTP 两种方式对接。

  2、Hermes配置文件接入。我使用的是Python本地安装的MarkItDown。找到Hermes的配置文件 ~/.hermes/config.yaml

mcp_servers:
  markitdown:
    command: "markitdown-mcp"
    args: []
    env: {}
    timeout: 180
    connect_timeout: 60
    # 工具白名单(仅暴露转换函数,安全最小权限)
    tools:
      include:
        - convert_to_markdown
      resources: false
      prompts: false

  3、重启Hermes服务。这里注意,网上重启hermes使用命令:hermes restart。但是我的hermes版本是v0.16.0,提示没有这个命令。

hermes gateway restart

  4、启动hermes 服务后进行测试

image

 

  

   

 

 

【参考】

  1、https://www.aibuilderclub.com/blog/mcp-101-build-mcp-servers

  2、https://github.com/microsoft/markitdown/tree/main/packages/markitdown-mcp

  3、https://github.com/jwangkun/hermes-agent-guide/blob/main/11-MCP%E5%8D%8F%E8%AE%AE%E4%B8%8E%E8%87%AA%E5%8A%A8%E5%8C%96.md

posted @ 2026-06-22 18:05  寻找风口的猪  阅读(48)  评论(0)    收藏  举报