Skip to main content

a demo of mcp server

# server.py
from mcp.server.fastmcp import FastMCP

# Create an MCP server
mcp = FastMCP("Demo")


# Add an addition tool
@mcp.tool()
def add(a: int, b: int) -> int:
    """Add two numbers"""
    return a + b


# Add a dynamic greeting resource
@mcp.resource("greeting://{name}")
def get_greeting(name: str) -> str:
    """Get a personalized greeting"""
    return f"Hello, {name}!"

def main() -> None: # 主函数
    mcp.run(transport="stdio")

Metadata

Release files for test-mcp-yfei-demo 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for test-mcp-yfei-demo 0.1.2
File Size Uploaded
test_mcp_yfei_demo-0.1.2.tar.gz 9.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for test-mcp-yfei-demo 0.1.2
File Interpreter ABI Platform
test_mcp_yfei_demo-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 11.0 kB

Release files / test_mcp_yfei_demo-0.1.2.tar.gz

Download URL test_mcp_yfei_demo-0.1.2.tar.gz
Size 9.1 kB
Tags Source
SHA-256 checksum
How to use checksums
7998b4f06787f8d4b09b1ce459ba48d55a7df9fefcc625d87467fb4dea5dbbac
BLAKE2b-256 checksum
How to use checksums
ecee6580aa0a0610ee742d458fba5a9283950281279a9d61300044f6c9b99b38
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.5.4

Release files / test_mcp_yfei_demo-0.1.2-py3-none-any.whl

Download URL test_mcp_yfei_demo-0.1.2-py3-none-any.whl
Size 2.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6e7ed444f2bfe5fb249f5d354fcf8c07ac7eef2a5cb7bc09fd818395b29e0530
BLAKE2b-256 checksum
How to use checksums
8a32685de1eb314071f5790595cc8e09e7621e058fe9a76296fd31ebc531980e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.5.4

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page