Skip to content

Commit bf77b6b

Browse files
authored
Make README formatting more consistent
Grammar has also been slightly improved.
1 parent 31acdcb commit bf77b6b

File tree

1 file changed

+20
-24
lines changed

1 file changed

+20
-24
lines changed

README.md

Lines changed: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
- [Resources](#resources)
1212
- [Tools](#tools)
1313
- [Prompts](#prompts)
14-
- [Completions](#completions)
14+
- [Completions](#argument-completions)
1515
- [Sampling](#sampling)
1616
- [Running Your Server](#running-your-server)
1717
- [stdio](#stdio)
@@ -32,7 +32,7 @@
3232

3333
## Overview
3434

35-
The Model Context Protocol allows applications to provide context for LLMs in a standardized way, separating the concerns of providing context from the actual LLM interaction. This TypeScript SDK implements the full MCP specification, making it easy to:
35+
The Model Context Protocol (MCP) allows applications to provide context for LLMs in a standardized way, separating the concerns of providing context from the actual LLM interaction. This TypeScript SDK implements the full MCP specification, making it easy to:
3636

3737
- Build MCP clients that can connect to any MCP server
3838
- Create MCP servers that expose resources, prompts and tools
@@ -45,7 +45,7 @@ The Model Context Protocol allows applications to provide context for LLMs in a
4545
npm install @modelcontextprotocol/sdk
4646
```
4747

48-
> ⚠️ MCP requires Node.js v18.x or higher to work fine.
48+
> ⚠️ MCP requires Node.js v18.x or higher for maximum compatibility.
4949
5050
## Quick Start
5151

@@ -97,7 +97,8 @@ await server.connect(transport);
9797

9898
## What is MCP?
9999

100-
The [Model Context Protocol (MCP)](https://modelcontextprotocol.io) lets you build servers that expose data and functionality to LLM applications in a secure, standardized way. Think of it like a web API, but specifically designed for LLM interactions. MCP servers can:
100+
The [Model Context Protocol (MCP)](https://modelcontextprotocol.io) lets you build servers that expose data and functionality to LLM applications in a secure, standardized way. Think of it like a web API, but specifically designed for LLM interactions.
101+
MCP servers can:
101102

102103
- Expose data through **Resources** (think of these sort of like GET endpoints; they are used to load information into the LLM's context)
103104
- Provide functionality through **Tools** (sort of like POST endpoints; they are used to execute code or otherwise produce a side effect)
@@ -185,7 +186,7 @@ server.registerResource(
185186

186187
### Tools
187188

188-
Tools let LLMs take actions through your server. Unlike resources, tools are expected to perform computation and have side effects:
189+
Tools let LLMs take actions through your server. Unlike resources, tools are expected to perform computations and have side effects:
189190

190191
```typescript
191192
// Simple tool with parameters
@@ -257,7 +258,7 @@ server.registerTool(
257258

258259
#### ResourceLinks
259260

260-
Tools can return `ResourceLink` objects to reference resources without embedding their full content. This is essential for performance when dealing with large files or many resources - clients can then selectively read only the resources they need using the provided URIs.
261+
Tools can return `ResourceLink` objects to reference resources without embedding their full content. This is essential for performance when dealing with large files or many resources - clients can selectively read only the resources they need using the provided URIs.
261262

262263
### Prompts
263264

@@ -321,11 +322,10 @@ server.registerPrompt(
321322
);
322323
```
323324

324-
### Completions
325+
### Argument Completions
325326

326-
MCP supports argument completions to help users fill in prompt arguments and resource template parameters. See the examples above for [resource completions](#resources) and [prompt completions](#prompts).
327-
328-
#### Client Usage
327+
See the examples above for [resource completions](#resources) and [prompt completions](#prompts).
328+
MCP supports argument completions to help users fill in prompt arguments and resource template parameters:
329329

330330
```typescript
331331
// Request completions for any argument
@@ -349,7 +349,7 @@ const result = await client.complete({
349349

350350
### Display Names and Metadata
351351

352-
All resources, tools, and prompts support an optional `title` field for better UI presentation. The `title` is used as a display name, while `name` remains the unique identifier.
352+
All resources, tools, and prompts support an optional `title` field for better UI presentation. `title` is used as a display name, while `name` remains the unique identifier.
353353

354354
**Note:** The `register*` methods (`registerTool`, `registerPrompt`, `registerResource`) are the recommended approach for new code. The older methods (`tool`, `prompt`, `resource`) remain available for backwards compatibility.
355355

@@ -359,7 +359,7 @@ For tools specifically, there are two ways to specify a title:
359359
- `title` field in the tool configuration
360360
- `annotations.title` field (when using the older `tool()` method with annotations)
361361

362-
The precedence order is: `title``annotations.title``name`
362+
The precedence order is: `title``annotations.title``name`:
363363

364364
```typescript
365365
// Using registerTool (recommended)
@@ -387,7 +387,7 @@ const displayName = getDisplayName(tool);
387387

388388
### Sampling
389389

390-
MCP servers can request LLM completions from connected clients that support sampling.
390+
MCP servers can request LLM completions from connected clients that support sampling:
391391

392392
```typescript
393393
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
@@ -476,7 +476,7 @@ For remote servers, set up a Streamable HTTP transport that handles both client
476476

477477
#### With Session Management
478478

479-
In some cases, servers need to be stateful. This is achieved by [session management](https://modelcontextprotocol.io/specification/2025-03-26/basic/transports#session-management).
479+
In some cases, servers need to be stateful. This is achieved with [session management](https://modelcontextprotocol.io/specification/2025-03-26/basic/transports#session-management):
480480

481481
```typescript
482482
import express from "express";
@@ -570,7 +570,7 @@ app.listen(3000);
570570
```
571571

572572
> [!TIP]
573-
> When using this in a remote environment, make sure to allow the header parameter `mcp-session-id` in CORS. Otherwise, it may result in a `Bad Request: No valid session ID provided` error. Read the following section for examples.
573+
> When using this in a remote environment, make sure to allow the header parameter `mcp-session-id` in CORS. Otherwise, it may result in a `Bad Request: No valid session ID provided` error. Read this following section for examples.
574574
575575

576576
#### CORS Configuration for Browser-Based Clients
@@ -854,7 +854,7 @@ server.registerTool(
854854

855855
If you want to offer an initial set of tools/prompts/resources, but later add additional ones based on user action or external state change, you can add/update/remove them _after_ the Server is connected. This will automatically emit the corresponding `listChanged` notifications:
856856

857-
```ts
857+
```typescript
858858
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
859859
import { z } from "zod";
860860

@@ -921,7 +921,7 @@ This feature coalesces multiple, rapid calls for the same notification type into
921921
> [!IMPORTANT]
922922
> This feature is designed for "simple" notifications that do not carry unique data in their parameters. To prevent silent data loss, debouncing is **automatically bypassed** for any notification that contains a `params` object or a `relatedRequestId`. Such notifications will always be sent immediately.
923923
924-
This is an opt-in feature configured during server initialization.
924+
This is an opt-in feature configured during server initialization:
925925

926926
```typescript
927927
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
@@ -951,7 +951,7 @@ server.registerTool("tool3", ...).disable();
951951

952952
### Low-Level Server
953953

954-
For more control, you can use the low-level Server class directly:
954+
For more control, you can use the low-level `Server` class directly:
955955

956956
```typescript
957957
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
@@ -1211,11 +1211,7 @@ This setup allows you to:
12111211

12121212
### Backwards Compatibility
12131213

1214-
Clients and servers with StreamableHttp transport can maintain [backwards compatibility](https://modelcontextprotocol.io/specification/2025-03-26/basic/transports#backwards-compatibility) with the deprecated HTTP+SSE transport (from protocol version 2024-11-05) as follows
1215-
1216-
#### Client-Side Compatibility
1217-
1218-
For clients that need to work with both Streamable HTTP and older SSE servers:
1214+
Clients and servers with Streamable HTTP transport can maintain [backwards compatibility](https://modelcontextprotocol.io/specification/2025-03-26/basic/transports#backwards-compatibility) with the deprecated HTTP+SSE transport (from protocol version 2024-11-05) as follows:
12191215

12201216
```typescript
12211217
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
@@ -1248,7 +1244,7 @@ try {
12481244

12491245
#### Server-Side Compatibility
12501246

1251-
For servers that need to support both Streamable HTTP and older clients:
1247+
For servers that need to support both Streamable HTTP as well as older clients:
12521248

12531249
```typescript
12541250
import express from "express";

0 commit comments

Comments
 (0)