Skip to content

Commit 7e73152

Browse files
markpollacktzolov
authored andcommitted
Convert asciidoc/antor docs to mintlify
1 parent a439e4a commit 7e73152

14 files changed

+1390
-0
lines changed

Diff for: mintlify-docs/docs/dependency-management.mdx

+104
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
---
2+
title: Dependency Management
3+
description: Guide to managing dependencies for the Model Context Protocol (MCP) Java SDK
4+
---
5+
6+
# Dependency Management
7+
8+
## Bill of Materials (BOM)
9+
10+
The Bill of Materials (BOM) declares the recommended versions of all the dependencies used by a given release.
11+
Using the BOM from your application's build script avoids the need for you to specify and maintain the dependency versions yourself.
12+
Instead, the version of the BOM you're using determines the utilized dependency versions.
13+
It also ensures that you're using supported and tested versions of the dependencies by default, unless you choose to override them.
14+
15+
Add the BOM to your project:
16+
17+
<Tabs>
18+
<Tab title="Maven">
19+
```xml
20+
<dependencyManagement>
21+
<dependencies>
22+
<dependency>
23+
<groupId>org.modelcontextprotocol.sdk</groupId>
24+
<artifactId>mcp-bom</artifactId>
25+
<version>0.6.0-SNAPSHOT</version>
26+
<type>pom</type>
27+
<scope>import</scope>
28+
</dependency>
29+
</dependencies>
30+
</dependencyManagement>
31+
```
32+
</Tab>
33+
34+
<Tab title="Gradle">
35+
```groovy
36+
dependencies {
37+
implementation platform("org.modelcontextprotocol.sdk:mcp-bom:0.6.0-SNAPSHOT")
38+
//...
39+
}
40+
```
41+
42+
Gradle users can also use the Spring AI MCP BOM by leveraging Gradle (5.0+) native support for declaring dependency constraints using a Maven BOM.
43+
This is implemented by adding a 'platform' dependency handler method to the dependencies section of your Gradle build script.
44+
As shown in the snippet below this can then be followed by version-less declarations of the Starter Dependencies for the one or more spring-ai modules you wish to use, e.g. spring-ai-openai.
45+
</Tab>
46+
</Tabs>
47+
48+
Replace the version number with the version of the BOM you want to use.
49+
50+
## Available Dependencies
51+
52+
The following dependencies are available and managed by the BOM:
53+
54+
### Core Dependencies
55+
56+
- `org.modelcontextprotocol.sdk:mcp` - Core MCP library providing the base functionality and APIs for Model Context Protocol implementation.
57+
58+
### Transport Dependencies
59+
60+
- `org.modelcontextprotocol.sdk:mcp-webflux-sse-transport` - WebFlux-based Server-Sent Events (SSE) transport implementation for reactive applications.
61+
- `org.modelcontextprotocol.sdk:mcp-webmvc-sse-transport` - WebMVC-based Server-Sent Events (SSE) transport implementation for servlet-based applications.
62+
63+
### Testing Dependencies
64+
65+
- `org.modelcontextprotocol.sdk:mcp-test` - Testing utilities and support for MCP-based applications.
66+
67+
### Milestone and Snapshot Repositories
68+
69+
To use the Milestone and Snapshot version, you need to add references to the Spring Milestone and/or Snapshot repositories in your build file.
70+
Add the following repository definitions to your Maven or Gradle build file:
71+
72+
<Tabs>
73+
<Tab title="Maven">
74+
```xml
75+
<repositories>
76+
<repository>
77+
<id>spring-milestones</id>
78+
<n>Spring Milestones</n>
79+
<url>https://repo.spring.io/milestone</url>
80+
<snapshots>
81+
<enabled>false</enabled>
82+
</snapshots>
83+
</repository>
84+
<repository>
85+
<id>spring-snapshots</id>
86+
<n>Spring Snapshots</n>
87+
<url>https://repo.spring.io/snapshot</url>
88+
<releases>
89+
<enabled>false</enabled>
90+
</releases>
91+
</repository>
92+
</repositories>
93+
```
94+
</Tab>
95+
96+
<Tab title="Gradle">
97+
```groovy
98+
repositories {
99+
maven { url 'https://repo.spring.io/milestone' }
100+
maven { url 'https://repo.spring.io/snapshot' }
101+
}
102+
```
103+
</Tab>
104+
</Tabs>

Diff for: mintlify-docs/docs/mcp-capabilities.mdx

