Skip to content

Commit 24b4608

Browse files
authored
Merge pull request modelcontextprotocol#8 from modelcontextprotocol/zack-lee/qol
Quickstart QoL, grammar fixes
2 parents bf0fcef + 583e9e3 commit 24b4608

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+634
-4023
lines changed

api-reference/client-api/connection-management.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: "Connection Management"
2+
title: "Connection management"
33
description: "Learn how to establish and manage MCP client connections"
44
---
55

api-reference/client-api/resource-consumption.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: "Resource Consumption"
2+
title: "Resource consumption"
33
description: "Learn how to consume resources from MCP servers"
44
---
55

api-reference/client-api/tool-invocation.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: "Tool Invocation"
2+
title: "Tool invocation"
33
description: "Learn how to invoke tools through the MCP client API"
44
---
55

api-reference/error-handling.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: 'Error Handling'
2+
title: 'Error handling'
33
description: 'How to handle and respond to errors in the Model Context Protocol'
44
---
55

api-reference/message-types.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: 'Message Types'
2+
title: 'Message types'
33
description: 'Understanding the different types of messages in the Model Context Protocol'
44
---
55

api-reference/protocol-overview.mdx

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: "Protocol Overview"
2+
title: "Protocol overview"
33
description: "Learn about the core concepts and architecture of the Model Context Protocol (MCP)"
44
---
55

@@ -22,10 +22,8 @@ The Model Context Protocol (MCP) is a standardized protocol that enables AI appl
2222
</Card>
2323
</CardGroup>
2424

25-
# Core concepts
26-
25+
## Core concepts
2726
MCP defines several key primitives that form the foundation of the protocol:
28-
2927
<CardGroup cols={2}>
3028
<Card title="Resources" icon="book">
3129
Data that can be loaded as context for the AI model. Resources have URIs and can contain text or binary data.
@@ -41,12 +39,10 @@ MCP defines several key primitives that form the foundation of the protocol:
4139
</Card>
4240
</CardGroup>
4341

44-
# Protocol flow
45-
46-
## Connection and initialization
42+
## Protocol flow
4743

44+
### Connection and initialization
4845
When a client connects to an MCP server, they go through the following initialization sequence:
49-
5046
<Steps>
5147
<Step title="Client connects">
5248
The client establishes a connection to the server using one of the supported transports.
@@ -64,10 +60,8 @@ When a client connects to an MCP server, they go through the following initializ
6460

6561
After initialization, the client can begin using the server's resources, tools, and other capabilities.
6662

67-
## Transport options
68-
63+
### Transport options
6964
MCP supports multiple transport mechanisms for client-server communication:
70-
7165
<AccordionGroup>
7266
<Accordion title="Standard input/output (stdio)">
7367
- Server process reads from stdin and writes to stdout

api-reference/python/class-reference.mdx

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
2-
title: "Python Class Reference"
2+
title: "Python class reference"
33
description: "Complete Python SDK class documentation"
44
---
55

6-
## Server Class
6+
## Server class
77

88
The main class for implementing MCP servers in Python.
99

@@ -25,7 +25,7 @@ Creates a new MCP server instance.
2525

2626
### Decorators
2727

28-
#### Resource Handling
28+
#### Resource handling
2929

3030
##### @server.list_resources()
3131
```python
@@ -72,7 +72,7 @@ async def unsubscribe_resource(uri: str) -> None:
7272
**Parameters:**
7373
- `uri` (str): Resource URI to unsubscribe from
7474

75-
#### Tool Support
75+
#### Tool support
7676

7777
##### @server.list_tools()
7878
```python
@@ -99,7 +99,7 @@ async def call_tool(name: str, **kwargs) -> Any:
9999

100100
**Returns:** Tool execution result (any JSON-serializable value)
101101

102-
#### Prompt Management
102+
#### Prompt management
103103

104104
##### @server.list_prompts()
105105
```python
@@ -128,7 +128,7 @@ async def get_prompt(name: str, arguments: dict) -> PromptResponse:
128128
- `messages` (List[Message]): List of prompt messages
129129
- `description` (str, optional): Description of the prompt response
130130

131-
### Session Methods
131+
### Session methods
132132

133133
Methods available on the server session object:
134134

@@ -158,7 +158,7 @@ async def send_log_message(
158158
"""Sends log messages to clients."""
159159
```
160160

161-
## Data Classes
161+
## Data classes
162162

163163
### Resource
164164
```python
@@ -204,7 +204,7 @@ class PromptResponse:
204204
description: Optional[str] = None
205205
```
206206

207-
## Example Usage
207+
## Example usage
208208

209209
Here's a complete example demonstrating the main features:
210210

@@ -263,7 +263,7 @@ if __name__ == "__main__":
263263
anyio.run(main)
264264
```
265265

266-
## Best Practices
266+
## Best practices
267267

268268
1. **Error Handling**: Always implement proper error handling in your server methods:
269269
```python
@@ -303,15 +303,15 @@ if __name__ == "__main__":
303303
await session.send_resource_updated("example://resource1")
304304
```
305305

306-
## Transport Options
306+
## Transport options
307307

308-
### stdio Transport
308+
### Stdio transport
309309
```python
310310
async with stdio_server() as (read_stream, write_stream):
311311
await server.run(read_stream, write_stream)
312312
```
313313

314-
### SSE Transport
314+
### SSE transport
315315
```python
316316
from mcp_python.transport import SSETransport
317317

