MDX MCP Server

MDX MCP Server

Enables LLMs to read, search, convert, and extract metadata from MDX files, providing seamless interaction with MDX content through tools that convert MDX to clean Markdown format with built-in security and cross-platform compatibility.

Category
访问服务器

README

<div align="center"> <h1>MDX MCP Server</h1> <p>Universal MCP server for intelligent MDX file processing and analysis</p> </div>

<div align="center"> <img src="https://img.shields.io/badge/Node.js-20%2B-green?style=for-the-badge&logo=node.js&logoColor=white"> <img src="https://img.shields.io/badge/License-MIT-blue?style=for-the-badge"> <img src="https://img.shields.io/badge/Platforms-Win%20%7C%20macOS%20%7C%20Linux-blue?style=for-the-badge"> <a href="https://github.com/LLMTooling/mdx-mcp-server/actions/workflows/test.yml"> <img src="https://img.shields.io/github/actions/workflow/status/LLMTooling/mdx-mcp-server/test.yml?style=for-the-badge&label=Tests"> </a> </div>

<div align="center"> <h2>Overview</h2> </div>

<div align="center">

MDX MCP Server is a powerful Model Context Protocol server that enables LLMs to seamlessly interact with, search, and process MDX files. It provides robust tools for reading MDX content as clean Markdown, performing contextual searches, converting files, and extracting metadata, all with built-in cross-platform compatibility and security.

</div>

<div align="center"> <h2>Core Features</h2> </div>

<div align="center"> <table> <tr> <th>Feature</th> <th>Description</th> </tr> <tr> <td>MDX Reading</td> <td>Convert MDX to clean Markdown format on the fly</td> </tr> <tr> <td>Contextual Search</td> <td>Find content within MDX files with surrounding context</td> </tr> <tr> <td>Format Conversion</td> <td>Convert and save MDX files to standard Markdown</td> </tr> <tr> <td>Metadata Extraction</td> <td>Parse and retrieve YAML frontmatter</td> </tr> <tr> <td>Cross-Platform</td> <td>Native support for Windows, Linux, and macOS</td> </tr> <tr> <td>Path Safety</td> <td>Secure path resolution preventing directory traversal</td> </tr> </table> </div>

<div align="center"> <h2>MCP Tools</h2> </div>

<div align="center">

The server exposes the following tools through the Model Context Protocol interface.

</div>

<div align="center"> <table> <tr> <th>Tool</th> <th>Description</th> <th>Key Parameters</th> </tr> <tr> <td><code>read_mdx</code></td> <td>Read an MDX file and return its contents as Markdown</td> <td>path</td> </tr> <tr> <td><code>search_mdx</code></td> <td>Search for content within an MDX file</td> <td>path, query, contextLines</td> </tr> <tr> <td><code>convert_mdx_to_md</code></td> <td>Convert an MDX file to a Markdown file on disk</td> <td>sourcePath, outputPath</td> </tr> <tr> <td><code>get_mdx_frontmatter</code></td> <td>Extract YAML frontmatter from an MDX file</td> <td>path</td> </tr> </table> </div>

<div align="center"> <h2>Tool Usage Examples</h2> </div>

<div align="center">

See how the tools can be leveraged to interact with MDX files.

</div>

// Read an MDX file
{
  "name": "read_mdx",
  "arguments": {
    "path": "docs/introduction.mdx"
  }
}

// Search with context
{
  "name": "search_mdx",
  "arguments": {
    "path": "docs/guide.mdx",
    "query": "installation",
    "contextLines": 2
  }
}

// Convert MDX to Markdown
{
  "name": "convert_mdx_to_md",
  "arguments": {
    "sourcePath": "docs/guide.mdx",
    "outputPath": "output/guide.md"
  }
}

// Extract metadata
{
  "name": "get_mdx_frontmatter",
  "arguments": {
    "path": "docs/article.mdx"
  }
}

<div align="center"> <h2>Installation</h2> </div>

<div align="center">

Prerequisites

</div>

Ensure you have Node.js installed:

# Node.js >= 20.19.0 is required
node --version

<div align="center">

Install the MCP Server

</div>

npm install
npm run build

<div align="center"> <h2>Configuration</h2> </div>

Add to your MCP settings file (e.g., claude_desktop_config.json):

{
  "mcpServers": {
    "mdx": {
      "command": "node",
      "args": ["/absolute/path/to/mdx-mcp-server/dist/index.js"],
      "env": {
        "WORKSPACE_ROOT": "/path/to/your/workspace"
      }
    }
  }
}

<div align="center"> <h2>Development</h2> </div>

# Clone the repository
git clone https://github.com/LLMTooling/mdx-mcp-server.git
cd mdx-mcp-server

# Install dependencies
npm install

# Build the project
npm run build

# Run tests
npm test

# Run tests in watch mode
npm run test:watch

<div align="center"> <h2>Architecture</h2> </div>

<div align="center">

The server follows a modular architecture ensuring clean separation of concerns.

</div>

<div align="center"> <table> <tr> <th>Component</th> <th>Responsibility</th> </tr> <tr> <td>Server Entry</td> <td>Main MCP server setup and configuration (<code>src/index.ts</code>)</td> </tr> <tr> <td>Tools Module</td> <td>Implementation of individual MCP tools (<code>src/tools/</code>)</td> </tr> <tr> <td>Path Resolver</td> <td>Cross-platform path handling and security (<code>src/utils/path-resolver.ts</code>)</td> </tr> <tr> <td>MDX Processor</td> <td>Core MDX processing logic (<code>src/utils/mdx-processor.ts</code>)</td> </tr> </table> </div>

<div align="center"> <h2>Contributing</h2> </div>

<div align="center">

Contributions are welcome! Please feel free to submit issues or pull requests.

</div>

<div align="center"> <h2>License</h2> </div>

<div align="center">

MIT License

</div>

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选