update nav

This commit is contained in:
zachary62
2025-04-04 14:15:36 -04:00
parent c41c55499d
commit 93df0fecc2
37 changed files with 261 additions and 2 deletions

View File

@@ -1,3 +1,10 @@
---
layout: default
title: "CLI (mcp command)"
parent: "MCP Python SDK"
nav_order: 1
---
# Chapter 1: Your Control Panel - The `mcp` Command-Line Interface
Welcome to the MCP Python SDK! This is your starting point for building powerful, interactive AI tools.

View File

@@ -1,3 +1,10 @@
---
layout: default
title: "FastMCP Server (FastMCP)"
parent: "MCP Python SDK"
nav_order: 2
---
# Chapter 2: Easier Server Building with `FastMCP`
In [Chapter 1: Your Control Panel - The `mcp` Command-Line Interface](01_cli___mcp__command_.md), we learned how to use the `mcp` command to run, test, and install MCP servers. We even saw a tiny example of a server file. But how do we *build* that server code without getting lost in complex details?

View File

@@ -1,3 +1,10 @@
---
layout: default
title: "FastMCP Resources (Resource, ResourceManager)"
parent: "MCP Python SDK"
nav_order: 3
---
# Chapter 3: Sharing Data - FastMCP Resources (`Resource`, `ResourceManager`)
In [Chapter 2: Easier Server Building with `FastMCP`](02_fastmcp_server___fastmcp__.md), we saw how `FastMCP` and the `@server.tool()` decorator make it easy to create servers that can *perform actions* for clients, like our `echo` tool.

View File

@@ -1,3 +1,10 @@
---
layout: default
title: "FastMCP Tools (Tool, ToolManager)"
parent: "MCP Python SDK"
nav_order: 4
---
# Chapter 4: FastMCP Tools (`Tool`, `ToolManager`)
In [Chapter 3: Sharing Data - FastMCP Resources (`Resource`, `ResourceManager`)](03_fastmcp_resources___resource____resourcemanager__.md), we learned how to make data available for clients to read using `Resource` objects, like putting books in a digital library. That's great for sharing information, but what if we want the client to be able to ask the server to *do* something?

View File

@@ -1,3 +1,10 @@
---
layout: default
title: "FastMCP Prompts (Prompt, PromptManager)"
parent: "MCP Python SDK"
nav_order: 5
---
# Chapter 5: Reusable Chat Starters - FastMCP Prompts (`Prompt`, `PromptManager`)
In [Chapter 4: FastMCP Tools (`Tool`, `ToolManager`)](04_fastmcp_tools___tool____toolmanager__.md), we learned how to give our server specific *actions* it can perform, like a calculator tool. But modern AI often involves conversations, especially with Large Language Models (LLMs). How do we manage the instructions and conversation starters we send to these models?

View File

@@ -1,3 +1,10 @@
---
layout: default
title: "FastMCP Context (Context)"
parent: "MCP Python SDK"
nav_order: 6
---
# Chapter 6: Talking Back - FastMCP Context (`Context`)
In [Chapter 5: Reusable Chat Starters - FastMCP Prompts (`Prompt`, `PromptManager`)](05_fastmcp_prompts___prompt____promptmanager__.md), we learned how to create reusable message templates for interacting with AI models. We've seen how to build servers with data resources ([Chapter 3](03_fastmcp_resources___resource____resourcemanager__.md)) and action tools ([Chapter 4](04_fastmcp_tools___tool____toolmanager__.md)).
@@ -153,7 +160,7 @@ if __name__ == "__main__":
1. **`@server.resource(...)`**: We added a simple resource named `config://task_settings` that just returns a string.
2. **`resource_contents = await ctx.read_resource("config://task_settings")`**: Inside our `run_long_task` tool, we now use `ctx.read_resource()` to fetch the content of our configuration resource. This allows the tool to dynamically access data managed by the server without having direct access to the resource's implementation function (`get_task_settings`).
3. **Processing Content**: The `read_resource` method returns an iterable of `ReadResourceContents` objects (often just one). We extract the string content to use it.
3. **Processing Content**: The `read_resource` method returns an iterable of `ReadResourceContents` objects (often just one). We extracted the string content to use it.
Now, our tool can both communicate outwards (logs, progress) and interact inwards (read resources) using the same `Context` object, all within the scope of the single request it's handling.

View File

@@ -1,3 +1,10 @@
---
layout: default
title: "MCP Protocol Types"
parent: "MCP Python SDK"
nav_order: 7
---
# Chapter 7: MCP Protocol Types - The Standard Language
In the previous chapter, [Chapter 6: Talking Back - FastMCP Context (`Context`)](06_fastmcp_context___context__.md), we saw how the `Context` object gives our tools and resources a "backstage pass" to send logs, report progress, and access other server features during a request. We've built up a good understanding of how `FastMCP` helps us create powerful servers with tools ([Chapter 4](04_fastmcp_tools___tool____toolmanager__.md)), resources ([Chapter 3](03_fastmcp_resources___resource____resourcemanager__.md)), and prompts ([Chapter 5](05_fastmcp_prompts___prompt____promptmanager__.md)).

View File

@@ -1,3 +1,10 @@
---
layout: default
title: "Client/Server Sessions (ClientSession, ServerSession)"
parent: "MCP Python SDK"
nav_order: 8
---
# Chapter 8: Client/Server Sessions (`ClientSession`, `ServerSession`)
Welcome back! In [Chapter 7: MCP Protocol Types](07_mcp_protocol_types.md), we learned about the standardized "digital forms" the Pydantic models that define the structure of messages exchanged between an MCP client and server. We saw examples like `CallToolRequest` and `ProgressNotification`.

View File

@@ -1,3 +1,10 @@
---
layout: default
title: "Communication Transports"
parent: "MCP Python SDK"
nav_order: 9
---
# Chapter 9: Communication Transports (Stdio, SSE, WebSocket, Memory)
Welcome to the final chapter of our introductory journey into the `MCP Python SDK`! In [Chapter 8: Client/Server Sessions (`ClientSession`, `ServerSession`)](08_client_server_sessions___clientsession____serversession__.md), we learned how `Session` objects manage the ongoing conversation and state for a single connection between a client and a server, like dedicated phone operators handling a call.