Skip to content

Commit ed17b29

Browse files
committed
feedback on genai-mcp-build-custom-tools-python
1 parent 6f83124 commit ed17b29

File tree

8 files changed

+26
-586
lines changed

8 files changed

+26
-586
lines changed

asciidoc/courses/genai-mcp-build-custom-tools-python/modules/1-getting-started/lessons/2-setup/lesson.adoc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,11 @@ Throughout this course, you'll connect your MCP server to a Neo4j database with
5959
6060
We have created a Neo4j Sandbox instance for you to use during this course, loaded with thousands of movies, actors, directors, and user ratings.
6161
62-
To define the connection details as environment variables, create a `.env` file in the `server/` directory with the following values:
62+
To define the connection details as environment variables, create a `.env` file in the project root with the following values:
6363
6464
6565
[source,env,subs="attributes+"]
66-
.server/.env
66+
.env
6767
----
6868
NEO4J_URI={instance-scheme}://{instance-ip}:{instance-boltPort}
6969
NEO4J_USERNAME={instance-username}
@@ -129,9 +129,9 @@ load_dotenv()
129129
# access the environment variables
130130
import os
131131

132-
uri = os.getenv("NEO4J_URI", "bolt://localhost:7687")
133-
username = os.getenv("NEO4J_USERNAME", "neo4j")
134-
password = os.getenv("NEO4J_PASSWORD", "password")
132+
uri = os.getenv("NEO4J_URI")
133+
username = os.getenv("NEO4J_USERNAME")
134+
password = os.getenv("NEO4J_PASSWORD")
135135
----
136136
====
137137

asciidoc/courses/genai-mcp-build-custom-tools-python/modules/1-getting-started/lessons/3c-create-first-server/code/solution.py

Lines changed: 0 additions & 32 deletions
This file was deleted.

asciidoc/courses/genai-mcp-build-custom-tools-python/modules/1-getting-started/lessons/3c-create-first-server/lesson.adoc

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
= Create Your First MCP Server
1+
= Create Your First MCP Server
22
:type: challenge
33
:order: 3
44

@@ -13,7 +13,7 @@ Your challenge is to create a simple MCP server that demonstrates the core conce
1313
====
1414
If you haven't completed the setup lesson yet, go back to link:../2-setup/[Setting Up Your Development Environment^] to configure your Codespace and environment variables.
1515
16-
You can keep the Codespace open while completing the course.
16+
You can keep the Codespace open while completing the course.
1717
You can open your existing codespaces at link:https://github.com/codespaces[github.com/codespaces^].
1818
====
1919

@@ -80,10 +80,10 @@ uv add "mcp[cli]"
8080
=== Step 4: Create your MCP server
8181

8282

83-
Open `main.py` in your editor and add the following code to create a simple MCP server:
83+
Open `strawberry/main.py` in your editor and add the following code to create a simple MCP server:
8484

8585
[source,python]
86-
.main.py
86+
.strawberry/main.py
8787
----
8888
from mcp.server.fastmcp import FastMCP
8989
@@ -93,17 +93,17 @@ mcp = FastMCP("Strawberry")
9393
@mcp.tool()
9494
def count_letters(text: str, search: str) -> int:
9595
"""Count occurrences of a letter in the text"""
96-
return text.lower().count(search.lower())
96+
return text.lower().count(search.lower())
9797
9898
# Run the server when executed directly
9999
if __name__ == "__main__":
100-
mcp.run(transport="streaming-http")
100+
mcp.run(transport="streamable-http")
101101
----
102102

103103
[NOTE]
104-
.Streaming HTTP
104+
.Streamable HTTP
105105
====
106-
This example uses the `streaming-http` transport method to run the server.
106+
This example uses the `streamable-http` transport method to run the server.
107107
This differs from `stdio` in that the client uses HTTP to communicate with the server.
108108
109109
We have made this choice to make it easier to test the server in GitHub Codespaces with the interactive Python client.
@@ -130,7 +130,7 @@ If the server is running successfully, you will see output similar to:
130130
INFO: Started server process [30256]
131131
INFO: Waiting for application startup.
132132
[10/15/25 12:52:22] INFO StreamableHTTP session manager streamable_http_manager.py:110
133-
started
133+
started
134134
INFO: Application startup complete.
135135
INFO: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
136136
----
@@ -166,7 +166,7 @@ The client will connect to your server and display an interactive menu showing a
166166
0. Exit
167167
============================================================
168168
169-
Select a tool, resource, or template (enter number):
169+
Select a tool, resource, or template (enter number):
170170
----
171171

172172
Enter `1` to select the `count_letters` tool.
@@ -229,6 +229,8 @@ Try testing with different inputs to verify the tool works correctly. Press Ente
229229

230230
You have just created and tested your first MCP server!
231231

232+
Once you are finished, you can stop both the client and server by pressing `CMD+C` (Mac) or `Ctrl+C` (Windows) in the terminal windows where they are running.
233+
232234

233235
read::Mark as Completed[]
234236

asciidoc/courses/genai-mcp-build-custom-tools-python/modules/2-database-features/lessons/10c-paginated-tool/code/solution.py

Lines changed: 0 additions & 220 deletions
This file was deleted.

0 commit comments

Comments
 (0)