Skip to main content
Glama

MCP Demo Server

by keosu

MCP 演示项目 - 双实现版本

这个项目包含了 两个不同的 Model Context Protocol (MCP) 实现,用于学习和比较不同的实现方法。

🚀 快速开始

选择版本启动

# 使用启动选择器 .\start_demo.ps1 # 或直接选择版本: # FastAPI版本 (概念演示) cd mcp_fastapi_demo && .\setup_and_run.ps1 # MCP SDK版本 (官方实现) cd mcp_sdk_demo && .\start_mcp_sdk.ps1

运行测试

# 使用测试选择器 .\run_tests_demo.ps1 # 或直接选择测试: # FastAPI版本测试 cd mcp_fastapi_demo && .\test_with_venv.ps1 # MCP SDK版本测试 cd mcp_sdk_demo && .\test_mcp_sdk.ps1

📂 项目结构

mcpdemo/ ├── mcp_fastapi_demo/ # 🔧 v1.0 - FastAPI概念演示版本 │ ├── main.py # FastAPI应用主文件 │ ├── mcp_server.py # MCP功能模拟实现 │ ├── tools.py # 工具定义 │ ├── config.py # 配置文件 │ ├── client_test.py # HTTP客户端测试 │ ├── requirements.txt # FastAPI依赖包 │ └── README.md # FastAPI版本文档 │ ├── mcp_sdk_demo/ # 🚀 v2.0 - 官方SDK真实实现版本 │ ├── mcp_server_sdk.py # MCP SDK服务器 │ ├── test_mcp_sdk.py # MCP SDK客户端测试 │ ├── claude_desktop_config_example.json # Claude Desktop配置 │ ├── requirements.txt # MCP SDK依赖包 │ └── README.md # MCP SDK版本文档 │ ├── start_demo.ps1 # 🚀 快速启动选择器 ├── run_tests_demo.ps1 # 🧪 测试选择器 ├── venv/ # 共享虚拟环境 └── README.md # 本文件

🎯 两个版本对比

特性FastAPI版本 (v1.0)MCP SDK版本 (v2.0)
目的学习MCP概念真正的MCP协议实现
协议RESTful HTTP APIMCP协议 + JSON-RPC
传输HTTP/HTTPSSTDIO
客户端Web浏览器、HTTP客户端Claude Desktop、MCP兼容客户端
优势简单易懂、有Web界面真正的MCP协议、Claude Desktop兼容
限制无法与真正MCP客户端连接学习曲线稍陡、无Web界面

🛠️ 功能特性

两个版本都提供相同的工具功能:

  • calculator - 数学计算工具 (+, -, *, /, sin, cos, sqrt等)
  • text_analyzer - 文本分析工具 (字符统计、词频分析、阅读时间)
  • file_reader - 文件读取工具 (安全文件访问、多格式支持)

🔌 Claude Desktop 集成

只有 MCP SDK版本 支持与Claude Desktop集成。详细配置请参考 mcp_sdk_demo/README.md

📚 学习建议

初学者路径

  1. 从FastAPI版本开始 - 理解MCP的基本概念
  2. 查看Web界面 - 访问 http://localhost:8000/docs
  3. 升级到SDK版本 - 体验真正的MCP协议

开发者路径

  1. 直接使用SDK版本 - 用于生产环境
  2. 配置Claude Desktop - 体验真实的AI助手集成

🔧 系统要求

  • Python 3.10+
  • PowerShell (Windows)
  • 虚拟环境支持

选择建议:

  • 🎓 学习MCP概念 → 使用 mcp_fastapi_demo
  • 🚀 生产环境/Claude Desktop集成 → 使用 mcp_sdk_demo
-
security - not tested
F
license - not found
-
quality - not tested

Provides calculator, text analysis, and file reading tools through two different implementations - a FastAPI version for learning MCP concepts and an official SDK version for production use with Claude Desktop integration.

  1. 🚀 快速开始
    1. 选择版本启动
    2. 运行测试
  2. 📂 项目结构
    1. 🎯 两个版本对比
      1. 🛠️ 功能特性
        1. 🔌 Claude Desktop 集成
          1. 📚 学习建议
            1. 初学者路径
            2. 开发者路径
          2. 🔧 系统要求

            Related MCP Servers

            • -
              security
              F
              license
              -
              quality
              Allows interaction with MATLAB by creating and executing scripts and functions through Claude or other MCP clients, supporting script management and execution result retrieval with environment configuration capabilities.
              Last updated -
              26
              • Apple
            • A
              security
              A
              license
              A
              quality
              Allows Claude desktop app to execute terminal commands and edit files on your computer through MCP, with features including command execution, process management, and diff-based file editing.
              Last updated -
              21
              32,959
              4,447
              MIT License
              • Apple
            • -
              security
              F
              license
              -
              quality
              An MCP server that integrates with Claude to provide smart documentation search capabilities across multiple AI/ML libraries, allowing users to retrieve and process technical information through natural language queries.
              Last updated -
            • A
              security
              F
              license
              A
              quality
              A comprehensive learning project providing hands-on experience with Model Context Protocol (MCP) server development, featuring calculator and text utility tools for integration with Claude Desktop.
              Last updated -
              1
              • Apple
              • Linux

            View all related MCP servers

            MCP directory API

            We provide all the information about MCP servers via our MCP API.

            curl -X GET 'https://glama.ai/api/mcp/v1/servers/keosu/mcpdemo'

            If you have feedback or need assistance with the MCP directory API, please join our Discord server