MCP Demo Server

MCP Demo Server

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.

Category
Visit Server

README

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 API MCP协议 + JSON-RPC
传输 HTTP/HTTPS STDIO
客户端 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

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured