XPath MCP Server
Execute XPath queries on XML content.
XPath MCP Server
MCP Server for executing XPath queries on XML content.
Tools
-
xpath- Query XML content using XPath expressions
- Inputs:
xml(string): The XML content to queryquery(string): The XPath query to executemimeType(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
-
xpathwithurl- Fetch content from a URL and query it using XPath expressions
- Inputs:
url(string): The URL to fetch XML/HTML content fromquery(string): The XPath query to executemimeType(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.
संबंधित सर्वर
Bright Data
प्रायोजकDiscover, extract, and interact with the web - one interface powering automated access across the public internet.
Chrome Debug
Automate Chrome via its debugging port with session persistence. Requires Chrome to be started with remote debugging enabled.
LinkedIn
Scrape LinkedIn profiles, companies, and jobs using direct URLs. Features Claude AI integration and secure credential storage.
Urlbox Full Page Screenshots
An MCP server for the Urlbox Screenshot API. It enables your client to take screenshots, generate PDFs, extract HTML/markdown, and more from websites.
Trends Hub
Aggregates trending topics from over 20 sources in real-time, with customizable fields and RSS feed support.
Crawl4AI RAG
Integrate web crawling and Retrieval-Augmented Generation (RAG) into AI agents and coding assistants.
YouTube Transcript
An MCP server for extracting and processing transcripts from YouTube videos.
TheirStack
Search job postings, companies, and technology stacks across 10M+ companies.
Playwright Record MCP
Browser automation using Playwright with video recording. Enables LLMs to interact with web pages through structured accessibility snapshots.
Playwright MCP
Control a browser for automation and web scraping tasks using Playwright.
Puppeteer
A server for browser automation using Puppeteer, enabling web scraping, screenshots, and JavaScript execution.