+139
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
---
2+
title: MCP Server Capabilities
3+
description: Configure and manage Model Context Protocol (MCP) server capabilities including tools, resources, and prompts
4+
---
5+
6+
# Model Context Protocol Server Capabilities
7+
8+
The server can be configured with various capabilities:
9+
10+
```java
11+
var capabilities = ServerCapabilities.builder()
12+
.resources(false, true) // Resource support with list changes notifications
13+
.tools(true) // Tool support with list changes notifications
14+
.prompts(true) // Prompt support with list changes notifications
15+
.logging() // Enable logging support (enabled by default with loging level INFO)
16+
.build();
17+
```
18+
19+
## Logging Support
20+
21+
The server provides structured logging capabilities that allow sending log messages to clients with different severity levels:
22+
23+
```java
24+
// Send a log message to clients
25+
server.loggingNotification(LoggingMessageNotification.builder()
26+
.level(LoggingLevel.INFO)
27+
.logger("custom-logger")
28+
.data("Custom log message")
29+
.build());
30+
```
31+
32+
Clients can control the minimum logging level they receive through the `mcpClient.setLoggingLevel(level)` request. Messages below the set level will be filtered out.
33+
Supported logging levels (in order of increasing severity): DEBUG (0), INFO (1), NOTICE (2), WARNING (3), ERROR (4), CRITICAL (5), ALERT (6), EMERGENCY (7)
34+
35+
## Tool Registration
36+
37+
<Tabs>
38+
<Tab title="Sync">
39+
```java
40+
// Sync tool registration
41+
var syncToolRegistration = new McpServerFeatures.SyncToolRegistration(
42+
new Tool("calculator", "Basic calculator", Map.of(
43+
"operation", "string",
44+
"a", "number",
45+
"b", "number"
46+
)),
47+
arguments -> {
48+
// Tool implementation
49+
return new CallToolResult(result, false);
50+
}
51+
);
52+
```
53+
</Tab>
54+
55+
<Tab title="Async">
56+
```java
57+
// Async tool registration
58+
var asyncToolRegistration = new McpServerFeatures.AsyncToolRegistration(
59+
new Tool("calculator", "Basic calculator", Map.of(
60+
"operation", "string",
61+
"a", "number",
62+
"b", "number"
63+
)),
64+
arguments -> {
65+
// Tool implementation
66+
return Mono.just(new CallToolResult(result, false));
67+
}
68+
);
69+
```
70+
</Tab>
71+
</Tabs>
72+
73+
## Resource Registration
74+
75+
<Tabs>
76+
<Tab title="Sync">
77+
```java
78+
// Sync resource registration
79+
var syncResourceRegistration = new McpServerFeatures.SyncResourceRegistration(
80+
new Resource("custom://resource", "name", "description", "mime-type", null),
81+
request -> {
82+
// Resource read implementation
83+
return new ReadResourceResult(contents);
84+
}
85+
);
86+
```
87+
</Tab>
88+
89+
<Tab title="Async">
90+
```java
91+
// Async resource registration
92+
var asyncResourceRegistration = new McpServerFeatures.AsyncResourceRegistration(
93+
new Resource("custom://resource", "name", "description", "mime-type", null),
94+
request -> {
95+
// Resource read implementation
96+
return Mono.just(new ReadResourceResult(contents));
97+
}
98+
);
99+
```
100+
</Tab>
101+
</Tabs>
102+
103+
## Prompt Registration
104+
105+
<Tabs>
106+
<Tab title="Sync">
107+
```java
108+
// Sync prompt registration
109+
var syncPromptRegistration = new McpServerFeatures.SyncPromptRegistration(
110+
new Prompt("greeting", "description", List.of(
111+
new PromptArgument("name", "description", true)
112+
)),
113+
request -> {
114+
// Prompt implementation
115+
return new GetPromptResult(description, messages);
116+
}
117+
);
118+
```
119+
</Tab>
120+
121+
<Tab title="Async">
122+
```java
123+
// Async prompt registration
124+
var asyncPromptRegistration = new McpServerFeatures.AsyncPromptRegistration(
125+
new Prompt("greeting", "description", List.of(
126+
new PromptArgument("name", "description", true)
127+
)),
128+
request -> {
129+
// Prompt implementation
130+
return Mono.just(new GetPromptResult(description, messages));
131+
}
132+
);
133+
```
134+
</Tab>
135+
</Tabs>
136+
137+
# Error Handling
138+
139+
The SDK provides comprehensive error handling through the McpError class, covering protocol compatibility, transport communication, JSON-RPC messaging, tool execution, resource management, prompt handling, timeouts, and connection issues. This unified error handling approach ensures consistent and reliable error management across both synchronous and asynchronous operations.

0 commit comments

Comments
 (0)