Skip to content

Commit f5f2f65

Browse files
authored
Merge branch 'main' into add-mcp-use-client
2 parents b2a54e3 + 9b15ff9 commit f5f2f65

39 files changed

+7548
-161
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111

1212
steps:
1313
- uses: actions/checkout@v4
14-
- uses: actions/setup-node@v2
14+
- uses: actions/setup-node@v4
1515
with:
1616
node-version: 20
1717
cache: npm

docs/clients.mdx

Lines changed: 293 additions & 79 deletions
Large diffs are not rendered by default.

docs/development/updates.mdx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@ title: "What's New"
33
description: 'The latest updates and improvements to MCP'
44
---
55

6+
<Update label="2025-04-10" description="Java SDK 0.9.0 released">
7+
- Version [0.9.0](https://github.com/modelcontextprotocol/java-sdk/releases/tag/v0.9.0) of the MCP Java SDK has been released.
8+
- Refactored logging system to use exchange mechanism
9+
- Custom Context Paths
10+
- Server Instructions
11+
- CallToolResult Enhancement
12+
</Update>
613
<Update label="2025-03-26" description="Kotlin SDK 0.4.0 released">
714
- Fix issues and cleanup API
815
- Added binary compatibility tracking to avoid breaking changes

docs/docs.json

Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
]
2727
},
2828
"examples",
29-
"clients"
29+
"clients",
30+
"faqs"
3031
]
3132
},
3233
{
@@ -174,6 +175,55 @@
174175
}
175176
]
176177
},
178+
{
179+
"group": "draft",
180+
"pages": [
181+
"specification/draft/index",
182+
"specification/draft/changelog",
183+
"specification/draft/architecture/index",
184+
{
185+
"group": "Base Protocol",
186+
"pages": [
187+
"specification/draft/basic/index",
188+
"specification/draft/basic/lifecycle",
189+
"specification/draft/basic/transports",
190+
"specification/draft/basic/authorization",
191+
{
192+
"group": "Utilities",
193+
"pages": [
194+
"specification/draft/basic/utilities/cancellation",
195+
"specification/draft/basic/utilities/ping",
196+
"specification/draft/basic/utilities/progress"
197+
]
198+
}
199+
]
200+
},
201+
{
202+
"group": "Client Features",
203+
"pages": [
204+
"specification/draft/client/roots",
205+
"specification/draft/client/sampling"
206+
]
207+
},
208+
{
209+
"group": "Server Features",
210+
"pages": [
211+
"specification/draft/server/index",
212+
"specification/draft/server/prompts",
213+
"specification/draft/server/resources",
214+
"specification/draft/server/tools",
215+
{
216+
"group": "Utilities",
217+
"pages": [
218+
"specification/draft/server/utilities/completion",
219+
"specification/draft/server/utilities/logging",
220+
"specification/draft/server/utilities/pagination"
221+
]
222+
}
223+
]
224+
}
225+
]
226+
},
177227
{
178228
"group": "Resources",
179229
"pages": [

docs/docs/concepts/architecture.mdx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,7 @@ The protocol layer handles message framing, request/response linking, and high-l
6262
request: RequestT,
6363
result_type: type[Result]
6464
) -> Result:
65-
"""
66-
Send request and wait for response. Raises McpError if response contains error.
67-
"""
65+
"""Send request and wait for response. Raises McpError if response contains error."""
6866
# Request handling implementation
6967

7068
async def send_notification(

docs/docs/concepts/tools.mdx

Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,13 @@ Each tool is defined with the following structure:
3030
inputSchema: { // JSON Schema for the tool's parameters
3131
type: "object",
3232
properties: { ... } // Tool-specific parameters
33+
},
34+
annotations?: { // Optional hints about tool behavior
35+
title?: string; // Human-readable title for the tool
36+
readOnlyHint?: boolean; // If true, the tool does not modify its environment
37+
destructiveHint?: boolean; // If true, the tool may perform destructive updates
38+
idempotentHint?: boolean; // If true, repeated calls with same args have no additional effect
39+
openWorldHint?: boolean; // If true, tool interacts with external entities
3340
}
3441
}
3542
```
@@ -302,6 +309,162 @@ Here's an example of proper error handling for tools:
302309

303310
This approach allows the LLM to see that an error occurred and potentially take corrective action or request human intervention.
304311

312+
## Tool annotations
313+
314+
Tool annotations provide additional metadata about a tool's behavior, helping clients understand how to present and manage tools. These annotations are hints that describe the nature and impact of a tool, but should not be relied upon for security decisions.
315+
316+
### Purpose of tool annotations
317+
318+
Tool annotations serve several key purposes:
319+
320+
1. Provide UX-specific information without affecting model context
321+
2. Help clients categorize and present tools appropriately
322+
3. Convey information about a tool's potential side effects
323+
4. Assist in developing intuitive interfaces for tool approval
324+
325+
### Available tool annotations
326+
327+
The MCP specification defines the following annotations for tools:
328+
329+
| Annotation | Type | Default | Description |
330+
|------------|------|---------|-------------|
331+
| `title` | string | - | A human-readable title for the tool, useful for UI display |
332+
| `readOnlyHint` | boolean | false | If true, indicates the tool does not modify its environment |
333+
| `destructiveHint` | boolean | true | If true, the tool may perform destructive updates (only meaningful when `readOnlyHint` is false) |
334+
| `idempotentHint` | boolean | false | If true, calling the tool repeatedly with the same arguments has no additional effect (only meaningful when `readOnlyHint` is false) |
335+
| `openWorldHint` | boolean | true | If true, the tool may interact with an "open world" of external entities |
336+
337+
### Example usage
338+
339+
Here's how to define tools with annotations for different scenarios:
340+
341+
```typescript
342+
// A read-only search tool
343+
{
344+
name: "web_search",
345+
description: "Search the web for information",
346+
inputSchema: {
347+
type: "object",
348+
properties: {
349+
query: { type: "string" }
350+
},
351+
required: ["query"]
352+
},
353+
annotations: {
354+
title: "Web Search",
355+
readOnlyHint: true,
356+
openWorldHint: true
357+
}
358+
}
359+
360+
// A destructive file deletion tool
361+
{
362+
name: "delete_file",
363+
description: "Delete a file from the filesystem",
364+
inputSchema: {
365+
type: "object",
366+
properties: {
367+
path: { type: "string" }
368+
},
369+
required: ["path"]
370+
},
371+
annotations: {
372+
title: "Delete File",
373+
readOnlyHint: false,
374+
destructiveHint: true,
375+
idempotentHint: true,
376+
openWorldHint: false
377+
}
378+
}
379+
380+
// A non-destructive database record creation tool
381+
{
382+
name: "create_record",
383+
description: "Create a new record in the database",
384+
inputSchema: {
385+
type: "object",
386+
properties: {
387+
table: { type: "string" },
388+
data: { type: "object" }
389+
},
390+
required: ["table", "data"]
391+
},
392+
annotations: {
393+
title: "Create Database Record",
394+
readOnlyHint: false,
395+
destructiveHint: false,
396+
idempotentHint: false,
397+
openWorldHint: false
398+
}
399+
}
400+
```
401+
402+
### Integrating annotations in server implementation
403+
404+
<Tabs>
405+
<Tab title="TypeScript">
406+
```typescript
407+
server.setRequestHandler(ListToolsRequestSchema, async () => {
408+
return {
409+
tools: [{
410+
name: "calculate_sum",
411+
description: "Add two numbers together",
412+
inputSchema: {
413+
type: "object",
414+
properties: {
415+
a: { type: "number" },
416+
b: { type: "number" }
417+
},
418+
required: ["a", "b"]
419+
},
420+
annotations: {
421+
title: "Calculate Sum",
422+
readOnlyHint: true,
423+
openWorldHint: false
424+
}
425+
}]
426+
};
427+
});
428+
```
429+
</Tab>
430+
<Tab title="Python">
431+
```python
432+
from mcp.server.fastmcp import FastMCP
433+
434+
mcp = FastMCP("example-server")
435+
436+
@mcp.tool(
437+
annotations={
438+
"title": "Calculate Sum",
439+
"readOnlyHint": True,
440+
"openWorldHint": False
441+
}
442+
)
443+
async def calculate_sum(a: float, b: float) -> str:
444+
"""Add two numbers together.
445+
446+
Args:
447+
a: First number to add
448+
b: Second number to add
449+
"""
450+
result = a + b
451+
return str(result)
452+
```
453+
</Tab>
454+
</Tabs>
455+
456+
### Best practices for tool annotations
457+
458+
1. **Be accurate about side effects**: Clearly indicate whether a tool modifies its environment and whether those modifications are destructive.
459+
460+
2. **Use descriptive titles**: Provide human-friendly titles that clearly describe the tool's purpose.
461+
462+
3. **Indicate idempotency properly**: Mark tools as idempotent only if repeated calls with the same arguments truly have no additional effect.
463+
464+
4. **Set appropriate open/closed world hints**: Indicate whether a tool interacts with a closed system (like a database) or an open system (like the web).
465+
466+
5. **Remember annotations are hints**: All properties in ToolAnnotations are hints and not guaranteed to provide a faithful description of tool behavior. Clients should never make security-critical decisions based solely on annotations.
467+
305468
## Testing tools
306469

307470
A comprehensive testing strategy for MCP tools should cover:

docs/examples.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ These MCP servers are maintained by companies for their platforms:
4646
- **[E2B](https://github.com/e2b-dev/mcp-server)** - Execute code in secure cloud sandboxes
4747
- **[Neon](https://github.com/neondatabase/mcp-server-neon)** - Interact with the Neon serverless Postgres platform
4848
- **[Obsidian Markdown Notes](https://github.com/calclavia/mcp-obsidian)** - Read and search through Markdown notes in Obsidian vaults
49+
- **[Prisma](https://pris.ly/docs/mcp-server)** - Manage and interact with Prisma Postgres databases
4950
- **[Qdrant](https://github.com/qdrant/mcp-server-qdrant/)** - Implement semantic memory using the Qdrant vector search engine
5051
- **[Raygun](https://github.com/MindscapeHQ/mcp-server-raygun)** - Access crash reporting and monitoring data
5152
- **[Search1API](https://github.com/fatwang2/search1api-mcp)** - Unified API for search, crawling, and sitemaps
@@ -121,6 +122,7 @@ To use an MCP server with Claude, add it to your configuration:
121122
- [Awesome MCP Servers](https://github.com/punkpeye/awesome-mcp-servers) - Curated list of MCP servers
122123
- [MCP CLI](https://github.com/wong2/mcp-cli) - Command-line inspector for testing MCP servers
123124
- [MCP Get](https://mcp-get.com) - Tool for installing and managing MCP servers
125+
- [Pipedream MCP](https://mcp.pipedream.com) - MCP servers with built-in auth for 3,000+ APIs and 10,000+ tools
124126
- [Supergateway](https://github.com/supercorp-ai/supergateway) - Run MCP stdio servers over SSE
125127
- [Zapier MCP](https://zapier.com/mcp) - MCP Server with over 7,000+ apps and 30,000+ actions
126128

docs/faqs.mdx

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
---
2+
title: "FAQs"
3+
description: "Explaining MCP and why it matters in simple terms"
4+
---
5+
6+
## What is MCP?
7+
8+
MCP (Model Context Protocol) is a standard way for AI applications and agents to connect to and work with your data sources (e.g. local files, databases, or content repositories) and tools (e.g. GitHub, Google Maps, or Puppeteer).
9+
10+
Think of MCP as a universal adapter for AI applications, similar to what USB-C is for physical devices. USB-C acts as a universal adapter to connect devices to various peripherals and accessories. Similarly, MCP provides a standardized way to connect AI applications to different data and tools.
11+
12+
Before USB-C, you needed different cables for different connections. Similarly, before MCP, developers had to build custom connections to each data source or tool they wanted their AI application to work with—a time-consuming process that often resulted in limited functionality. Now, with MCP, developers can easily add connections to their AI applications, making their applications much more powerful from day one.
13+
14+
## Why does MCP matter?
15+
16+
### For AI application users
17+
18+
MCP means your AI applications can access the information and tools you work with every day, making them much more helpful. Rather than AI being limited to what it already knows about, it can now understand your specific documents, data, and work context.
19+
20+
For example, by using MCP servers, applications can access your personal documents from Google Drive or data about your codebase from GitHub, providing more personalized and contextually relevant assistance.
21+
22+
Imagine asking an AI assistant: "Summarize last week's team meeting notes and schedule follow-ups with everyone."
23+
24+
By using connections to data sources powered by MCP, the AI assistant can:
25+
26+
- Connect to your Google Drive through an MCP server to read meeting notes
27+
- Understand who needs follow-ups based on the notes
28+
- Connect to your calendar through another MCP server to schedule the meetings automatically
29+
30+
### For developers
31+
32+
MCP reduces development time and complexity when building AI applications that need to access various data sources. With MCP, developers can focus on building great AI experiences rather than repeatedly creating custom connectors.
33+
34+
Traditionally, connecting applications with data sources required building custom, one-off connections for each data source and each application. This created significant duplicative work—every developer wanting to connect their AI application to Google Drive or Slack needed to build their own connection.
35+
36+
MCP simplifies this by enabling developers to build MCP servers for data sources that are then reusable by various applications. For example, using the open source Google Drive MCP server, many different applications can access data from Google Drive without each developer needing to build a custom connection.
37+
38+
This open source ecosystem of MCP servers means developers can leverage existing work rather than starting from scratch, making it easier to build powerful AI applications that seamlessly integrate with the tools and data sources their users already rely on.
39+
40+
## How does MCP work?
41+
42+
<Frame>
43+
<img src="/images/mcp-simple-diagram.png" />
44+
</Frame>
45+
46+
MCP creates a bridge between your AI applications and your data through a straightforward system:
47+
48+
- **MCP servers** connect to your data sources and tools (like Google Drive or Slack)
49+
- **MCP clients** are run by AI applications (like Claude Desktop) to connect them to these servers
50+
- When you give permission, your AI application discovers available MCP servers
51+
- The AI model can then use these connections to read information and take actions
52+
53+
This modular system means new capabilities can be added without changing AI applications themselves—just like adding new accessories to your computer without upgrading your entire system.
54+
55+
## Who creates and maintains MCP servers?
56+
57+
MCP servers are developed and maintained by:
58+
59+
- Developers at Anthropic who build servers for common tools and data sources
60+
- Open source contributors who create servers for tools they use
61+
- Enterprise development teams building servers for their internal systems
62+
- Software providers making their applications AI-ready
63+
64+
Once an open source MCP server is created for a data source, it can be used by any MCP-compatible AI application, creating a growing ecosystem of connections. See our [list of example servers](https://modelcontextprotocol.io/examples), or [get started building your own server](https://modelcontextprotocol.io/quickstart/server).

docs/images/mcp-simple-diagram.png

138 KB
Loading

0 commit comments

Comments
 (0)