Token导航 LogoToken导航TokenDH.com
MCP Paperstream logo
运维云端stdio官方级别未说明来源级核验

MCP Paperstream

MCP Server

一个通过众包BERTScore计算验证科学论文的游戏化平台,支持Android设备参与验证过程。

工具数

7

提示词数

0

GitHub Stars

0

资源数

0
Python云端部署Docker

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

Nileneb

提供方

Nileneb

最后核验

2026/5/17 20:20

运行时

Python

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

python -m venv .venv

详细介绍

🧬 MCP PaperStream

用于科学论文验证的分布式MCP服务器 -一个游戏化的平台,Android设备通过众包BERTScore计算验证科学论文。

🎯 核心概念

n8n Workflow → Submit Papers → MCP Server → Create Jobs
                                    ↓
              Android Devices ← Fetch Jobs ← SQLite DB
                    ↓
            Validate Sections → Submit Results → Consensus
                                                    ↓
                              Unity Game ← SSE Updates ← Leaderboard

______________________________________________________________________

📊 建筑

┌─────────────────────────────────────────────────────────────────────┐
│                    PaperStream MCP Server v1.0                       │
├─────────────────────────────────────────────────────────────────────┤
│                                                                      │
│  ┌─────────────┐    ┌─────────────┐    ┌─────────────┐              │
│  │  REST API   │    │   MCP API   │    │  Unity SSE  │              │
│  │  /api/*     │    │   /mcp      │    │  /stream    │              │
│  └──────┬──────┘    └──────┬──────┘    └──────┬──────┘              │
│         │                  │                   │                     │
│  ┌──────┴──────────────────┴───────────────────┴──────┐             │
│  │                   Starlette App                     │             │
│  └─────────────────────────┬───────────────────────────┘             │
│                            │                                         │
│  ┌─────────────────────────┴───────────────────────────┐             │
│  │                     Handlers                         │             │
│  │  ┌──────────┐  ┌──────────┐  ┌──────────┐  ┌──────┐ │             │
│  │  │  Paper   │  │   Rule   │  │   Job    │  │Device│ │             │
│  │  │ Handler  │  │ Handler  │  │ Handler  │  │Handler│             │
│  │  └────┬─────┘  └────┬─────┘  └────┬─────┘  └───┬───┘ │             │
│  └───────┼─────────────┼─────────────┼────────────┼─────┘             │
│          │             │             │            │                   │
│  ┌───────┴─────────────┴─────────────┴────────────┴─────┐             │
│  │                    SQLite Database                    │             │
│  │  papers | rules | jobs | devices | results | consensus│             │
│  └───────────────────────────────────────────────────────┘             │
│                                                                      │
│  ┌─────────────────────────┐    ┌─────────────────────────┐          │
│  │      BioBERT Handler    │    │   Paper Processor       │          │
│  │   (Embeddings, 768-dim) │    │ (PDF → Sections → Voxels)│          │
│  └─────────────────────────┘    └─────────────────────────┘          │
└─────────────────────────────────────────────────────────────────────┘

______________________________________________________________________

🚀 快速开始

先决条件

  • Python 3.12
  • 型号约2GB磁盘空间
  • (可选)AUTOMATIC1111稳定扩散WebUI

安装

# Clone repository
git clone https://github.com/Nileneb/mcp-paperstream.git
cd mcp-paperstream

# Create virtual environment
python -m venv .venv
source .venv/bin/activate

# Install dependencies
pip install torch transformers fastmcp pyyaml httpx pillow python-dotenv aiohttp uvicorn starlette requests

# Optional: PDF processing
pip install PyMuPDF

# Download models (auto-downloads from HuggingFace on first use)
python -m src.paperstream.handlers.download_model all

启动服务器

# Integrated server (recommended)
./start_server.sh

# Or manually:
python -m uvicorn src.paperstream.server_integrated:app --host 0.0.0.0 --port 8089

# MCP-only mode (BERTScore IoT):
./start_server.sh mcp

测试终点

# Health check
curl http://localhost:8089/health

# Submit paper (REST API)
curl -X POST http://localhost:8089/api/papers/submit \
  -H "Content-Type: application/json" \
  -d '{"paper_id": "PMC12345", "title": "My Paper", "priority": 7}'

# Get stats
curl http://localhost:8089/api/stats

______________________________________________________________________

🔌 n8n MCP集成

服务器通过以下方式公开MCP工具 苏格兰和南方能源公司运输 用于n8n集成。

n8n配置

  1. 添加 MCP客户端 n8n中的节点
  2. 设置URL: http://YOUR_IP:8089/sse
  3. 运输: SSE(服务器发送事件)

可用的MCP工具

工具说明
submit_paper提交新论文进行处理
create_rule使用BioBERT嵌入创建验证规则
process_paper工艺文件(摘录部分、嵌入部分)
get_paper_status获取纸张验证状态
get_leaderboard获取游戏化排行榜
get_system_stats获取系统统计信息
load_default_rules加载默认验证规则

示例:通过MCP提交论文

{
  "name": "submit_paper",
  "arguments": {
    "paper_id": "PMC12345",
    "title": "My Scientific Paper",
    "pdf_url": "https://example.com/paper.pdf",
    "priority": 8,
    "source": "n8n"
  }
}

示例:通过MCP创建规则

{
  "name": "create_rule",
  "arguments": {
    "rule_id": "is_rct",
    "question": "Is this a randomized controlled trial?",
    "positive_phrases": ["randomized controlled trial", "RCT", "clinical trial"],
    "negative_phrases": ["review", "meta-analysis"],
    "threshold": 0.75
  }
}

______________________________________________________________________

📁 项目结构

src/paperstream/
├── server_integrated.py   # Main server (REST + MCP + SSE)
├── server.py              # MCP-only server (BERTScore IoT)
├── config.yaml            # Central configuration
│
├── db/                    # Database Layer
│   ├── database.py        # SQLite manager
│   ├── models.py          # Dataclass models
│   └── migrations/        # SQL schema
│
├── api/                   # API Handlers
│   ├── paper_handler.py   # Paper CRUD
│   ├── rule_handler.py    # Rule management + BioBERT
│   ├── job_handler.py     # Job distribution
│   ├── device_handler.py  # Device registration
│   └── sse_stream.py      # Unity SSE stream
│
├── pipeline/              # Processing Pipeline
│   ├── paper_processor.py # PDF → Sections → Voxels
│   └── consensus_engine.py# Result aggregation
│
├── handlers/              # ML Handlers
│   ├── biobert_handler.py # BioBERT embeddings
│   ├── sd_api_client.py   # Stable Diffusion API
│   └── biomedclip_handler.py # BiomedCLIP (optional)
│
└── prompts/               # Prompt Templates
    ├── scientific_templates.py
    └── term_mappings.json

______________________________________________________________________

🔌 API终点

MCP(n8n集成)

端点描述
得到 /sseMCP客户端连接的SSE流
职位 /messagesMCP消息端点(JSON-RPC)
/mcpMCP检查器的流式HTTP

论文(REST API)

方法端点描述
职位/api/papers/submit提交新论文
得到/api/papers列出所有论文
得到/api/papers/{id}获取纸张详细信息

规则

方法端点描述
职位/api/rules/create创建验证规则
得到/api/rules列出活动规则

工作(安卓)

方法端点描述
得到/api/jobs/next?device_id=xxx获得下一份工作
职位/api/validation/submit提交结果

设备

方法端点描述
职位/api/devices/register注册设备
得到/api/devices/{id}获取设备信息

统一

方法端点描述
得到/api/stream/unitySSE流
得到/api/consensus/{paper_id}验证状态

系统

方法端点描述
得到/health健康检查
得到/api/stats系统统计

docs/API.md文件 获取完整文档。

______________________________________________________________________

🎮 游戏化

积分制

  • 基数:每次验证10分
  • 相似性奖励:高达40分
  • 信心奖励:高达30分
  • 匹配结果:+20分

排行榜

  • 跟踪总分、已验证的论文、找到的匹配项
  • 通过SSE向Unity实时更新

______________________________________________________________________

🔧 配置

编辑 src/paperstream/config.yaml:

server:
  host: "0.0.0.0"
  port: 8089

models:
  biobert:
    name: "nlpie/distil-biobert"
    path: "./src/paperstream/models/biobert"

consensus:
  min_votes: 3
  agreement_threshold: 0.6

jobs:
  ttl_seconds: 300
  max_per_device: 5

______________________________________________________________________

📋 数据流

  1. n8n提交论文POST /api/papers/submit
  2. 纸张处理 → 提取截面、生成嵌入、创建体素
  3. 就业创造 → 每份作业(论文×章节×规则)
  4. Android获取工作GET /api/jobs/next
  5. Android验证 → 本地比较嵌入
  6. 提交结果POST /api/validation/submit
  7. 共识计算 → 3次以上提交后的多数票
  8. Unity已通知 → SSE事件: paper_validated

______________________________________________________________________

🧪 测试

# Test all modules
python -c "
from src.paperstream.db import get_db
from src.paperstream.api import get_paper_handler, get_rule_handler
from src.paperstream.pipeline import get_consensus_engine
print('All modules OK')
"

# Initialize database
python -c "
from src.paperstream.db import get_db
db = get_db()
db.initialize()
print(f'DB: {db.db_path}')
"

# Load default rules
curl http://localhost:8089/api/stats

______________________________________________________________________

📄 许可证

MIT许可证-请参阅许可证文件。

______________________________________________________________________

🤝 贡献

  1. 分叉存储库
  2. 创建特征分支
  3. 提交拉取请求

______________________________________________________________________

📞 支持

在GitHub上发布bug或功能请求。

目录标签

目录标签

Python云端部署Docker科学论文验证本地部署分布式计算游戏化平台BERTScoreAndroid设备

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

none

运行时(runtime,运行环境)

Python

工具数量(toolCount,工具数)

7

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdionone部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP