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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7998b4f06787f8d4b09b1ce459ba48d55a7df9fefcc625d87467fb4dea5dbbac
|
|
| MD5 |
bc850cdece8b8a6b4b28179ca627c9b9
|
|
| BLAKE2b-256 |
ecee6580aa0a0610ee742d458fba5a9283950281279a9d61300044f6c9b99b38
|
File details
Details for the file test_mcp_yfei_demo-0.1.2-py3-none-any.whl.
File metadata
- Download URL: test_mcp_yfei_demo-0.1.2-py3-none-any.whl
- Upload date:
- Size: 2.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6e7ed444f2bfe5fb249f5d354fcf8c07ac7eef2a5cb7bc09fd818395b29e0530
|
|
| MD5 |
adeadd514a51e7b73db58241df14bcb1
|
|
| BLAKE2b-256 |
8a32685de1eb314071f5790595cc8e09e7621e058fe9a76296fd31ebc531980e
|