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

Learning Assistant MCP

MCP Server

一个基于Cloudflare Workers和Streamlit的AI学习平台,提供维基百科搜索、文本翻译和词典查询功能。

工具数

0

提示词数

0

GitHub Stars

2

资源数

0
搜索Cloudflare Workers云端部署

安装说明

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

作者 / 组织

takzen

提供方

takzen

最后核验

2026/5/17 20:19

快速接入

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

详细介绍

🎓 AI学习助手

一个完整的学习平台,由部署在Cloudflare Workers上的MCP(模型上下文协议)服务器和漂亮的Streamlit前端界面组成。

![License](LICENSE) ![Status](https://learning-assistant-mcp.mcp-weather.workers.dev) ![Cloudflare Workers](https://workers.cloudflare.com/) ![TypeScript](https://www.typescriptlang.org/) ![Python](https://www.python.org/) ![uv](https://github.com/astral-sh/uv) ![Streamlit](https://streamlit.io/) ![Made with](https://github.com)

🌟 特性

📚 维基百科搜索

搜索多种语言的维基百科文章,并获得带有缩略图和链接的简明摘要。

🌍 文本翻译

使用Google Translate API在100多种语言之间翻译文本。

📖 字典查找

查找英语单词定义、发音(带音频)、示例、同义词和反义词。

______________________________________________________________________

🏗️ 建筑

┌─────────────────────────────────────┐
│   Streamlit Frontend (Python)       │
│   - User Interface                  │
│   - Visual Components               │
│   http://localhost:8501             │
└──────────────┬──────────────────────┘
               │ HTTP POST
               ▼
┌─────────────────────────────────────┐
│   MCP Server (TypeScript)           │
│   - Tool Registry                   │
│   - API Integrations                │
│   Cloudflare Workers                │
└─────────────────────────────────────┘

______________________________________________________________________

📂 项目结构

learning-assistant-mcp/              # Root directory
├── src/
│   ├── index.ts                     # Main server & routing
│   └── tools/
│       ├── wikipedia.ts             # Wikipedia search tool
│       ├── translate.ts             # Translation tool
│       └── dictionary.ts            # Dictionary lookup tool
├── learning-assistant-ui/           # Streamlit Frontend
│   ├── app.py                       # Main Streamlit app
│   ├── requirements.txt             # Python dependencies
│   └── .venv/                        # Virtual environment (gitignored)
├── screenshots/                     # UI screenshots for README
├── wrangler.toml                    # Cloudflare config
├── package.json                     # Node dependencies
├── tsconfig.json                    # TypeScript config
├── .gitignore                       # Git ignore rules
└── README.md                        # This file

______________________________________________________________________

🚀 快速开始

先决条件

  • Node.js 18+(用于MCP服务器)
  • Python 3.11+(用于Streamlit UI)
  • npm或pnpm
  • uv(Python包安装程序)
  • Cloudflare帐户(用于部署)

1.MCP服务器设置

# Navigate to project root
cd learning-assistant-mcp

# Install dependencies
npm install

# Run locally
npm run dev

# Test the API
npm test

# Deploy to Cloudflare Workers
npm run deploy

2.流线型UI设置

# Navigate to UI directory (from project root)
cd learning-assistant-ui

# Create virtual environment with uv
uv venv

# Activate venv
# Windows (Git Bash):
source .venv/Scripts/activate
# Linux/Mac:
source .venv/bin/activate

# Install dependencies with uv
uv pip install -r requirements.txt

# Run Streamlit app
streamlit run app.py

应用程序将在以下时间自动打开 http://localhost:8501

______________________________________________________________________

🖼️ 截图

维基百科搜索界面

Wikipedia Search *搜索任何语言的维基百科文章,并提供即时摘要*

翻译工具

Translation *通过源语言和目标语言选择在100多种语言之间翻译文本*

字典查找

Dictionary *获取定义、带音频的发音、示例和同义词*

______________________________________________________________________

🔧 API使用

端点

Production: https://learning-assistant-mcp.mcp-weather.workers.dev
Local: http://localhost:8787

请求格式

{
  "tool": "toolName",
  "input": {
    // tool-specific parameters
  }
}

请求示例

维基百科搜索

curl -X POST https://learning-assistant-mcp.mcp-weather.workers.dev \
  -H "Content-Type: application/json" \
  -d '{
    "tool": "searchWikipedia",
    "input": {
      "query": "Machine Learning",
      "language": "en"
    }
  }'

