marklogic-mcp: Skill for Claude Code

.claude/skills/marklogic-rag/SKILL.md

marklogic-rag is a skill for Claude Code from tternquist/marklogic-mcp. It costs 151 tokens per session (2,840 once invoked), scanned A, original, MIT.

A guide for building retrieval-augmented generation systems in MarkLogic 12. Retrieval-augmented generation means finding relevant stored information before an AI model writes an answer.

In plain words
What is it for?
Use it to store embeddings, split documents into chunks, and design lexical, vector, hybrid, or graph-based retrieval pipelines.
Why use it?
It helps choose between keyword search, embedding-based similarity, hybrid search, and knowledge-graph filtering for a given data set.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

This is tternquist/marklogic-mcp's own configuration. It tells Claude Code how to work on marklogic-mcp itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything marklogic-mcp configures →

Reuse

Borrowing it

Nothing to install: this file belongs to tternquist/marklogic-mcp. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/tternquist/marklogic-mcp/master/.claude/skills/marklogic-rag/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/tternquist/marklogic-mcp

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for marklogic-rag

README.md
[![agentmods](https://agentmods.dev/badge/skills/tternquist/marklogic-mcp/marklogic-rag/github.svg)](https://agentmods.dev/skills/tternquist/marklogic-mcp/marklogic-rag)
Your own site
<a href="https://agentmods.dev/skills/tternquist/marklogic-mcp/marklogic-rag"><img src="https://agentmods.dev/badge/skills/tternquist/marklogic-mcp/marklogic-rag/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for marklogic-rag

Your own site · 80×15
<a href="https://agentmods.dev/skills/tternquist/marklogic-mcp/marklogic-rag"><img src="https://agentmods.dev/badge/skills/tternquist/marklogic-mcp/marklogic-rag.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 151 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,840 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00151 $0.02840
Opus 5.5 $0.00060 $0.01136
Sonnet 5.5 $0.00030 $0.00568
Haiku 4.5 $0.00015 $0.00284

Measured 1mo ago against content hash 3a4a1be32c54, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

marklogic-rag scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/marklogic-rag/SKILL.md · 215 lines

How it starts

The opening of the file, as written. The whole thing — 215 lines — stays where its author put it; the contents beside it link to each section on GitHub.

RAG on MarkLogic 12

Requires MarkLogic 12+. Check for an existing vector view first with ml_views_list and ml_schema_get_tde.

Pick a paradigm

Situation Approach
No embeddings, fast prototype Lexical RAG
Embeddings available, simple queries Pure vector (cosine)
Mixed vocabulary + semantic queries ANN hybrid (ANN + BM25)
Taxonomy / knowledge graph available Graph + Lexical
Highest precision, full infrastructure Graph + Vector

The graph layer composes with any paradigm — it only supplies a URI scope filter, so apply it before the search or ANN step.

1. Storing embeddings

Store the embedding as a JSON array of floats in an embedding field, sibling to the content fields. Carry embeddingModel, embeddingDim, and — when chunking — chunkIndex, chunkText, sourceUri.

Chunking strategy by domain: legal contracts → by clause; news articles → whole-document or paragraph; product manuals → by section.

⚠ Generate embeddings in your application tier, not in MarkLogic. xdmp.httpPost to external HTTPS embedding APIs commonly fails with tlsv1 unrecognized name (an SSL SNI limitation in MarkLogic's Java SSL client). Produce the float array outside, then store it with flux_import or ml_document_put.

2. The TDE vector column

{
  "template": {
    "context": "/",
    "collections": ["my-collection"],
    "rows": [{
      "schemaName": "my_schema",
      "viewName": "my_view",
      "columns": [
        { "name": "uri",       "scalarType": "string", "val": "xdmp:node-uri(.)" },
        { "name": "content",   "scalarType": "string", "val": "chunkText" },
        { "name": "embedding", "scalarType": "vector", "val": "array-node('embedding')",
          "dimension": 1536, "invalidValues": "reject" }
      ]
    }]
  }
}

Five rules that each cause a distinct failure:

  • "scalarType": "vector" — not "vec:vector", not "scalar". Either of those gives TDE-INVALIDTEMPLATENODEVAL.
  • "val": "array-node('embedding')" — plain "val": "embedding" atomises the array into N individual number nodes and throws XDMP-CAST.
  • "dimension" is required and must be a JSON number, not a string. "1536" can fail with XDMP-CAST: Invalid cast: null cast as vec:vector(dim:1536) and no obvious message that the type is wrong.
  • "invalidValues": "reject" — skips malformed documents instead of failing the whole view.
  • Column ordering can trigger the same null-cast failure. A date scalar column immediately before the vector column has been observed to produce the same null-cast error as the dimension typo, even when the vector itself is valid. This is a template-construction interaction, not a documented MarkLogic rule — if a minimal single-column vector template works but a multi-column one fails, isolate the cause by moving the vector column away from other scalar columns before assuming the vector spec itself is wrong.

Read the full file on GitHub · 215 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago Changed · +54 lines 3a4a1be32c54
  2. 2mo ago First seen · 161 lines · 151 tokens per session scan A e861253f0d8a

Subscribe to this mod's changes

marklogic-rag is a skill published in the GitHub repository tternquist/marklogic-mcp (4 stars, last pushed 1mo ago), licensed MIT. It adds 151 tokens to every session and 2,840 once invoked, about $0.0006 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

marklogic-rag compared with skills from other repositories

marklogic-rag next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
marklogic-ragtternquist/marklogic-mcpSkill41mo agoMITA151Claude Code
chromaNousResearch/hermes-agentSkill261kyesterdayMITA12Claude Code, Codex
embeddingsruvnet/rufloSkill81kyesterdayMITA62Claude Code
rag-pineconedavila7/claude-code-templatesSkill33kyesterdayMITA65Claude Code, Codex
similarity-search-patternsforyourhealth111-pixel/Vibe-SkillsSkill3.8k3d agoApache-2.0A30Claude Code, Codex
pgvector-semantic-searchtimescale/pg-aiguideSkill1.9k3d agoApache-2.0A190Cursor
postgres-hybrid-text-searchtimescale/pg-aiguideSkill1.9k3d agoApache-2.0A162Cursor