Skip to content

Commit 724a12b

Browse files
committed
Add mcp-docs with initial Antora support
1 parent 51b75dc commit 724a12b

11 files changed

Lines changed: 395 additions & 0 deletions

File tree

mcp-docs/pom.xml

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
~ Copyright 2023-2024 the original author or authors.
4+
~
5+
~ Licensed under the Apache License, Version 2.0 (the "License");
6+
~ you may not use this file except in compliance with the License.
7+
~ You may obtain a copy of the License at
8+
~
9+
~ https://www.apache.org/licenses/LICENSE-2.0
10+
~
11+
~ Unless required by applicable law or agreed to in writing, software
12+
~ distributed under the License is distributed on an "AS IS" BASIS,
13+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
~ See the License for the specific language governing permissions and
15+
~ limitations under the License.
16+
-->
17+
18+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
19+
<modelVersion>4.0.0</modelVersion>
20+
<parent>
21+
<groupId>org.springframework.experimental</groupId>
22+
<artifactId>mcp-parent</artifactId>
23+
<version>0.4.0-SNAPSHOT</version>
24+
</parent>
25+
<artifactId>mcp-docs</artifactId>
26+
<name>Spring AI MCP Docs</name>
27+
<description>Spring AI MCP documentation</description>
28+
29+
<build>
30+
<plugins>
31+
<plugin>
32+
<groupId>org.antora</groupId>
33+
<artifactId>antora-maven-plugin</artifactId>
34+
<version>${org.maven.antora-version}</version>
35+
<extensions>true</extensions>
36+
<configuration>
37+
<options>
38+
<option>--to-dir=target/antora/site</option>
39+
<option>--stacktrace</option>
40+
<option>--fetch</option>
41+
</options>
42+
<playbook>src/main/antora/antora-playbook.yml</playbook>
43+
<packages>
44+
<package>@antora/cli@3.2.0-alpha.6</package>
45+
<package>@antora/atlas-extension@1.0.0-alpha.2</package>
46+
<package>@antora/collector-extension@1.0.0-beta.1</package>
47+
<package>@asciidoctor/tabs@1.0.0-beta.6</package>
48+
<package>@springio/antora-extensions@1.14.2</package>
49+
<package>@springio/asciidoctor-extensions@1.0.0-alpha.12</package>
50+
<package>@djencks/asciidoctor-mathjax@0.0.9</package>
51+
</packages>
52+
</configuration>
53+
</plugin>
54+
<plugin>
55+
<groupId>io.spring.maven.antora</groupId>
56+
<artifactId>antora-component-version-maven-plugin</artifactId>
57+
<version>${io.spring.maven.antora-version}</version>
58+
<executions>
59+
<execution>
60+
<goals>
61+
<goal>antora-component-version</goal>
62+
</goals>
63+
</execution>
64+
</executions>
65+
</plugin>
66+
<plugin>
67+
<groupId>org.apache.maven.plugins</groupId>
68+
<artifactId>maven-assembly-plugin</artifactId>
69+
<version>${maven-assembly-plugin.version}</version>
70+
<configuration>
71+
<descriptors>
72+
<descriptor>src/assembly/javadocs.xml</descriptor>
73+
</descriptors>
74+
<finalName>spring-ai-mcp-${project.version}</finalName>
75+
<appendAssemblyId>true</appendAssemblyId>
76+
</configuration>
77+
</plugin>
78+
<plugin>
79+
<groupId>org.apache.maven.plugins</groupId>
80+
<artifactId>maven-deploy-plugin</artifactId>
81+
<version>${maven-deploy-plugin.version}</version>
82+
<configuration>
83+
<skip>true</skip>
84+
</configuration>
85+
</plugin>
86+
</plugins>
87+
</build>
88+
89+
</project>

