mcp-xpath

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.

Integrations

  • Offers direct Node.js execution capabilities for the MCP server, with configuration options for connecting the XPath functionality to Node.js environments.

  • Enables execution of XPath queries on XML content, allowing content extraction and transformation from XML documents with support for various MIME types including text/xml and application/xml.

XPath MCP サーバー

XML コンテンツに対して XPath クエリを実行するための MCP サーバー。

ツール

  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

XMLコンテンツに対してXPathクエリを実行するためのMCPサーバー

  1. Tools
    1. Installation
      1. Installing via Smithery
    2. Setup
      1. Usage with Claude Desktop
    3. Examples
      1. Query XML content
      2. Query HTML content
      3. Query URL content
    4. Development
      1. License
        ID: wdi74fq55l