TextIn xParse MCP Server
Enables document parsing via TextIn xParse API, supporting synchronous and asynchronous jobs with configurable options.
README
TextIn xParse MCP Server
SSE MCP server for TextIn xParse document parsing.
The server exposes these MCP tools:
parse_run: maps toclient.parse.run()parse_run_url: downloads a file URL, then maps toclient.parse.run()parse_create_job: maps toclient.parse.create_job()parse_get_job: maps toclient.parse.get_job()parse_wait_job: maps toclient.parse.wait_job()
Setup
python -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install -r requirements.txt
pip install -e .
Configure authentication with environment variables only:
$env:TEXTIN_APP_ID="your-app-id"
$env:TEXTIN_SECRET_CODE="your-secret-code"
Do not pass credentials as MCP tool arguments. The server constructs XParseClient() without explicit credentials so the official SDK reads its environment variables.
To use a custom TextIn-compatible server address, set TEXTIN_SERVER_URL:
$env:TEXTIN_SERVER_URL="https://your-server.example.com"
When TEXTIN_SERVER_URL is unset, the official SDK default server is used.
The MCP tools accept file content as base64 or as a downloadable file URL. Decoded or downloaded file size is limited by MAX_FILE_BYTES, which defaults to 52428800 bytes.
Run
textin-mcp
The default transport is SSE. You can also pass an explicit transport:
textin-mcp --transport sse
The server listens on 127.0.0.1:8000 by default. Override this for container or remote access:
$env:MCP_HOST="0.0.0.0"
$env:MCP_PORT="8000"
textin-mcp --transport sse
Docker
Build the image:
docker build -t textin-mcp .
Run the SSE MCP server:
docker run --rm -p 8000:8000 `
-e TEXTIN_APP_ID="your-app-id" `
-e TEXTIN_SECRET_CODE="your-secret-code" `
-e TEXTIN_SERVER_URL="https://your-server.example.com" `
-e MAX_FILE_BYTES="52428800" `
textin-mcp
Or run with Docker Compose:
docker compose up --build
Compose reads TEXTIN_APP_ID, TEXTIN_SECRET_CODE, optional TEXTIN_SERVER_URL, and optional MAX_FILE_BYTES from your environment or .env file. It starts the MCP SSE service on host port 8004 and the file-to-base64 helper on host port 8005.
File to Base64 Helper
The helper is a regular HTTP service, not an MCP SSE endpoint. It accepts a multipart file upload and returns the payload needed by parse_run or parse_create_job.
Run locally:
textin-file-base64
By default it listens on 0.0.0.0:8001. Override with:
$env:FILE_BASE64_HOST="0.0.0.0"
$env:FILE_BASE64_PORT="8001"
textin-file-base64
Request:
curl.exe -X POST "http://127.0.0.1:8005/file-to-base64" `
-F "file=@D:\docs\example.pdf"
Response:
{
"filename": "example.pdf",
"mime_type": "application/pdf",
"size": 12345,
"base64": "JVBERi0x..."
}
The same service also provides a simple browser upload and download UI:
GET /: upload pagePOST /upload: upload and store a fileGET /files/{file_id}: download a stored fileGET /files/{file_id}/base64: get stored file content as base64
POST /upload returns:
{
"file_id": "abc123",
"filename": "example.pdf",
"mime_type": "application/pdf",
"size": 12345,
"download_url": "http://168.8.6.168:8005/files/abc123",
"base64_url": "http://168.8.6.168:8005/files/abc123/base64"
}
Stored files are written under FILE_STORAGE_DIR, which defaults to /data/files in the container. Docker Compose mounts this path to the file_storage volume.
Uploaded files are cleaned up automatically. By default, files older than 7 days are removed every hour:
$env:FILE_RETENTION_SECONDS="604800"
$env:FILE_CLEANUP_INTERVAL_SECONDS="3600"
Set FILE_RETENTION_SECONDS=0 to disable automatic cleanup.
Set FILE_PUBLIC_BASE_URL when users access the helper from another machine so upload results contain complete URLs with the reachable host:
$env:FILE_PUBLIC_BASE_URL="http://168.8.6.168:8005"
docker compose up --build
Tools
parse_run
Synchronously parse a base64-encoded document.
Parameters:
filename: document filename, for exampleexample.pdffile_base64: base64-encoded document contentpage_range: optional page range, for example1-10password: optional encrypted PDF passwordinclude_hierarchyinclude_inline_objectsinclude_char_detailsinclude_image_datainclude_table_structurepagestitle_treetable_view:markdownorhtml
parse_run_url
Synchronously parse a document from a downloadable file URL.
Parameters:
file_url: downloadable file URL, for examplehttp://168.8.6.168:8005/files/abc123filename: optional document filename override; when omitted, the filename is inferred fromfile_url- all parse configuration parameters supported by
parse_run
parse_create_job
Create an asynchronous parsing job.
Parameters:
filename: document filename, for exampleexample.pdffile_base64: base64-encoded document contentwebhook: optional completion callback URL- all parse configuration parameters supported by
parse_run
parse_get_job
Query an asynchronous parsing job.
Parameters:
job_id
parse_wait_job
Poll until an asynchronous parsing job finishes.
Parameters:
job_idtimeout: default300.0poll_interval: default5.0download_result: when true, downloadsresult_urlafter completion
MCP Client Example
{
"mcpServers": {
"textin-xparse": {
"url": "http://127.0.0.1:8000/sse"
}
}
}
Reference
- TextIn Python SDK documentation: https://docs.textin.com/xparse/v1/sdk-python
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。