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를 자동으로 설치하려면:

지엑스피1

# Install dependencies npm install # Build the package npm run build

설정

Claude Desktop과 함께 사용

claude_desktop_config.json 에 다음을 추가하세요.

엔피엑스

{ "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