Command Palette

Search for a command to run...

UnylyUnyly
Browse all

XPath

FreeNot checked

Enables Claude to execute XPath queries on XML and HTML content, supporting both direct parsing and web scraping through Puppeteer for structured data extractio

GitHubEmbed

About

Enables Claude to execute XPath queries on XML and HTML content, supporting both direct parsing and web scraping through Puppeteer for structured data extraction from documents and websites.

README

MseeP.ai Security Assessment Badge

XPath MCP Server

Third Strand Studio

MCP Server for executing XPath queries on XML content.

mcp-xpath MCP server

image

smithery badge

Tools

  1. xpath

    • Query XML content using XPath expressions
    • Inputs:
      • xml (string): The XML content to query
      • query (string): The XPath query to execute
      • mimeType (optional, string): The MIME type (e.g. text/xml, application/xml, text/html, application/xhtml+xml)
    • Returns: The result of the XPath query as a string
  2. xpathwithurl

    • Fetch content from a URL and query it using XPath expressions
    • Inputs:
      • url (string): The URL to fetch XML/HTML content from
      • query (string): The XPath query to execute
      • mimeType (optional, string): The MIME type (e.g. text/xml, application/xml, text/html, application/xhtml+xml)
    • Returns: The result of the XPath query as a string

Installation

Installing via Smithery

To install mcp-xpath for Claude Desktop automatically via Smithery:

npx -y @smithery/cli install @thirdstrandstudio/mcp-xpath --client claude
# Install dependencies
npm install

# Build the package
npm run build

Setup

Usage with Claude Desktop

Add the following to your claude_desktop_config.json:

npx

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

Direct Node.js

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

Replace /path/to/mcp-xpath with the actual path to your repository.

Examples

Query XML content

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

Query HTML content

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

Query URL content

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

Development

# Install dependencies
npm install

# Start the server in development mode
npm start

License

This MCP server is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the LICENSE file in the project repository.

from github.com/thirdstrandstudio/mcp-xpath

Install XPath in Claude Desktop, Claude Code & Cursor

Recommended · one command, every IDE
unyly install xpath

Installs into Claude Desktop, Claude Code, Cursor & VS Code — handles npx, uvx and build-from-source repos for you.

First time? Get the CLI: curl -fsSL https://unyly.org/install | sh

Or configure manually

Run in your terminal:

claude mcp add xpath -- npx -y @jayarrowz/mcp-xpath

Step-by-step: how to install XPath

FAQ

Is XPath MCP free?

Yes, XPath MCP is free — one-click install via Unyly at no cost.

Does XPath need an API key?

No, XPath runs without API keys or environment variables.

Is XPath hosted or self-hosted?

Self-hosted: the server runs locally on your machine via the install command above.

How do I install XPath in Claude Desktop, Claude Code or Cursor?

Open XPath on unyly.org, pick your client tab (Claude Desktop, Claude Code, Cursor) and press Install — the config is generated automatically, no JSON editing.

Related MCPs

Compare XPath with

Not sure what to pick?

Find your stack in 60 seconds

Author?

Embed badge for your README

Browse similar

All browse MCPs