mcpField
M
MCP 服务器示例

MCP 服务器示例

Local
github.com/Chenlong-TaoDeveloper Tools0Updated 87w ago

About MCP 服务器示例

A beginner-focused MCP server demo that illustrates tools, resources, and prompts, with a web UI for access.

Key features

  1. 01Add-two-numbers tool
  2. 02Personalized greeting resource
  3. 03Code analysis prompt template
  4. 04Web UI access

Use cases

  1. 01Learning MCP basics
  2. 02Trying tool, resource, and prompt interactions

MCP support

The MCP server exposes an addition tool, a dynamic greeting resource, and a code analysis prompt to clients.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

No install method listed yet

We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.

Repository

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

MCP 服务器示例

这是一个简单的 MCP (Model Context Protocol) 服务器示例,适合初学者了解和学习 MCP 的基本概念和使用方法。

什么是 MCP?

MCP (Model Context Protocol) 是一种协议,允许 AI 模型(如 Claude)与外部工具和资源进行交互。通过 MCP,AI 可以访问实时数据、执行计算或与其他系统通信,从而扩展其能力。

这个仓库包含什么?

这个仓库包含一个简单的 MCP 服务器示例,它提供了以下功能:

  1. 加法工具:一个简单的工具,可以将两个数字相加
  2. 问候资源:一个动态资源,可以根据提供的名字返回个性化的问候语
  3. 代码分析提示:一个用于深入分析代码的提示模板

如何开始使用

前提条件
  • 安装 Python(建议 Python 3.6 或更高版本)
  • 基本的命令行知识
安装步骤
  1. 克隆或下载这个仓库到你的计算机上

  2. 打开终端或命令提示符,导航到仓库的 server 目录

  3. 运行启动脚本:

    sh start.sh
    

    这个脚本会自动检查是否安装了 MCP 包,如果没有,会自动安装,然后启动服务器。

  4. 如果一切顺利,你应该会看到服务器启动的消息,表明服务器正在运行。

如何使用这个 MCP 服务器

运行后 打开 http://localhost:5173

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.