mcp-xpath
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.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-xpathextract all links from https://example.com using //a/@href"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
XPath MCP Server
MCP Server for executing XPath queries on XML content.
Tools
xpathQuery 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
xpathwithurlFetch 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
Related MCP server: Cleyrop MCP
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 buildSetup
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 startLicense
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.
Available Tools
2 toolsxpathC
Select query XML content using XPath
| Name | Required | Description | Default |
|---|---|---|---|
| mimeType | No | The MIME type (e.g. text/xml, application/xml, text/html, application/xhtml+xml) | text/html |
| query | Yes | The XPath query to execute | |
| xml | Yes | The XML content to query |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the action ('Select query') but doesn't describe what the tool returns (e.g., nodes, values, errors), performance characteristics, or any constraints like input size limits. This leaves significant gaps in understanding the tool's behavior beyond basic functionality.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence: 'Select query XML content using XPath'. It's front-loaded with the core purpose, has zero waste, and is appropriately sized for a straightforward tool. Every word earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity (XML querying with XPath), no annotations, and no output schema, the description is incomplete. It doesn't explain what the tool returns (e.g., extracted data, error handling), which is critical for an agent to use it correctly. The description should compensate for the lack of structured output information but fails to do so.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already documents all parameters (xml, query, mimeType) with clear descriptions. The description adds no additional meaning beyond what the schema provides, such as examples or usage notes for parameters. Baseline 3 is appropriate as the schema does the heavy lifting.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: 'Select query XML content using XPath'. It specifies the verb ('Select query') and resource ('XML content'), though it doesn't explicitly distinguish it from its sibling 'xpathwithurl', which likely handles URLs instead of direct XML input. The purpose is clear but lacks sibling differentiation.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives. It doesn't mention the sibling 'xpathwithurl' or any other tools, nor does it specify prerequisites or exclusions. Usage is implied from the purpose but lacks explicit context or alternatives.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
xpathwithurlC
Fetch content from a URL and select query it using XPath
| Name | Required | Description | Default |
|---|---|---|---|
| mimeType | No | The MIME type (e.g. text/xml, application/xml, text/html, application/xhtml+xml) | text/html |
| query | Yes | The XPath query to execute | |
| url | Yes | The URL to fetch XML/HTML content from |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions fetching content and querying with XPath, but doesn't disclose important behavioral traits such as error handling, network timeouts, authentication needs, rate limits, or what happens with invalid URLs or queries. For a tool that performs network operations and data processing, this is a significant gap.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is extremely concise and front-loaded, consisting of a single sentence: 'Fetch content from a URL and select query it using XPath'. Every word contributes directly to explaining the tool's purpose, with no unnecessary information or redundancy. It efficiently communicates the core functionality.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity (network fetching and XPath querying), lack of annotations, and no output schema, the description is incomplete. It doesn't explain what the tool returns (e.g., query results, errors), behavioral aspects like performance or limitations, or how to interpret results. For a tool with no structured safety or output information, the description should provide more context to be fully helpful.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 100% description coverage, clearly documenting all three parameters (url, query, mimeType) with their purposes and types. The description adds minimal value beyond the schema, as it only implies the parameters indirectly ('Fetch content from a URL' hints at 'url', 'select query it using XPath' hints at 'query'). It doesn't provide additional context like examples or constraints, so the baseline score of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: 'Fetch content from a URL and select query it using XPath'. It specifies the verb ('fetch', 'select query'), resource ('content from a URL'), and method ('using XPath'), making it easy to understand what the tool does. However, it doesn't explicitly differentiate from its sibling tool 'xpath', which might have overlapping functionality.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives. It doesn't mention the sibling tool 'xpath' or any other tools, nor does it specify scenarios where this tool is preferred or should be avoided. The description only states what the tool does, not when to use it.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
TDQS
The two tools have clearly distinct purposes: 'xpath' operates on provided XML content, while 'xpathwithurl' fetches content from a URL before applying XPath. There is no overlap or ambiguity between them.
Both tool names follow a consistent pattern: they start with 'xpath' and use descriptive suffixes ('withurl') without mixing conventions. The naming is straightforward and predictable.
With only 2 tools, the server feels thin for an XPath utility domain, as it lacks operations like validating XPath expressions, handling different input formats, or providing transformation capabilities. However, it covers basic use cases.
The tools cover core XPath querying on local and remote content, but there are notable gaps: no support for XML validation, error handling, or output formatting. The surface is functional but minimal for a full-featured XPath toolset.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
MCP server for Product Management
MCP server for Translation Services
MCP server for querying Forkast documentation
MCP server for Support & Service Management
Related MCP Servers
- MIT
- FlicenseNot gradedqualityDmaintenanceMCP server to interact with Cleyrop work data: browse, search, read file content, and manage files/folders.
- FlicenseNot gradedqualityDmaintenanceMCP server that provides tools to read JSON files and query data using jsonPath expressions.
- AlicenseNot gradedqualityCmaintenanceMCP server for searching and retrieving pages from Atlassian Confluence.541MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/thirdstrandstudio/mcp-xpath'
If you have feedback or need assistance with the MCP directory API, please join our Discord server