loading…
Search for a command to run...
loading…
Enables text extraction from images and PDF files using the ZhipuAI GLM-OCR API. It allows users to process documents through local file paths or base64-encoded
Enables text extraction from images and PDF files using the ZhipuAI GLM-OCR API. It allows users to process documents through local file paths or base64-encoded data for high-quality OCR results.
MCP server for extracting text from images and PDFs using ZhipuAI GLM-OCR.
{
"mcpServers": {
"glm-ocr": {
"command": "uvx",
"args": ["glm-ocr-mcp"],
"env": {
"ZHIPU_API_KEY": "your_api_key_here",
"ZHIPU_OCR_API_URL": "https://open.bigmodel.cn/api/paas/v4/layout_parsing"
}
}
}
}
claude mcp add --scope user glm-ocr \
--env ZHIPU_API_KEY=your_api_key_here \
--env ZHIPU_OCR_API_URL=https://open.bigmodel.cn/api/paas/v4/layout_parsing \
-- uvx glm-ocr-mcp
Add MCP server with command:
codex mcp add glm-ocr \
--env ZHIPU_API_KEY=your_api_key_here \
--env ZHIPU_OCR_API_URL=https://open.bigmodel.cn/api/paas/v4/layout_parsing \
-- uvx glm-ocr-mcp
The server provides one tool:
png, jpg/jpeg, pdf)return_json=true to return structured JSON without md_results (contains page parsing details like bbox_2d, content, label, etc.)Parameters:
png, jpg/jpeg, or pdffile_path is unavailable)false. true returns JSON; false returns Markdown.# Extract text from local image
extract_text(file_path="./screenshot.png")
# Extract text from local PDF
extract_text(file_path="./document.pdf")
# Extract text from URL image
extract_text(file_path="https://example.com/test.jpg")
# Use base64/data URL
extract_text(base64_data="data:image/png;base64,iVBORw0KGgo...")
# Extract structured layout JSON
extract_text(file_path="https://example.com/test.png", return_json=True)
# Create virtual environment
uv venv
source .venv/bin/activate
# Sync dependencies and install current project
uv sync
# Run server for testing
python -m glm_ocr_mcp.server
Windows PowerShell activation:
.venv\Scripts\Activate.ps1
glm-ocr-mcp/
├── pyproject.toml # Project configuration
├── README.md # Documentation
├── .env.example # Environment variable template
├── src/
│ └── glm_ocr_mcp/
│ ├── __init__.py
│ ├── __main__.py # Entry point
│ ├── ocr.py # OCR client
│ └── server.py # MCP server
Добавь это в claude_desktop_config.json и перезапусти Claude Desktop.
{
"mcpServers": {
"glm-ocr-mcp-server": {
"command": "npx",
"args": []
}
}
}