Skip to main content
Glama
FromZero2One

Demo MCP Server

by FromZero2One

MCP Server Demo

这是一个MCP(Model Context Protocol)服务器示例,提供多种工具和资源供AI模型调用。

项目简介

本项目是一个基于FastMCP框架构建的MCP服务器,提供了基础的数学计算工具、个性化问候资源和用户问候提示等功能。

Related MCP server: Fast MCP Local

功能特性

  • 加法工具:执行两个整数的加法运算

  • 乘法工具:执行两个整数的乘法运算

  • 个性化问候资源:根据姓名生成个性化问候语

  • 用户问候提示:根据指定风格生成问候提示

依赖要求

  • Python >= 3.12

  • mcp[cli] >= 1.12.2

安装步骤

  1. 确保已安装Python 3.12或更高版本

  2. 安装依赖:

    pip install mcp[cli]>=1.12.2

启动服务

运行以下命令启动MCP服务器:

uv run server fastmcp_quickstart stdio

或者直接运行Python文件:

python mcp_server.py

魔搭社区部署说明

部署准备

  1. 确保项目根目录包含以下文件:

部署步骤

  1. 将项目代码上传至魔搭社区环境

  2. 在魔搭环境中安装依赖:

    pip install -r requirements.txt
    # 或者直接安装pyproject.toml中的依赖
    pip install .
  3. 启动服务:

    uv run server fastmcp_quickstart stdio

服务配置

  • 服务名称:Demo

  • 通信方式:stdio

  • 支持的工具:

    • add: 两数相加

    • multi: 两数相乘

    • get_greeting: 获取个性化问候

    • greet_user: 生成用户问候提示

使用示例

  • 加法工具:输入两个整数,返回它们的和

  • 乘法工具:输入两个整数,返回它们的积

  • 问候资源:输入姓名,返回个性化问候语(格式:greeting://{name})

  • 问候提示:输入姓名和风格(友好/正式/随意),返回相应风格的问候

注意事项

  • 确保在魔搭社区环境中正确配置了Python运行环境

  • 检查依赖包是否正确安装

  • 服务启动后会监听stdio进行MCP协议通信

许可证

请在此处添加许可证信息(如适用)

F
license - not found
-
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • F
    license
    A
    quality
    D
    maintenance
    A demonstration MCP server built with FastMCP v2.0 that provides basic mathematical calculations and greeting functionality. Features Docker containerization, comprehensive testing, and CI/CD automation for learning MCP development patterns.
    Last updated
    2
  • A
    license
    -
    quality
    D
    maintenance
    A minimal FastMCP server implementation that provides basic mathematical and greeting tools. Enables users to perform simple operations like adding numbers and greeting people by name through a lightweight MCP interface.
    Last updated
    MIT
  • F
    license
    -
    quality
    D
    maintenance
    A minimal demonstration MCP server that provides basic mathematical addition and greeting functionality, serving as a template for building and deploying FastMCP servers.
    Last updated
  • F
    license
    -
    quality
    D
    maintenance
    A simple demonstration MCP server built with FastMCP that provides basic functionality including an addition tool, dynamic greeting resources, and user greeting prompts over STDIO.
    Last updated

View all related MCP servers

Related MCP Connectors

View all MCP Connectors

Latest Blog Posts

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/FromZero2One/mcp_server'

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