翻译

curl -X POST https://learning-assistant-mcp.mcp-weather.workers.dev \
  -H "Content-Type: application/json" \
  -d '{
    "tool": "translateText",
    "input": {
      "text": "Hello, world!",
      "sourceLang": "en",
      "targetLang": "pl"
    }
  }'

字典查找

curl -X POST https://learning-assistant-mcp.mcp-weather.workers.dev \
  -H "Content-Type: application/json" \
  -d '{
    "tool": "lookupWord",
    "input": {
      "word": "serendipity"
    }
  }'

响应格式

{
  "success": true,
  // tool-specific response data
  "timestamp": "2025-11-04T05:34:31.266Z"
}

______________________________________________________________________

🛠️ 使用的技术

后端(MCP服务器)

  • TypeScript -类型安全代码
  • Cloudflare员工 -无服务器边缘计算
  • 萨德 -架构验证
  • 牧马人 -Cloudflare CLI

前端(流式UI)

  • 溪流 -Python web框架
  • 请求: -HTTP客户端
  • Python 3.11+ -运行时间
  • 紫外线 -快速Python包安装程序

集成API

  • 维基百科REST API -文章摘要
  • 谷歌翻译API -文本翻译
  • 免费词典API -单词定义

______________________________________________________________________

📊 演出

  • 边缘计算 -部署在Cloudflare的全球网络上
  • 🚀 低延迟 -平均响应时间\;

export const yourTool = { name: "yourTool", description: "What your tool does", inputSchema: yourToolInputSchema,

async handler(input: YourToolInput) { // Your implementation return { success: true, // your response data }; }, };


### 2.在中注册工具 `src/index.ts`

import { yourTool } from "./tools/your-tool";

const tools = { searchWikipedia: wikipediaTool, translateText: translateTool, lookupWord: dictionaryTool, yourTool: yourTool, // Add here };


### 3.测试和部署

npm run dev # Test locally npm run deploy # Deploy to production


______________________________________________________________________

## 🌐 部署

### 将MCP服务器部署到Cloudflare

From project root

wrangler deploy


### 将Streamlit UI部署到Streamlit Cloud

1. 将代码推送到GitHub
1. 首选 [share.streamlit.io](https://share.streamlit.io)
1. 连接您的存储库
1. 选择 `learning-assistant-ui/app.py` 作为主文件
1. 部署!

______________________________________________________________________

## 🔐 环境变量

### MCP服务器

不需要API密钥-所有服务都使用免费的公共API。

### 流线型UI

更新 `API_URL` 在 `app.py` 如果部署到自定义域:

API_URL = "https://your-custom-domain.workers.dev"


______________________________________________________________________

## 🤝 贡献

欢迎投稿!请按照以下步骤操作:

1. 分叉存储库
1. 创建要素分支(`git checkout -b feature/AmazingFeature`)
1. 提交您的更改(`git commit -m 'Add some AmazingFeature'`)
1. 推到分支(`git push origin feature/AmazingFeature`)
1. 打开拉取请求

______________________________________________________________________

## 📄 许可证

此项目根据MIT许可证获得许可-请参阅 [许可证](LICENSE) 文件以获取详细信息。

______________________________________________________________________

## 🙏 致谢

- [维基百科API](https://www.mediawiki.org/wiki/API:Main_page) -文章数据
- [免费词典API](https://dictionaryapi.dev/) -单词定义
- [谷歌翻译](https://translate.google.com/) -翻译服务
- [Cloudflare员工](https://workers.cloudflare.com/) -无服务器主机
- [溪流](https://streamlit.io/) -前端框架

______________________________________________________________________

## 📧 联系

- **GitHub**: [@塔克森](https://github.com/takzen)
- **项目链接**: 
- **在线演示**: [https://learning-assistant-mcp.mcp-weather.workers.dev](https://learning-assistant-mcp.mcp-weather.workers.dev)

______________________________________________________________________

由以下材料制成❤️ 使用TypeScript、Python和Cloudflare Workers

目录标签

目录标签

搜索Cloudflare Workers云端部署AI学习TypeScript本地部署维基百科搜索文本翻译词典查询CloudflareWorkersStreamlit

接入字段

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

未说明

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

none

工具数量(toolCount,工具数)

0

资源数量(resourceCount,资源数)

0

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

0

权限和风险

未说明none部署方式未说明

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

安装前确认

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

仍需确认:installCommand

来源信息

继续浏览同类 MCP