You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(mcp): update SQLite examples to use new MCP client API
- Replace deprecated StdioServerTransport with StdioClientTransport
- Update SyncMcpToolCallbackProvider to use builder pattern with noPrefix generator
- Change SQLite MCP-Server documentation links from GitHub to PyPI
- Remove obsolete function callback documentation sections
- Streamline MCP client initialization with new timeout configuration
These changes align with the latest Spring AI MCP integration patterns
and improve code maintainability across both simple and chatbot examples.
Copy file name to clipboardExpand all lines: model-context-protocol/sqlite/chatbot/README.md
+4-37Lines changed: 4 additions & 37 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
A demo application showcasing the integration of Spring AI with SQLite databases using the Model Context Protocol (MCP). This application enables natural language interactions with your SQLite database through a command-line interface.
4
4
5
-
It uses the [SQLite MCP-Server](https://github.com/modelcontextprotocol/servers/tree/main/src/sqlite) to enable running SQL queries, analyzing business data, and automatically generating business insight memos.
5
+
It uses the [SQLite MCP-Server](https://pypi.org/project/mcp-server-sqlite/) to enable running SQL queries, analyzing business data, and automatically generating business insight memos.
6
6
7
7
The demo starts a simple chatbot where your can ask qustions about the data stored in the database.
8
8
@@ -68,7 +68,7 @@ It has a `PRODUCTS` table and was created using the script `create-database.sh`
68
68
Enables real-time conversation with your database:
Copy file name to clipboardExpand all lines: model-context-protocol/sqlite/chatbot/src/main/java/org/springframework/ai/mcp/samples/sqlite/Application.java
Copy file name to clipboardExpand all lines: model-context-protocol/sqlite/simple/README.md
+12-51Lines changed: 12 additions & 51 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
A demo application showcasing the integration of Spring AI with SQLite databases using the Model Context Protocol (MCP). This application enables natural language interactions with your SQLite database through a command-line interface.
4
4
5
-
It uses the [SQLite MCP-Server](https://github.com/modelcontextprotocol/servers/tree/main/src/sqlite) to enable running SQL queries, analyzing business data, and automatically generating business insight memos.
5
+
It uses the [SQLite MCP-Server](https://pypi.org/project/mcp-server-sqlite/) to enable running SQL queries, analyzing business data, and automatically generating business insight memos.
6
6
7
7
## Features
8
8
@@ -67,13 +67,15 @@ The bean definitions are described below, starting with the `ChatClient`
var chatClient = chatClientBuilder.defaultToolCallbacks(toolCallbackProvider).build();
77
79
// Run Predefined Questions
78
80
System.out.println(chatClient.prompt(
79
81
"Can you connect to my SQLite database and tell me what products are available, and their prices?").call().content());
@@ -82,51 +84,10 @@ public CommandLineRunner predefinedQuestions(ChatClient.Builder chatClientBuilde
82
84
}
83
85
```
84
86
85
-
The chat client setup is remarkably simple - it just needs the function callbacks that were automatically created from the MCP tools. Spring's dependency injection handles all the wiring, making the integration seamless.
87
+
The chat client setup is remarkably simple - it just needs the mcp clients. Spring's dependency injection handles all the wiring, making the integration seamless.
86
88
87
89
Now let's look at the other bean definitions in detail...
88
90
89
-
### Function Callbacks
90
-
91
-
The application registers MCP tools with Spring AI using function callbacks:
Copy file name to clipboardExpand all lines: model-context-protocol/sqlite/simple/src/main/java/org/springframework/ai/mcp/samples/sqlite/Application.java
0 commit comments