Skip to content
This repository was archived by the owner on Mar 24, 2025. It is now read-only.

Commit f84186a

Browse files
committed
Updates"
1 parent 40dacf6 commit f84186a

File tree

3 files changed

+321
-5
lines changed

3 files changed

+321
-5
lines changed

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,6 @@ artifacts = ["src/create_mcp_server/template"]
4040

4141
[tool.uv]
4242
dev-dependencies = ["pyright>=1.1.389", "ruff>=0.7.4"]
43+
44+
[tool.uv.workspace]
45+
members = ["test"]

src/create_mcp_server/template/server.py.jinja2

Lines changed: 47 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,61 @@ server = Server("{{server_name}}")
99

1010
@server.list_resources()
1111
async def handle_list_resources() -> list[types.Resource]:
12-
"""List available resources."""
12+
"""List available resources.
13+
14+
Example return value:
15+
[
16+
types.Resource(
17+
uri=AnyUrl("resource://example"),
18+
name="Example Resource",
19+
description="An example resource",
20+
mimeType="text/plain"
21+
)
22+
]
23+
"""
1324
return []
1425

1526
@server.list_prompts()
1627
async def handle_list_prompts() -> list[types.Prompt]:
17-
"""List available prompts."""
28+
"""List available prompts.
29+
30+
Example return value:
31+
[
32+
types.Prompt(
33+
name="example-prompt",
34+
description="An example prompt",
35+
arguments=[
36+
types.PromptArgument(
37+
name="style",
38+
description="Style of the prompt",
39+
required=False
40+
)
41+
]
42+
)
43+
]
44+
"""
1845
return []
1946

2047
@server.list_tools()
2148
async def handle_list_tools() -> list[types.Tool]:
22-
"""List available tools."""
49+
"""List available tools.
50+
51+
Example return value:
52+
[
53+
types.Tool(
54+
name="example-tool",
55+
description="An example tool",
56+
inputSchema={
57+
"type": "object",
58+
"properties": {
59+
"name": {"type": "string"},
60+
"value": {"type": "string"}
61+
},
62+
"required": ["name", "value"]
63+
}
64+
)
65+
]
66+
"""
2367
return []
2468

2569
async def main():

0 commit comments

Comments
 (0)