Back to MCP directory
publicPublicdnsLocal runtime

MCP-Server-Demo

一个基于KD nuggets教程构建的简单MCP服务器演示项目

article

README

🚀 MCP 服务器演示

本项目参考 KD 班级:构建一个简单的 MCP 服务器 构建了一个简单的 MCP 服务器,为相关开发提供了实践示例。

🚀 快速开始

本项目参考 KD 班级:构建一个简单的 MCP 服务器 来构建一个简单的 MCP 服务器。

📦 安装指南

使用 UV

# 全局安装 UV(适用于 Windows)
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

# 克隆仓库
git clone https://github.com/your-username/mcp-server-demo.git

# 进入项目目录
cd mcp-server-demo

# 检查服务器
uv run mcp dev stock_price_server.py

# 在 claude 桌面安装服务器
uv run mcp install stock_price_server.py --name "Stock Price Server" --with yfinance

💻 使用示例

测试结果

以下展示了运行测试时 MCP 服务器的结果。

截图 1:提示 1

服务器运行

截图 2:提示 2

成功连接

📚 详细文档

参考资料

help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client