时光倒流MCP服务器
TimeBack 1EdTech平台的综合模型上下文协议(MCP)服务器,可帮助开发人员同步数据模型、管理集成以及使用教育技术API。
概述
TimeBack MCP服务器提供了一个统一的接口,用于使用所有五个TimeBack 1EdTech API:
- QTI(问题和测试互操作性) -教育评估的评估引擎
- OneRoster -学生信息和名册数据交换
- 卡尺 -学习分析和活动跟踪
- PowerPath -掌握学习和个性化学习路径
- 案例 -能力与学术标准交流
特性
🛠️ 开发者工具
- 多API集成 -通过一个接口使用所有5个TimeBack API
- 数据模型同步 -跨不同API比较和同步数据模型
- 架构验证 -根据OpenAPI规范验证数据
- 集成映射 -为API集成生成模板
- 综合搜索 -搜索所有API文档和架构
- 智能代码库分析 -分析您现有的代码库,并获得量身定制的TimeBack集成建议
- 高级文档爬虫 -自动从多个来源抓取、索引和搜索TimeBack文档
- 多格式文档支持 -处理Swagger/OpenAPI、标量文档、谷歌文档和视频内容
- 智能内容提取 -从文档中提取代码示例、API模式和集成指南
🔧 MCP工具
核心API工具
load-timeback-specs-加载所有TimeBack OpenAPI规范analyze-api-endpoints-通过API、标记或方法进行筛选来分析终结点search-api-documentation-搜索所有API文档compare-data-models-比较不同API之间的模式generate-integration-mapping-创建集成模板validate-api-integration-验证集成配置generate-api-documentation-生成全面的API文档
智能分析工具
analyze-codebase-integration-分析您的代码库并推荐TimeBack集成
文档爬虫工具
crawl-timeback-documentation-从多个来源抓取和索引全面的TimeBack文档search-comprehensive-docs-使用高级筛选在所有已爬网文档中搜索get-api-examples-从文档中提取和检索代码示例compare-api-implementations-比较不同文档格式的API实现get-integration-patterns-从抓取的内容中获取集成模式和最佳实践
📚 MCP资源
timeback://apis/overview-所有TimeBack API概述timeback://schemas/all-完整的架构定义timeback://endpoints/all-所有API端点timeback://integration/templates-集成模板
安装
- 克隆存储库:
git clone https://github.com/dannygauntletai/timeback-mcp-server.git
cd timeback-mcp-server- 安装依赖项:
npm install- 构建项目:
npm run build- 配置环境变量:
cp .env.example .env
# Edit .env with your TimeBack API credentials and crawler settings- 初始化文档爬网程序(可选):
npm run crawler:init
# Downloads and indexes initial documentation配置
创建一个 .env 包含TimeBack平台凭据的文件:
# TimeBack API Base URLs
TIMEBACK_QTI_BASE_URL=https://qti.alpha-1edtech.com/api
TIMEBACK_ONEROSTER_BASE_URL=https://api.alpha-1edtech.com
TIMEBACK_CALIPER_BASE_URL=https://caliper.alpha-1edtech.com
TIMEBACK_POWERPATH_BASE_URL=https://api.alpha-1edtech.com
TIMEBACK_CASE_BASE_URL=https://api.alpha-1edtech.com
# OAuth2 Configuration
OAUTH2_TOKEN_URL=https://alpha-auth-production-idp.auth.us-west-2.amazoncognito.com/oauth2/token
CLIENT_ID=your_client_id
CLIENT_SECRET=your_client_secret
# Server Configuration
MCP_SERVER_NAME=timeback-mcp-server
MCP_SERVER_VERSION=1.0.0
LOG_LEVEL=info
# Documentation Crawler Configuration
CRAWLER_MAX_RETRIES=3
CRAWLER_RETRY_DELAY=2000
CRAWLER_TIMEOUT=30000
CRAWLER_RATE_LIMIT=1000
CRAWLER_RESPECT_ROBOTS_TXT=true
CRAWLER_SCHEDULE_ENABLED=true
CRAWLER_SCHEDULE_INTERVAL=24h
CRAWLER_INCREMENTAL_UPDATES=true
CRAWLER_EXTRACT_CODE_EXAMPLES=true
CRAWLER_BUILD_RELATIONSHIPS=true
CRAWLER_INDEX_METADATA=true用法
运行MCP服务器
npm start发展模式
npm run dev爬行器管理
# Initialize crawler and download documentation
npm run crawler:init
# Run crawler manually
npm run crawler:run
# Check crawler status
npm run crawler:status
# Clear crawler cache
npm run crawler:clear与Claude Desktop一起使用
添加到您的Claude Desktop MCP配置中:
{
"mcpServers": {
"timeback": {
"command": "node",
"args": ["/path/to/timeback-mcp-server/build/index.js"],
"env": {
"CLIENT_ID": "your_client_id",
"CLIENT_SECRET": "your_client_secret"
}
}
}
}示例用法
加载回退API规范
Use the load-timeback-specs tool to load all API specifications:
- Loads QTI, OneRoster, Caliper, PowerPath, and CASE APIs
- Parses OpenAPI specifications
- Makes all endpoints and schemas available for analysis搜索API文档
Use search-api-documentation to find relevant endpoints:
- Query: "student"
- Search in: endpoints, schemas, descriptions
- Filter by specific API if needed比较数据模型
Use compare-data-models to understand schema differences:
- Compare OneRoster "User" with QTI "Candidate"
- Identify common properties and differences
- Generate mapping suggestions生成集成模板
Use generate-integration-mapping for common integrations:
- Source: OneRoster (student data)
- Target: Caliper (learning analytics)
- Use case: "sync-student-data"分析您的代码库以实现TimeBack集成
Use analyze-codebase-integration to get personalized recommendations:
- Provide path to your application codebase
- Get systematic analysis of your project structure, dependencies, and patterns
- Receive tailored TimeBack API integration suggestions
- Get specific data models, endpoints, environment variables, and implementation steps示例用法:
"How do I integrate my codebase with TimeBack?"
Input: { "projectPath": "/path/to/your/app" }
Output: Comprehensive analysis including:
- Detected project type, language, and framework
- Identified educational patterns (user management, assessments, analytics)
- Prioritized TimeBack API recommendations (OneRoster, QTI, Caliper, etc.)
- Specific integration steps and code examples
- Required environment variables and dependencies该工具几乎就像对您的代码库进行深入的研究,结合MCP服务器对TimeBack API的了解,根据您的实际应用程序结构和需求提供智能建议。
文档爬虫架构
TimeBack MCP服务器包括一个复杂的文档抓取器,可自动为来自多个TimeBack API源的综合文档编制索引。
🕷️ 爬行器功能
支持的文档格式
- Swagger/OpenAPI文档 -交互式API文档和实际示例
- 标量文档 -具有增强的用户体验的现代API文档
- 谷歌文件 -内嵌内容的富文本文档
- 视频内容 -织机视频和其他教育内容(元数据提取)
- 静态的 -传统文档网站
爬网文档源
- API QTI: https://qti.alpha-1edtech.com/docs/,OpenAPI规范,谷歌文档指南
- OneRoster API: https://api.alpha-1edtech.com/scalar/OpenAPI规范
- API井径仪: https://caliper.alpha-1edtech.com/,全面的分析文档
- PowerPath API: https://api.alpha-1edtech.com/scalar?api=powerpath-api,掌握学习文档
- 案例API: https://api.alpha-1edtech.com/scalar?api=case-api、标准文档
- OpenBadge和CLR:视频演练和实施指南
🔍 高级文档工具
爬网回溯文档
Use crawl-timeback-documentation to index all available documentation:
- Automatically discovers and crawls all TimeBack API documentation
- Extracts code examples, integration patterns, and best practices
- Builds searchable index with relationships between concepts
- Supports incremental updates and scheduling搜索综合文档
Use search-comprehensive-docs for intelligent documentation search:
- Query: "student enrollment workflow"
- Search across: all APIs, code examples, integration guides
- Filter by: API type, content format, difficulty level
- Get: relevant snippets with source links and context摘录API示例
Use get-api-examples to find implementation examples:
- API: "oneroster"
- Functionality: "create student"
- Returns: code examples, request/response samples, integration patterns比较API实现
Use compare-api-implementations to understand differences:
- Source API: "oneroster" (user management)
- Target API: "caliper" (person entities)
- Functionality: "user representation"
- Returns: detailed comparison with mapping suggestions获取集成模式
Use get-integration-patterns for best practices:
- APIs: ["oneroster", "caliper"]
- Use Case: "student analytics pipeline"
- Difficulty: "intermediate"
- Returns: step-by-step integration patterns with code examples⚙️ 爬行器配置
爬虫支持广泛的配置选项:
# Crawler Settings
CRAWLER_MAX_RETRIES=3
CRAWLER_RETRY_DELAY=2000
CRAWLER_TIMEOUT=30000
CRAWLER_RATE_LIMIT=1000
CRAWLER_RESPECT_ROBOTS_TXT=true
# Scheduling
CRAWLER_SCHEDULE_ENABLED=true
CRAWLER_SCHEDULE_INTERVAL=24h
CRAWLER_INCREMENTAL_UPDATES=true
# Content Processing
CRAWLER_EXTRACT_CODE_EXAMPLES=true
CRAWLER_BUILD_RELATIONSHIPS=true
CRAWLER_INDEX_METADATA=true🏗️ 履带式架构
组件
- 文档爬虫 -支持多种格式的核心爬行引擎
- 文档索引器 -具有全文搜索和关系的高级索引
- 文档库 -具有版本控制和缓存的持久存储
- 爬虫调度器 -自动调度和增量更新
处理管线
- 发现 -确定文档来源和格式
- 爬行 -使用特定格式的解析器提取内容
- 处理 -清洁、结构化和增强内容
- 索引 -使用关系构建可搜索索引
- 存储 -坚持版本控制和元数据
- 服务 -通过MCP工具提供快速搜索和检索
内容增强
- 代码示例提取 -自动识别和提取代码片段
- 建立关系 -跨不同API连接相关概念
- 模式识别 -确定常见的集成模式和最佳实践
- 元数据丰富 -添加标签、类别和难度级别
MCP服务器集成模式
TimeBack MCP Server支持高级集成模式,使其能够与其他MCP服务器无缝协作,创建强大的多服务器工作流和数据共享功能。
🔗 集成体系结构
TimeBack MCP服务器既可以作为独立的MCP服务器,也可以作为集成中心,可以:
- 链接多个MCP服务器 适用于复杂的工作流程
- 编写工具 从不同的服务器到统一的操作
- 共享资源 跨越服务器边界
- 发出实时事件 用于集成状态更改
- 提供SSE端点 用于MCP Hive风格的集成
🛠️ 集成模式
1.MCP服务器链式模式
将多个MCP服务器链接起来,以创建跨越不同域的复杂、多步骤的工作流。
用例:结合学生数据(OneRoster)、评估创建(QTI)和分析跟踪(Caliper)的教育工作流程
配置:
INTEGRATION_ENABLED=true
INTEGRATION_SERVER_CHAINING=true工作流示例:
{
"name": "student-assessment-workflow",
"workflow": [
{
"id": "fetch-students",
"server": "oneroster-server",
"tool": "get-students",
"params": { "classId": "class-123" }
},
{
"id": "create-assessment",
"server": "timeback",
"tool": "generate-qti-assessment",
"params": { "subject": "math", "difficulty": "intermediate" },
"dependsOn": ["fetch-students"]
},
{
"id": "track-analytics",
"server": "analytics-server",
"tool": "setup-tracking",
"params": { "assessmentId": "${create-assessment.result.id}" },
"dependsOn": ["create-assessment"]
}
]
}2.刀具组合模式
将来自多个MCP服务器的工具组合成统一的操作,这些操作对客户端来说是单一的工具。
用例:创建一个“完整的学生入职”工具,结合用户创建、注册和初始评估设置
配置:
INTEGRATION_ENABLED=true
INTEGRATION_TOOL_COMPOSITION=true用法:
# Use the compose-integration-workflow tool
# This creates a unified workflow from multiple server tools3.共享资源模式
跨多个MCP服务器共享文档、模式和集成模式等资源。
用例:多个教育MCP服务器可以访问TimeBack全面的API文档和集成模板
配置:
INTEGRATION_ENABLED=true
INTEGRATION_SHARED_RESOURCES=true可用共享资源:
timeback://integration/patterns-集成模式和最佳实践timeback://integration/servers-连接的服务器信息和功能timeback://documentation/indexed-所有带索引的TimeBack API文档
4.事件驱动集成模式
集成状态更改、服务器连接和工作流完成的实时事件通知。
用例:当TimeBack集成状态更改或工作流完成时,通知相关系统
配置:
INTEGRATION_ENABLED=true
INTEGRATION_EVENT_DRIVEN=true事件类型:
server_connected-已连接新的MCP服务器server_disconnected-MCP服务器已断开连接workflow_completed-集成工作流已完成workflow_failed-集成工作流遇到错误
5.基于SSE的集成模式(兼容MCP Hive)
服务器发送事件端点,用于与MCP Hive和其他SSE兼容系统实时集成。
用例:显示TimeBack集成状态和实时工作流执行的实时仪表板
配置:
INTEGRATION_ENABLED=true
INTEGRATION_SSE=true
INTEGRATION_SSE_ENABLED=true
INTEGRATION_SSE_PORT=3001
INTEGRATION_SSE_CORS_ORIGINS=*SSE 端点:
GET /events-SSE主要事件流GET /events/health-健康检查端点GET /events/stats-集成统计POST /events/broadcast-广播自定义事件
🔧 集成工具
TimeBack MCP服务器提供了用于管理集成的专用工具:
connect-mcp-server
连接到下游MCP服务器以进行集成工作流。
{
"name": "connect-mcp-server",
"arguments": {
"name": "analytics-server",
"transport": "sse",
"url": "http://localhost:3002"
}
}get-integration-status
获取所有集成和连接服务器的当前状态。
{
"name": "get-integration-status",
"arguments": {}
}get-integration-health
对集成管理器和连接的服务器执行健康检查。
{
"name": "get-integration-health",
"arguments": {}
}compose-integration-workflow
创建和执行多服务器工作流。
{
"name": "compose-integration-workflow",
"arguments": {
"name": "student-data-sync",
"workflow": [...]
}
}🔐 身份验证策略
TimeBack MCP服务器使用分层身份验证方法进行多服务器集成:
主要身份验证
- OAuth2客户端凭据 TimeBack API的流程
- 自动令牌刷新和缓存
- 通过环境变量保护凭据存储
代理身份验证
- 凭证转发 需要时连接到下游MCP服务器
- 代币共享 适用于支持TimeBack身份验证的服务器
- 隔离身份验证 适用于具有独立身份验证系统的服务器
配置
# Primary TimeBack Authentication
OAUTH2_TOKEN_URL=https://alpha-auth-production-idp.auth.us-west-2.amazoncognito.com/oauth2/token
CLIENT_ID=your_client_id
CLIENT_SECRET=your_client_secret
# Integration Authentication (optional)
INTEGRATION_AUTH_FORWARD=true
INTEGRATION_AUTH_TIMEOUT=30000🚀 集成入门
1.启用集成功能
# Basic integration setup
INTEGRATION_ENABLED=true
INTEGRATION_SERVER_CHAINING=true
INTEGRATION_TOOL_COMPOSITION=true
INTEGRATION_SHARED_RESOURCES=true2.连接到其他MCP服务器
# Use the connect-mcp-server tool to establish connections
# Supports HTTP, WebSocket, and SSE transports3.创建集成工作流
# Use compose-integration-workflow to create multi-server workflows
# Define dependencies and data flow between servers4.监控集成运行状况
# Use get-integration-status and get-integration-health
# Monitor connected servers and workflow execution🌐 MCP配置单元兼容性
TimeBack MCP服务器与MCP Hive集成模式完全兼容:
- SSE 运输:使用标准服务器发送事件进行实时通信
- 事件架构:与MCP Hive事件格式兼容
- 健康终点:标准健康检查和统计端点
- CORS支持:可配置的CORS,用于基于网络的集成
📋 集成配置参考
# Core Integration Settings
INTEGRATION_ENABLED=true # Enable integration features
INTEGRATION_SERVER_CHAINING=true # Enable server chaining pattern
INTEGRATION_TOOL_COMPOSITION=true # Enable tool composition pattern
INTEGRATION_SHARED_RESOURCES=true # Enable shared resource pattern
INTEGRATION_EVENT_DRIVEN=true # Enable event-driven pattern
INTEGRATION_SSE=true # Enable SSE-based pattern
# SSE Configuration
INTEGRATION_SSE_ENABLED=true # Enable SSE endpoints
INTEGRATION_SSE_PORT=3001 # SSE server port
INTEGRATION_SSE_CORS_ORIGINS=* # CORS origins (comma-separated)
# Authentication
INTEGRATION_AUTH_FORWARD=true # Forward auth to downstream servers
INTEGRATION_AUTH_TIMEOUT=30000 # Auth timeout in millisecondsAPI集成示例
学生数据同步
// 1. Fetch students from OneRoster
// 2. Map to Caliper Person entities
// 3. Track learning activities评估工作流程
// 1. Create assessment in QTI
// 2. Track attempts in Caliper
// 3. Update mastery in PowerPath
// 4. Map to CASE standards发展
项目结构
src/
├── config/ # Configuration management
├── server/ # Main MCP server implementation
├── services/ # Core services
│ ├── auth.ts # OAuth2 authentication
│ ├── openapi-parser.ts # OpenAPI specification parsing
│ ├── codebase-analyzer.ts # Intelligent codebase analysis
│ ├── documentation-crawler.ts # Multi-format documentation crawler
│ ├── documentation-indexer.ts # Advanced search and indexing
│ ├── documentation-store.ts # Persistent storage with versioning
│ └── crawler-scheduler.ts # Automated crawling and updates
├── utils/ # Utilities (logging, errors)
└── types/ # TypeScript type definitions添加新工具
- 在中定义工具架构
setupToolHandlers() - 在服务器类中实现工具逻辑
- 添加适当的错误处理和日志记录
- 更新文档
测试
npm testTimeBack平台API
QTI(问题和测试互操作性)
- 目的:评估的创建和交付
- 基本URL: https://qti.alpha-1edtech.com/api
- 主要特点:评估测试、项目、刺激、评分
OneRoster
- 目的:学生信息系统集成
- 基本URL: https://api.alpha-1edtech.com
- 主要特点:用户、班级、注册人数、成绩
卡尺
- 目的:学习分析和活动跟踪
- 基本URL: https://caliper.alpha-1edtech.com
- 主要特点:学习活动、实体、简介
PowerPath
- 目的:掌握学习和个性化路径
- 基本URL: https://api.alpha-1edtech.com
- 主要特点:学习目标、掌握跟踪、自适应路径
案例
- 目的:学术标准和能力
- 基本URL: https://api.alpha-1edtech.com
- 主要特点:标准框架、能力、一致性
认证
所有TimeBack API都使用OAuth2客户端凭据流:
- 从TimeBack平台团队获取客户端ID和密码
- 配置环境变量
- 服务器自动处理令牌刷新
- 令牌被缓存并重复使用,直到过期
错误处理
服务器包括全面的错误处理:
- OAuth2身份验证失败
- API速率限制
- 网络连接问题
- 数据验证无效
- 架构分析错误
日志记录
可配置的日志记录级别:
debug-详细的调试信息info-一般操作信息warn-警告条件error-错误条件
贡献
- 分叉存储库
- 创建要素分支
- 进行更改
- 如果适用,添加测试
- 提交拉取请求
许可证
ISC许可证
支持
如需TimeBack平台API的支持,请联系1EdTech平台团队。 对于此MCP服务器的问题,请打开GitHub问题。
______________________________________________________________________
专为TimeBack 1EdTech平台打造
