Skip to main content
Glama

XPath MCP 服务器

MCP 服务器用于对 XML 内容执行 XPath 查询。

图像

工具

  1. xpath
    • 使用 XPath 表达式查询 XML 内容
    • 输入:
      • xml (字符串):要查询的 XML 内容
      • query (字符串):要执行的 XPath 查询
      • mimeType (可选,字符串):MIME 类型(例如 text/xml、application/xml、text/html、application/xhtml+xml)
    • 返回:XPath 查询的结果作为字符串
  2. xpathwithurl
    • 从 URL 获取内容并使用 XPath 表达式进行查询
    • 输入:
      • url (字符串): 获取 XML/HTML 内容的 URL
      • query (字符串):要执行的 XPath 查询
      • mimeType (可选,字符串):MIME 类型(例如 text/xml、application/xml、text/html、application/xhtml+xml)
    • 返回:XPath 查询的结果作为字符串

安装

通过 Smithery 安装

要通过Smithery自动为 Claude Desktop 安装 mcp-xpath:

npx -y @smithery/cli install @thirdstrandstudio/mcp-xpath --client claude
# Install dependencies npm install # Build the package npm run build

设置

与 Claude Desktop 一起使用

将以下内容添加到您的claude_desktop_config.json中:

NPX
{ "mcpServers": { "xpath": { "command": "npx", "args": [ "@thirdstrandstudio/mcp-xpath" ] } } }
直接使用 Node.js
{ "mcpServers": { "xpath": { "command": "node", "args": [ "/path/to/mcp-xpath/dist/index.js" ] } } }

/path/to/mcp-xpath替换为您的存储库的实际路径。

示例

查询 XML 内容

// Select all <item> elements from XML const result = await callTool("xpath", { xml: "<root><item>value1</item><item>value2</item></root>", query: "//item/text()", mimeType: "text/xml" });

查询 HTML 内容

// Get all links from HTML const result = await callTool("xpath", { xml: "<html><body><a href='link1.html'>Link 1</a><a href='link2.html'>Link 2</a></body></html>", query: "//a/@href", mimeType: "text/html" });

查询 URL 内容

// Get all links from a webpage const result = await callTool("xpathwithurl", { url: "https://example.com", query: "//a/@href", mimeType: "text/html" });

发展

# Install dependencies npm install # Start the server in development mode npm start

执照

此 MCP 服务器采用 MIT 许可证。这意味着您可以自由使用、修改和分发该软件,但须遵守 MIT 许可证的条款和条件。更多详情,请参阅项目仓库中的 LICENSE 文件。

-
security - not tested
A
license - permissive license
-
quality - not tested

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

用于对 XML 内容执行 XPath 查询的 MCP 服务器

  1. 工具
    1. 安装
      1. 通过 Smithery 安装
    2. 设置
      1. 与 Claude Desktop 一起使用
    3. 示例
      1. 查询 XML 内容
      2. 查询 HTML 内容
      3. 查询 URL 内容
    4. 发展
      1. 执照

        Related MCP Servers

        • A
          security
          A
          license
          A
          quality
          An MCP server for fetching and transforming web content into various formats.
          Last updated -
          4
          4
          Python
          MIT License
          • Apple
        • A
          security
          A
          license
          A
          quality
          MCP Server enabling integration with Scrapezy to retrieve structured data from websites.
          Last updated -
          1
          12
          1
          JavaScript
          MIT License
          • Apple
        • A
          security
          F
          license
          A
          quality
          Built as a Model Context Protocol (MCP) server that provides advanced web search, content extraction, web crawling, and scraping capabilities using the Firecrawl API.
          Last updated -
          4
          1
          Python
          • Apple
          • Linux

        View all related MCP servers

        MCP directory API

        We provide all the information about MCP servers via our MCP API.

        curl -X GET 'https://glama.ai/api/mcp/v1/servers/thirdstrandstudio/mcp-xpath'

        If you have feedback or need assistance with the MCP directory API, please join our Discord server