mcp-docs/src/assembly/javadocs.xml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<!--
2+
~ Copyright 2023-2024 the original author or authors.
3+
~
4+
~ Licensed under the Apache License, Version 2.0 (the "License");
5+
~ you may not use this file except in compliance with the License.
6+
~ You may obtain a copy of the License at
7+
~
8+
~ https://www.apache.org/licenses/LICENSE-2.0
9+
~
10+
~ Unless required by applicable law or agreed to in writing, software
11+
~ distributed under the License is distributed on an "AS IS" BASIS,
12+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
~ See the License for the specific language governing permissions and
14+
~ limitations under the License.
15+
-->
16+
17+
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.1.0"
18+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
19+
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.1.0 http://maven.apache.org/xsd/assembly-2.1.0.xsd">
20+
<id>docs</id>
21+
<formats>
22+
<format>zip</format>
23+
</formats>
24+
<includeBaseDirectory>false</includeBaseDirectory>
25+
<fileSets>
26+
<fileSet>
27+
<directory>../target/site/apidocs</directory>
28+
<outputDirectory>api</outputDirectory>
29+
</fileSet>
30+
</fileSets>
31+
</assembly>
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# PACKAGES antora@3.2.0-alpha.6 @antora/atlas-extension:1.0.0-alpha.1 @antora/collector-extension@1.0.0-alpha.3 @springio/antora-extensions@1.1.0-alpha.2 @asciidoctor/tabs@1.0.0-alpha.12 @opendevise/antora-release-line-extension@1.0.0-alpha.2
2+
#
3+
# The purpose of this Antora playbook is to build the docs in the current branch.
4+
antora:
5+
extensions:
6+
- '@antora/collector-extension'
7+
# - require: '@springio/antora-extensions/root-component-extension'
8+
- require: '@springio/antora-extensions'
9+
root_component_name: 'ai'
10+
site:
11+
title: Spring AI Reference
12+
url: https://docs.spring.io/spring-ai-mcp/reference
13+
robots: allow
14+
git:
15+
ensure_git_suffix: false
16+
content:
17+
sources:
18+
- url: ./../../../..
19+
branches: HEAD
20+
start_path: mcp-docs/src/main/antora
21+
worktrees: true
22+
asciidoc:
23+
attributes:
24+
page-related-doc-categories: ai,java,ml,mcp
25+
page-pagination: ''
26+
hide-uri-scheme: '@'
27+
tabs-sync-option: '@'
28+
chomp: 'all'
29+
stem: 'asciimath'
30+
extensions:
31+
- '@asciidoctor/tabs'
32+
- '@springio/asciidoctor-extensions'
33+
- '@springio/asciidoctor-extensions/javadoc-extension'
34+
- '@springio/asciidoctor-extensions/include-code-extension'
35+
- '@djencks/asciidoctor-mathjax'
36+
sourcemap: true
37+
urls:
38+
latest_version_segment_strategy: redirect:to
39+
latest_version_segment: ''
40+
redirect_facility: httpd
41+
runtime:
42+
log:
43+
failure_level: warn
44+
format: pretty
45+
ui:
46+
bundle:
47+
url: https://github.com/spring-io/antora-ui-spring/releases/download/v0.4.17/ui-bundle.zip
48+
snapshot: true
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: ai
2+
version: true
3+
title: Spring AI
4+
nav:
5+
- modules/ROOT/nav.adoc
6+
ext:
7+
collector:
8+
- run:
9+
command: mvnw process-resources
10+
local: true
11+
scan:
12+
dir: mcp-docs/target/classes/antora-resources
736 KB
Loading
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
* xref:index.adoc[Overview]
2+
// ** xref:concepts.adoc[AI Concepts]
3+
// * xref:getting-started.adoc[Getting Started]
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
= Java & Spring MCP
2+
3+
Java SDK for the Model Context Protocol (MCP), providing seamless integration between Java and Spring applications and MCP-compliant AI resources and tools.
4+
5+
== Overview
6+
7+
Provides Java and Spring Framework integration for the link:https://modelcontextprotocol.org/docs/concepts/architecture[Model Context Protocol]. It enables Java applications to interact with AI models and tools through a standardized interface, supporting both synchronous and asynchronous communication patterns.
8+
9+
image::spring-ai-mcp-architecture.jpg[Spring AI MCP Architecture,600]
10+
11+
== Modules
12+
13+
The project consists of two main modules:
14+
15+
=== mcp
16+
17+
Java implementation of the Model Context Protocol specification. It includes:
18+
19+
* Synchronous and asynchronous link:https://github.com/spring-projects-experimental/spring-ai-mcp/blob/main/mcp/README.md#client-usage-examples[MCP Client] and link:https://github.com/spring-projects-experimental/spring-ai-mcp/blob/main/mcp/README.md#server-usage-examples[MCP Server] implementations
20+
* Standard MCP operations support (tool discovery, resource management, prompt handling, structured logging). Support for request and notification handling.
21+
* link:https://spec.modelcontextprotocol.io/specification/basic/transports/#stdio[Stdio] and link:https://spec.modelcontextprotocol.io/specification/basic/transports/#http-with-sse[SSE] transport implementations.
22+
* link:./mcp/README.md[Find more].
23+
24+
=== spring-ai-mcp
25+
26+
The Spring integration module provides Spring-specific functionality:
27+
28+
* Integration with Spring AI's function calling system
29+
* Spring-friendly abstractions for MCP clients
30+
* Auto-configurations (WIP)
31+
32+
== Requirements
33+
34+
* Java 17 or later
35+
* Maven 3.6 or later
36+
* Spring AI 1.0.0-M4 or later
37+
38+
== Installation
39+
40+
Add the following dependencies to your Maven project:
41+
42+
[source,xml]
43+
----
44+
<!-- For core MCP functionality -->
45+
<dependency>
46+
<groupId>org.springframework.experimental</groupId>
47+
<artifactId>mcp</artifactId>
48+
<version>0.4.0-SNAPSHOT</version>
49+
</dependency>
50+
51+
<!-- For Spring AI integration -->
52+
<dependency>
53+
<groupId>org.springframework.experimental</groupId>
54+
<artifactId>spring-ai-mcp</artifactId>
55+
<version>0.4.0-SNAPSHOT</version>
56+
</dependency>
57+
----
58+
59+
== Example Demos
60+
61+
Explore these MCP examples in the link:https://github.com/spring-projects/spring-ai-examples/tree/main/model-context-protocol[spring-ai-examples/model-context-protocol] repository:
62+
63+
* link:https://github.com/spring-projects/spring-ai-examples/tree/main/model-context-protocol/sqlite/simple[SQLite Simple] - Demonstrates LLM integration with a database
64+
* link:https://github.com/spring-projects/spring-ai-examples/tree/main/model-context-protocol/sqlite/chatbot[SQLite Chatbot] - Interactive chatbot with SQLite database interaction
65+
* link:https://github.com/spring-projects/spring-ai-examples/tree/main/model-context-protocol/filesystem[Filesystem] - Enables LLM interaction with local filesystem folders and files
66+
* link:https://github.com/spring-projects/spring-ai-examples/tree/main/model-context-protocol/brave[Brave] - Enables natural language interactions with Brave Search, allowing you to perform internet searches.
67+
* link:./spring-ai-mcp-sample/[Spring-ai-mcp-sample] - Showcases how to create and use MCP servers and clients with different transport modes and capabilities.
68+
69+
== Documentation
70+
71+
* link:mcp/README.md[Java MCP SDK documentation]
72+
** link:docs/ref-index.md[Reference documentation]
73+
* link:spring-ai-mcp/README.md[Spring Integration documentation]
74+
75+
== Development
76+
77+
=== Building from Source
78+
79+
[source,bash]
80+
----
81+
mvn clean install
82+
----
83+
84+
=== Running Tests
85+
86+
[source,bash]
87+
----
88+
mvn test
89+
----
90+
91+
== Project Information
92+
93+
* *Group ID*: org.springframework.experimental
94+
* *Version*: 0.4.0-SNAPSHOT
95+
* *Java Version*: 17
96+
* *Spring AI Version*: 1.0.0-M4
97+
98+
== Contributing
99+
100+
This is an experimental Spring project. Contributions are welcome! Please:
101+
102+
1. Fork the repository
103+
2. Create a feature branch
104+
3. Submit a Pull Request
105+
106+
== Team
107+
108+
* Christian Tzolov
109+
* Dariusz Jędrzejczyk
110+
111+
== Links
112+
113+
* link:https://github.com/spring-projects-experimental/spring-ai-mcp[GitHub Repository]
114+
* link:https://github.com/spring-projects-experimental/spring-ai-mcp/issues[Issue Tracker]
115+
* link:https://github.com/spring-projects-experimental/spring-ai-mcp/actions[CI/CD]
116+
117+
== License
118+
119+
This project is licensed under the link:LICENSE[Apache License 2.0].
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
= Spring AI MCP Spring
2+
:page-title: Spring AI MCP Spring
3+
:doctype: book
4+
:icons: font
5+
:source-highlighter: highlight.js
6+
:toc: left
7+
8+
Spring Integration module for Model Control Protocol (MCP) that provides Spring-specific functionality for working with MCP clients.
9+
10+
== Overview
11+
12+
The `spring-ai-mcp` module is part of the https://github.com/spring-projects-experimental/spring-ai-mcp[Spring AI MCP] project. It provides Spring Framework integration for the Model Control Protocol (MCP), enabling seamless integration of MCP functionality within Spring applications.
13+
14+
== Features
15+
16+
* Spring integration for MCP clients
17+
* Function callback implementation for tool invocations
18+
* Seamless integration with Spring AI's function calling capabilities
19+
20+
== Main Components
21+
22+
=== McpFunctionCallback
23+
24+
The `McpFunctionCallback` class is the primary component of this module. It implements Spring AI's `FunctionCallback` interface and provides:
25+
26+
* Integration between Spring AI's function calling system and MCP tools
27+
* Automatic conversion between JSON and Java objects for tool arguments
28+
* Synchronous tool execution support
29+
30+
== Usage
31+
32+
To use this module, add the following dependency to your Maven project:
33+
34+
[source,xml]
35+
----
36+
<dependency>
37+
<groupId>org.springframework.experimental</groupId>
38+
<artifactId>spring-ai-mcp</artifactId>
39+
<version>0.4.0-SNAPSHOT</version>
40+
</dependency>
41+
----
42+
43+
== License
44+
45+
This project is licensed under the https://www.apache.org/licenses/LICENSE-2.0[Apache License 2.0].
46+
47+
== Links
48+
49+
* https://github.com/spring-projects-experimental/spring-ai-mcp[GitHub Repository]
50+
* https://github.com/spring-projects-experimental/spring-ai-mcp/issues[Issue Tracker]
51+
52+
== Contributing
53+
54+
This is an experimental Spring project. Contributions are welcome! Please refer to the main project's contribution guidelines.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
version: ${antora-component.version}
2+
prerelease: ${antora-component.prerelease}

0 commit comments

Comments
 (0)