@@ -327,7 +327,7 @@ async def message_endpoint(request: Request):
327327
return await transport.handle_message(request)
328328
```
329329

330-
### WebSocket Transport
330+
### WebSocket transport
331331
```python
332332
from mcp_python.transport import WebSocketTransport
333333

api-reference/python/type-hints.mdx

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
---
2-
title: "Python Type Hints"
2+
title: "Python type hints"
33
description: "Python type system documentation"
44
---
55

6-
## Core Types
6+
## Core types
77

8-
### Resource Types
8+
### Resource types
99

1010
```python
1111
from typing import TypedDict, Optional, Literal, Union, List
@@ -38,7 +38,7 @@ class BlobResourceContents(ResourceContents):
3838
blob: bytes # Base64 encoded
3939
```
4040

41-
### Message Types
41+
### Message types
4242

4343
```python
4444
class TextContent(TypedDict):
@@ -60,7 +60,7 @@ class Message(TypedDict):
6060
content: MessageContent
6161
```
6262

63-
### Tool Types
63+
### Tool types
6464

6565
```python
6666
class ToolParameter(TypedDict):
@@ -82,7 +82,7 @@ class Tool(TypedDict):
8282
inputSchema: ToolSchema
8383
```
8484

85-
### Prompt Types
85+
### Prompt types
8686

8787
```python
8888
class PromptArgument(TypedDict):
@@ -103,7 +103,7 @@ class PromptResponse(TypedDict):
103103
messages: List[Message]
104104
```
105105

106-
### Progress Types
106+
### Progress types
107107

108108
```python
109109
class Progress(TypedDict):
@@ -112,7 +112,7 @@ class Progress(TypedDict):
112112
total: Optional[int]
113113
```
114114

115-
### Logging Types
115+
### Logging types
116116

117117
```python
118118
LogLevel = Literal["debug", "info", "warning", "error"]
@@ -124,9 +124,9 @@ class LogMessage(TypedDict):
124124
data: Any # JSON-serializable value
125125
```
126126

127-
## Request/Response Types
127+
## Request/Response types
128128

129-
### Resource Requests
129+
### Resource requests
130130

131131
```python
132132
class ListResourcesRequest(TypedDict):
@@ -155,7 +155,7 @@ class UnsubscribeRequest(TypedDict):
155155
uri: str
156156
```
157157

158-
### Tool Requests
158+
### Tool requests
159159

160160
```python
161161
class ListToolsRequest(TypedDict):
@@ -177,7 +177,7 @@ class CallToolResponse(TypedDict):
177177
toolResult: Any # JSON-serializable value
178178
```
179179

180-
### Prompt Requests
180+
### Prompt requests
181181

182182
```python
183183
class ListPromptsRequest(TypedDict):
@@ -195,7 +195,7 @@ class GetPromptRequest(TypedDict):
195195
arguments: Optional[dict[str, str]]
196196
```
197197

198-
## Protocol Types
198+
## Protocol types
199199

200200
### Implementation Info
201201

@@ -231,9 +231,9 @@ class ServerCapabilities(TypedDict):
231231
tools: Optional[ToolCapabilities]
232232
```
233233

234-
## Transport Types
234+
## Transport types
235235

236-
### Stream Types
236+
### Stream types
237237

238238
```python
239239
class ReadStream(Protocol):
@@ -245,7 +245,7 @@ class WriteStream(Protocol):
245245
async def write(self, data: bytes) -> None: ...
246246
```
247247

248-
### Session Types
248+
### Session types
249249

250250
```python
251251
class ServerSession(Protocol):
@@ -259,9 +259,9 @@ class ServerSession(Protocol):
259259
) -> None: ...
260260
```
261261

262-
## Usage Examples
262+
## Usage examples
263263

264-
### Type Usage in Handlers
264+
### Type usage in handlers
265265

266266
```python
267267
from mcp_python.server import Server
@@ -314,7 +314,7 @@ async def get_prompt(name: str, arguments: dict) -> PromptResponse:
314314
}
315315
```
316316

317-
### Type Checking
317+
### Type checking
318318

319319
```python
320320
from typing import TypeGuard
@@ -330,7 +330,7 @@ def process_message(message: Message) -> str:
330330
return f"Image message with type: {content['mimeType']}"
331331
```
332332

333-
## Additional Notes
333+
## Additional notes
334334

335335
- All types are compatible with standard Python type checkers (mypy, pyright)
336336
- TypedDict is used extensively to ensure proper structure of JSON-like objects

api-reference/server-api/event-handling.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
---
2-
title: "Event Handling"
2+
title: "Event handling"
33
description: "Handle events and manage state in your MCP server"
44
---
55

66
MCP servers process various events including requests, notifications, and connection lifecycle events. This guide explains how to implement event handlers effectively in your server.
77

8-
## Request handlers
8+
## Request handling
99

1010
Request handlers process incoming requests from clients and must return a response. Each handler is associated with a specific method name.
1111

@@ -62,7 +62,7 @@ async def handle_list_tools(request: ListToolsRequest) -> ListToolsResult:
6262
```
6363
</CodeGroup>
6464

65-
## Notification handlers
65+
## Notification handling
6666

6767
Notification handlers process one-way messages that don't require responses. They're useful for handling events like resource updates or logging messages.
6868

api-reference/server-api/resource-management.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: "Resource Management"
2+
title: "Resource management"
33
description: "How to implement resource management in your MCP server"
44
---
55

0 commit comments

Comments
 (0)