Skip to content

Commit de1b138

Browse files
author
BlackDadd77
authored
Merge pull request #22 from BlackDadd77/copilot/add-md-file-snippet-yml
Configure pymdownx.snippets and add examples documentation
2 parents 0fe5e5c + c82dbce commit de1b138

File tree

2 files changed

+37
-1
lines changed

2 files changed

+37
-1
lines changed

docs/examples.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Code Examples
2+
3+
This page demonstrates various MCP SDK examples using the snippet feature.
4+
5+
## FastMCP Quickstart
6+
7+
Here's a complete quickstart example showing how to create a server with tools, resources, and prompts:
8+
9+
```python title="fastmcp_quickstart.py"
10+
--8<-- "servers/fastmcp_quickstart.py"
11+
```
12+
13+
## Basic Tool Example
14+
15+
This example shows how to define simple tools:
16+
17+
```python title="basic_tool.py"
18+
--8<-- "servers/basic_tool.py"
19+
```
20+
21+
## Usage
22+
23+
To run any of these examples:
24+
25+
1. Navigate to the `examples/snippets` directory
26+
2. Run the server using `uv run mcp dev <filename>`
27+
28+
For example:
29+
```bash
30+
cd examples/snippets
31+
uv run mcp dev servers/basic_tool.py
32+
```

mkdocs.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ nav:
1818
- Low-Level Server: low-level-server.md
1919
- Authorization: authorization.md
2020
- Testing: testing.md
21+
- Examples: examples.md
2122
- API Reference: api.md
2223

2324
theme:
@@ -77,7 +78,10 @@ markdown_extensions:
7778
- pymdownx.critic
7879
- pymdownx.mark
7980
- pymdownx.superfences
80-
- pymdownx.snippets
81+
- pymdownx.snippets:
82+
base_path:
83+
- examples/snippets
84+
- .
8185
- pymdownx.tilde
8286
- pymdownx.inlinehilite
8387
- pymdownx.highlight:

0 commit comments

Comments
 (0)