LaTeX to MathML MCP Server
Converts LaTeX mathematical expressions to MathML format using MathJax-node.
LaTeX to MathML MCP Server
A Model Context Protocol (MCP) server that converts LaTeX mathematical expressions to MathML format. And this README.md is written by DeepSeek V3.
Features
- Converts LaTeX mathematical expressions to MathML
- Provides both tool-based conversion and resource-based access
- Standard MCP protocol implementation for easy integration
- Lightweight and fast conversion using MathJax-node
Installation
-
Clone this repository:
git clone https://github.com/HappyAny/latex-mathml-mcp-server.git cd latex-mathml-mcp-server -
Install dependencies:
npm install mathjax-node npm install @modelcontextprotocol/sdk
Usage
Starting the Server
Run the server using Node.js:
node index.js
The server will start and listen for MCP client connections via stdio transport.
Available Services
-
Tool-based Conversion:
- Tool name:
latex2mathml - Input: LaTeX string
- Output: MathML string
- Tool name:
-
Resource-based Access:
- Resource URI pattern:
mathml://{latex_expression} - Returns: MathML representation of the LaTeX expression
- Resource URI pattern:
Client Integration
To connect to this server from an MCP client, add the following configuration to your client's settings:
{
"mcpServers": {
"latex-mathml-server": {
"isActive": true,
"command": "node",
"args": [
"path_to_your_server/index.js"
]
}
}
}
Replace path_to_your_server/index.js with the actual path to the server script.
API Details
Tool: latex2mathml
Request Format:
{
"latex": "your_LaTeX_expression"
}
Example Request:
{
"latex": "E = mc^2"
}
Response Format:
{
"content": [
{
"type": "text",
"text": "<math xmlns=\"http://www.w3.org/1998/Math/MathML\">...</math>"
}
]
}
Resource: mathml://{id}
Access mathematical expressions as resources using the URI pattern:
mathml://E%20%3D%20mc%5E2
(Note: LaTeX expressions should be URL-encoded in the resource URI)
Development
Dependencies
@modelcontextprotocol/sdk: MCP server SDKmathjax-node: LaTeX to MathML conversionzod: Input validation
Building
This is a Node.js project. Simply clone and install dependencies as shown in the Installation section.
License
MIT
Related Servers
Scout Monitoring MCP
sponsorPut performance and error data directly in the hands of your AI assistant.
Alpha Vantage MCP Server
sponsorAccess financial market data: realtime & historical stock, ETF, options, forex, crypto, commodities, fundamentals, technical indicators, & more
Atla
Enable AI agents to interact with the Atla API for state-of-the-art LLMJ evaluation.
XcodeProj MCP Server
An MCP server for manipulating Xcode project files (.xcodeproj) using Swift. Requires Docker and macOS.
AI Intervention Agent
An MCP server for real-time user intervention in AI-assisted development workflows.
Remote MCP Server (Authless)
An example of a remote MCP server deployable on Cloudflare Workers, without authentication.
Jira Context MCP
MCP server to provide Jira Tickets information to AI coding agents like Cursor.
mcp-agent-kit
a complete and intuitive SDK for building MCP Servers, MCP Agents, and LLM integrations (OpenAI, Claude, Gemini) with minimal effort. It abstracts all the complexity of the MCP protocol, provides an intelligent agent with automatic model routing, and includes a universal client for external APIs all through a single, simple, and powerful interface. Perfect for chatbots, enterprise automation, internal system integrations, and rapid development of MCP-based ecosystems.
MCP TypeScript Implementation
A TypeScript implementation of the Model Context Protocol for the Personal Intelligence Framework.
Tree-Hugger-JS
Analyze and transform JavaScript/TypeScript code using the tree-hugger-js library.
MiniMax MCP
Interact with MiniMax's powerful APIs for text-to-speech, voice cloning, and video/image generation.
Mezmo MCP
Mezmo's remote MCP server connects AI assistants to Mezmo's Observability platform so you can run advanced root-cause analysis, discover pipelines, and export logs without hosting anything yourself.