marklogic-mcp: Skill for Claude Code

.claude/skills/marklogic-server-side-code/SKILL.md

marklogic-server-side-code is a skill for Claude Code from tternquist/marklogic-mcp. It costs 0 tokens per session (2,405 once invoked), scanned A, original, MIT.

A guide for writing server-side MarkLogic code in JavaScript and XQuery. It covers reusable modules, REST endpoints, data transforms, data-processing pipelines, scheduled scripts, and database templates.

In plain words
What is it for?
Use it to create or debug MarkLogic modules deployed to the Modules database, including REST services, content transforms, Flux readers and transforms, scheduled tasks, and TDE templates.
Why use it?
It helps choose the correct code structure for each MarkLogic server task and follow conventions for retrieval, updates, logging, errors, and exported functions.

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 →

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is WRONG: { "val": "fn:concat('http://example.org/', ../id)" }.

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-server-side-code/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-server-side-code

README.md
[![agentmods](https://agentmods.dev/badge/skills/tternquist/marklogic-mcp/marklogic-server-side-code/github.svg)](https://agentmods.dev/skills/tternquist/marklogic-mcp/marklogic-server-side-code)
Your own site
<a href="https://agentmods.dev/skills/tternquist/marklogic-mcp/marklogic-server-side-code"><img src="https://agentmods.dev/badge/skills/tternquist/marklogic-mcp/marklogic-server-side-code/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-server-side-code

Your own site · 80×15
<a href="https://agentmods.dev/skills/tternquist/marklogic-mcp/marklogic-server-side-code"><img src="https://agentmods.dev/badge/skills/tternquist/marklogic-mcp/marklogic-server-side-code.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,405 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.00000 $0.02405
Opus 5.5 $0.00000 $0.00962
Sonnet 5.5 $0.00000 $0.00481
Haiku 4.5 $0.00000 $0.00241

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

Security

Grade A, and why

marklogic-server-side-code 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-server-side-code/SKILL.md · 180 lines

How it starts

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

MarkLogic Server-Side Code

Module type → signature

Type Shape
Library module.exports = {...} or exports.fn = …
REST resource extension export GET / PUT / POST / DELETE, each (context, params, input)
REST transform (CTF) export a transform function (content, context)
Flux reader (phase 1) returns a Sequence/Array of URI strings — no declareUpdate()
Flux transform (phase 2) declareUpdate() first, var URI injected, one output doc per call
Scheduled task self-contained script; declareUpdate() if it writes

Universal conventions: 'use strict'; at the top, xdmp.log() for server-side logging, cts.search() rather than fn.doc() for retrieval, try/catch around fallible work, and JSDoc on exported functions.

If require() fails inside a REST resource extension

The REST API Developer's Guide states that JavaScript library modules are not available to resource service extensions, because the REST API imports them dynamically, and recommends a Data Service endpoint when an endpoint needs shared library code. The worked extension in the marklogic-project-setup skill's REST-extensions reference does use require(), so the restriction is either version-specific or narrower than the guide's wording — verify on your own version before designing around either claim.

What holds regardless: the import happens at request time, so a successful ml_extension_put is not evidence the extension works. Call the endpoint before believing it. If require() does fail there, inline the logic or move to a Data Service rather than assuming the module path is wrong.

The same interface backs the Java, Node.js, and REST client APIs, so one extension serves all three.

Application coding practices

references/coding-practices.md covers the practices that decide whether a module is production-grade, with worked examples:

  1. Never concatenate untrusted input into a query string — bind instead (sem.sparql bindings map, cts.parse constraint bindings, xdmp.eval external variables), and prefer cts constructors over any string grammar.
  2. xdmp.eval is almost never right — require(), xdmp.invokeFunction, xdmp.invoke, and xdmp.spawn, and when each applies.
  3. Amps, not broad roles, for privilege escalation — including the SJS namespace rule that makes amps fail silently.
  4. Transaction discipline — the 600 s timeout, why a query transaction cannot read its own writes, and the spawn-batching pattern.
  5. Writes carry permissions and collections explicitly.
  6. Error handling that reaches the caller — fn.error with RESTAPI-SRVEXERR.
  7. Testing with marklogic-unit-test rather than ad-hoc eval calls.

Read the full file on GitHub · 180 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 · -35 lines 41818dd74090
  2. 2mo ago First seen · 215 lines · 0 tokens per session scan A 67bd077a25c4

Subscribe to this mod's changes

marklogic-server-side-code is a skill published in the GitHub repository tternquist/marklogic-mcp (4 stars, last pushed 1mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 2,405 tokens. 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-server-side-code compared with skills from other repositories

marklogic-server-side-code next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
marklogic-server-side-codetternquist/marklogic-mcpSkill41mo agoMITA0Claude Code
event-store-designwshobson/agentsSkill42kyesterdayMITA33Claude Code
platform-custom-field-generateforcedotcom/sf-skillsSkill1.1k2d agoApache-2.0A139Claude Code
field-service-sobject-create-configureforcedotcom/sf-skillsSkill1.1k2d agoApache-2.0A74Claude Code
durable-objectsfcakyon/claude-codex-settingsSkill1.2kyesterdayApache-2.0A22Claude Code
nornicdb-grpcorneryd/NornicDBSkill923yesterdayMITA98Claude Code, Codex
nw-ddd-eventsourcingnWave-ai/nWaveSkill631yesterdayMITA38Claude Code