Define-XML MCP Server

Local setup required. This server has to be cloned and prepared on your machine before you register it in Claude Code.
1

Set the server up locally

Run this once to clone and prepare the server before adding it to Claude Code.

Run in terminal
npm install
npm run build
2

Register it in Claude Code

After the local setup is done, run this command to point Claude Code at the built server.

Run in terminal
claude mcp add define-xml -- node "<FULL_PATH_TO_DEFINE_MCP>/dist/index.js"

Replace <FULL_PATH_TO_DEFINE_MCP>/dist/index.js with the actual folder you prepared in step 1.

README.md

TypeScript MCP server for CDISC Define-XML 2.0 and 2.1 files

define-xml-mcp-server

TypeScript MCP server for CDISC Define-XML.

Features

  • Supports Define-XML 2.0 and 2.1
  • Detects Define version and ARM presence from ODM attributes
  • Supports both MCP transports:
    • stdio (default)
    • Streamable HTTP (/mcp endpoint)
  • Local file-path input only
  • Multi-document in-memory cache using document_id
  • Response formats:
    • json
    • markdown

Install

npm install

Build

npm run build

Run

stdio (default)

npm run dev

or

node dist/index.js --transport=stdio

Streamable HTTP

node dist/index.js --transport=http --port=3000

Server endpoint:

  • POST /mcp

Tool Catalog

Document Tools

  • define_load_document
    • Input: file_path, response_format
    • Loads/parses XML and returns document_id
  • define_close_document
    • Input: document_id, response_format
    • Removes document from cache
  • define_get_metadata_summary
    • Input: document_id, response_format
    • Returns metadata and entity counts

Required List/Get Tools

  • Datasets
    • define_list_datasets
    • define_get_dataset
  • Variables
    • define_list_variables
    • define_get_variable
  • Codelists
    • define_list_codelists
    • define_get_codelist
  • ARM
    • define_list_arm_results
    • define_get_arm_result

Search Tool

  • define_search

Notes

  • ARM is optional. ARM tools return empty results when ARM data is not present.
  • All list tools support pagination via offset and limit.

Tools (12)

define_load_documentLoads and parses an XML file and returns a document_id.
define_close_documentRemoves a document from the in-memory cache.
define_get_metadata_summaryReturns metadata and entity counts for a loaded document.
define_list_datasetsLists datasets within a document.
define_get_datasetRetrieves details for a specific dataset.
define_list_variablesLists variables within a document.
define_get_variableRetrieves details for a specific variable.
define_list_codelistsLists codelists within a document.
define_get_codelistRetrieves details for a specific codelist.
define_list_arm_resultsLists ARM results if present in the document.
define_get_arm_resultRetrieves details for a specific ARM result.
define_searchSearches for information within the document.

Configuration

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

Try it

Load the Define-XML file at /path/to/study/define.xml and give me a summary of the metadata.
List all datasets available in the loaded document.
Search for the variable 'USUBJID' in the current document.
Get the details for the 'AE' dataset.

Frequently Asked Questions

What are the key features of Define-XML MCP Server?

Supports CDISC Define-XML 2.0 and 2.1 standards. Detects Define version and ARM presence automatically. Supports stdio and streamable HTTP transports. Multi-document in-memory caching. Provides output in JSON or Markdown formats.

What can I use Define-XML MCP Server for?

Clinical programmers verifying metadata consistency in Define-XML files.. Data managers searching for specific variable definitions across large study documents.. Automated documentation generation for clinical study reports.. Quickly inspecting dataset structures without opening heavy XML editors..

How do I install Define-XML MCP Server?

Install Define-XML MCP Server by running: npm install && npm run build

What MCP clients work with Define-XML MCP Server?

Define-XML MCP Server works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep Define-XML MCP Server docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare