Skip to main content

Add your description here

Project description

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")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

test_mcp_yfei_demo-0.1.2.tar.gz (9.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

test_mcp_yfei_demo-0.1.2-py3-none-any.whl (2.0 kB view details)

Uploaded Python 3

File details

Details for the file test_mcp_yfei_demo-0.1.2.tar.gz.

File metadata

  • Download URL: test_mcp_yfei_demo-0.1.2.tar.gz
  • Upload date:
  • Size: 9.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.4

File hashes

Hashes for test_mcp_yfei_demo-0.1.2.tar.gz
Algorithm Hash digest
SHA256 7998b4f06787f8d4b09b1ce459ba48d55a7df9fefcc625d87467fb4dea5dbbac
MD5 bc850cdece8b8a6b4b28179ca627c9b9
BLAKE2b-256 ecee6580aa0a0610ee742d458fba5a9283950281279a9d61300044f6c9b99b38

See more details on using hashes here.

File details

Details for the file test_mcp_yfei_demo-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for test_mcp_yfei_demo-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6e7ed444f2bfe5fb249f5d354fcf8c07ac7eef2a5cb7bc09fd818395b29e0530
MD5 adeadd514a51e7b73db58241df14bcb1
BLAKE2b-256 8a32685de1eb314071f5790595cc8e09e7621e058fe9a76296fd31ebc531980e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page