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.

Servidor XPath MCP

Servidor MCP para ejecutar consultas XPath en contenido XML.

Herramientas

  1. xpath
    • Consultar contenido XML mediante expresiones XPath
    • Entradas:
      • xml (cadena): el contenido XML a consultar
      • query (cadena): La consulta XPath a ejecutar
      • mimeType (opcional, cadena): el tipo MIME (por ejemplo, texto/xml, aplicación/xml, texto/html, aplicación/xhtml+xml)
    • Devuelve: El resultado de la consulta XPath como una cadena
  2. xpathwithurl
    • Obtener contenido de una URL y consultarlo mediante expresiones XPath
    • Entradas:
      • url (cadena): La URL para obtener el contenido XML/HTML
      • query (cadena): La consulta XPath a ejecutar
      • mimeType (opcional, cadena): el tipo MIME (por ejemplo, texto/xml, aplicación/xml, texto/html, aplicación/xhtml+xml)
    • Devuelve: El resultado de la consulta XPath como una cadena

Instalación

Instalación mediante herrería

Para instalar mcp-xpath para Claude Desktop automáticamente a través de Smithery :

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

Configuración

Uso con Claude Desktop

Agregue lo siguiente a su claude_desktop_config.json :

npx

{ "mcpServers": { "xpath": { "command": "npx", "args": [ "@thirdstrandstudio/mcp-xpath" ] } } }

Node.js directo

{ "mcpServers": { "xpath": { "command": "node", "args": [ "/path/to/mcp-xpath/dist/index.js" ] } } }

Reemplace /path/to/mcp-xpath con la ruta real a su repositorio.

Ejemplos

Consultar contenido 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" });

Consultar contenido 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" });

Consultar el contenido de la URL

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

Desarrollo

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

Licencia

Este servidor MCP cuenta con la licencia MIT. Esto significa que puede usar, modificar y distribuir el software libremente, sujeto a los términos y condiciones de la licencia MIT. Para más detalles, consulte el archivo de LICENCIA en el repositorio del proyecto.

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

Servidor MCP para ejecutar consultas XPath en contenido XML

  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