用于通过extractous库从各种文件格式中提取文本的模型上下文协议(MCP)服务器。
# 安装依赖
uv pip install -e .
# 或者使用pip
pip install extractous-mcp
# 运行服务器
extractous-mcp
# 或者直接运行
python -m extractous_mcp.server
extract_text
file_path(必需),mime_type(可选)extract_text_with_metadata
file_path(必需),mime_type(可选)get_supported_formats
# 从PDF文件中提取文本
extract_text("/path/to/document.pdf")
# 使用特定的MIME类型提取
extract_text("/path/to/file", mime_type="application/pdf")
# 获取带有元数据的文本
extract_text_with_metadata("/path/to/document.docx")
# 检查支持的格式
get_supported_formats()
# 在开发模式下安装
uv pip install -e .
# 运行测试
python -m pytest tests/