无纸化MCP-文件管理系统
A modern, efficient document management system for the digital workplace
Features • Installation • Usage • API • Configuration • Contributing • License
概述
无纸化MCP是一个开源文档管理系统,旨在简化企业环境中数字文档的处理。它为存储、组织、搜索和处理文档提供了一个全面的解决方案,消除了对物理文书工作的需求,简化了文档工作流程。
该系统提供强大的文档处理功能,包括OCR(光学字符识别)、元数据提取和自动文档分类,同时保持严格的安全性和访问控制。
特性
文件存储和组织
- 安全云或本地文档存储
- 分层文件夹结构
- 自定义元数据和标记
- 高级搜索功能
文档处理
- 扫描文档的OCR
- 自动文档分类
- 元数据抽取
- PDF处理和操作
安全与合规
- 基于角色的访问控制
- 所有文档活动的审核日志记录
- 敏感数据加密
- 符合行业标准(GDPR、HIPAA等)
集成和可扩展性
- 用于第三方集成的RESTful API
- Webhook支持自动化
- 可定制的工作流引擎
- 用于扩展功能的插件架构
用户体验
- 直观的基于网络的用户界面
- 移动响应式设计
- 文档预览和注释
- 批处理操作,实现高效的文档处理
安装
先决条件
- Node.js(v16或更高版本)
- npm或纱线
- PostgreSQL(v13或更高版本)
- Docker(可选,用于容器化部署)
本地安装
- 克隆存储库:
git clone https://github.com/yourusername/paperless-mcp.git
cd paperless-mcp- 安装依赖项:
npm install- 设置环境变量:
cp .env.example .env
# Edit .env with your configuration- 运行数据库迁移:
npm run migrate- 启动开发服务器:
npm run devDocker安装
- 克隆存储库:
git clone https://github.com/yourusername/paperless-mcp.git
cd paperless-mcp- 构建并启动Docker容器:
docker-compose up -d该应用程序将在http://localhost:3000.
用法
基本操作
文档上传
import { DocumentService } from 'paperless-mcp';
const documentService = new DocumentService();
const result = await documentService.uploadDocument({
file: fileBuffer,
metadata: {
title: 'Invoice #12345',
category: 'Finance',
tags: ['invoice', '2023', 'vendor-abc']
}
});文献检索
const document = await documentService.getDocument(documentId);文档搜索
const searchResults = await documentService.searchDocuments({
query: 'invoice',
filters: {
category: 'Finance',
dateRange: {
from: '2023-01-01',
to: '2023-12-31'
}
},
page: 1,
limit: 20
});CLI使用情况
无纸化MCP还为管理任务提供了一个命令行界面:
# Display help
npx paperless-mcp --help
# Initialize the system
npx paperless-mcp init
# Import documents from a directory
npx paperless-mcp import --source /path/to/documents
# Run system diagnostics
npx paperless-mcp diagnoseAPI文档
无纸MCP公开了一个RESTful API,用于与其他系统集成。API可在 /api/v1 并且需要通过API密钥或JWT令牌进行认证。
认证
POST /api/v1/auth/login请求正文:
{
"username": "admin",
"password": "your-password"
}答复:
{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"expiresAt": "2023-12-31T23:59:59Z"
}API文件
创建文档
POST /api/v1/documents请求正文:
{
"title": "Invoice #12345",
"content": "Base64 encoded file content...",
"metadata": {
"category": "Finance",
"tags": ["invoice", "2023"]
}
}获取文档
GET /api/v1/documents/:id搜索文档
GET /api/v1/documents/search?q=invoice&category=Finance&from=2023-01-01&to=2023-12-31&page=1&limit=20有关API的完整参考,请参阅 API文档.
配置
无纸化MCP可以通过环境变量、配置文件或 smithery.yaml 文件。
环境变量
PORT:服务器将侦听的端口(默认值:3000)DATABASE_URL:PostgreSQL连接字符串STORAGE_TYPE:存储后端(“本地”、“s3”、“azure”等)STORAGE_PATH:本地存储路径(如果storage TYPE=本地)LOG_LEVEL:日志记录级别('debug'、'info'、'warn'、'error')JWT_SECRET:JWT令牌生成的秘密OCR_ENGINE:要使用的OCR引擎(“essract”、“azure”等)
配置文件
要进行更高级的配置,请创建 config.js 或 config.json 项目根目录中的文件。例子:
{
"server": {
"port": 3000,
"host": "0.0.0.0",
"cors": {
"enabled": true,
"origins": ["https://example.com"]
}
},
"database": {
"url": "postgresql://user:password@localhost:5432/paperless",
"pool": {
"min": 2,
"max": 10
}
},
"storage": {
"type": "s3",
"config": {
"bucket": "paperless-documents",
"region": "us-west-2"
}
}
}贡献
我们欢迎为无纸化MCP做出贡献!请随时提交问题、功能请求和拉取请求。
开发设置
- 分叉存储库
- 克隆你的叉子:
git clone https://github.com/yourusername/paperless-mcp.git - 创建要素分支:
git checkout -b feature/my-feature - 进行更改
- 运行测试:
npm test - 提交您的更改:
git commit -m 'Add my feature' - 推到分支:
git push origin feature/my-feature - 提交拉取请求
编码标准
- 我们遵循 TypeScript编码指南
- 所有代码都应正确键入
- 新功能需要进行单元测试
- 文件应随任何更改而更新
文档
- API文档是使用TypeDoc生成的
- 如果添加或更改功能,请更新README.md
- 添加新功能的示例
许可证
此项目根据MIT许可证获得许可-请参阅 许可证 文件以获取详细信息。
致谢
- 感谢所有帮助塑造这个项目的贡献者
- 特别感谢开源社区提供的工具和库,使这个项目成为可能
______________________________________________________________________
Made with ❤️ by the Paperless MCP Team
