LaTeX数学公式渲染服务

该服务将LaTeX数学表达式渲染成PNG图像,适用于AI助手处理数学问题解决方案的图像化展示。

  • by guirguispierre
  • Python
  • 本地部署
  • 2 星标
  • 更新于
在 GitHub 查看 guirguispierre/latex-mcp

使用说明

乳胶mcp🧮

一个MCP服务器,可以将LaTeX数学表达式渲染成漂亮的PNG图像,专为Poke等AI助手构建,可以从照片中解决数学问题。

运作原理

User sends photo of math problem
→ AI (Poke) solves it
→ AI calls this MCP server with the LaTeX solution
→ Server renders it into a clean PNG image
→ AI sends the image URL back in iMessage

工具

render_solution ⭐ (主要工具)

呈现一个完整的分步解决方案,并突出显示最终答案。 返回托管图像URL(用于iMessage)和base64 PNG。

get_image_url

返回任何LaTeX表达式的托管CodeCogs URL——iOS将其内联呈现在iMessage中。

render_latex

将LaTeX渲染为base64编码的PNG进行嵌入。

MCP端点

https://latex-mcp.onrender.com/mcp

连接到Poke/Claude桌面

{
  "mcpServers": {
    "latex-mcp": {
      "command": "npx",
      "args": ["mcp-remote", "https://latex-mcp.onrender.com/mcp"]
    }
  }
}

示例用法

当Poke解决 2x + 4 = 10,它应该调用:

{
  "tool": "render_solution",
  "params": {
    "problem_description": "Solve for x: 2x + 4 = 10",
    "steps_latex": ["2x + 4 = 10", "2x = 10 - 4", "2x = 6", "x = \\frac{6}{2}"],
    "final_answer_latex": "x = 3"
  }
}

返回一个 image_url 直接在iMessage中发送。 🎉