
ogulcanarbc/spring-ai-mcp-client
Developer toolsこのページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る
mcp クライアント アプリケーションは spring ai を利用しています。 mcp プロトコル対応サーバーと統合し、 ai パワードのチャットインタラクションを有効にします.
概要
モデルコンテクストプロトコル(MCP)のクライアントアプリケーションは、スプリングAIとアンソロピークロードモデル(またはOpenAI)を利用しています。 MCP プロトコル対応サーバーと連携し、AI によるチャットのやり取りを有効にします。 MCP クライアントは、MCP サーバーとの接続の確立と管理を担当するモデルコンテキストプロトコル(MCP)アーキテクチャの重要なコンポーネントです。 プロトコルのクライアント側、処理を実行します。 - プロトコルバージョンは、サーバーとの互換性を確保するための交渉 - 利用可能な機能を決定する能力交渉 - メッセージの輸送とJSON-RPC通信 - ツールの発見と実行 - リソースアクセスと管理 - プロンプトシステムインタラクション - ルート管理やサンプリングサポートなどのオプション機能 - サポートのOpenaiとanthropicモデル Java 17 + Maven または Gradle Docker (オプション) Anthropic API キーまたは OpenAI API キー - Anthropic ConsoleのAnthropic APIキー。 - OpenAIコンソールからOpenAI APIキー.
概要(AI 翻訳)
モデルコンテクストプロトコル(MCP)のクライアントアプリケーションは、スプリングAIとアンソロピークロードモデル(またはOpenAI)を利用しています。 MCP プロトコル対応サーバーと連携し、AI によるチャットのやり取りを有効にします。
Spring MCP クライアントとは
MCP クライアントは、MCP サーバーとの接続の確立と管理を担当するモデルコンテキストプロトコル(MCP)アーキテクチャの重要なコンポーネントです。 プロトコルのクライアント側、処理を実行します。
- サーバーとの互換性を確保するためのプロトコルバージョンの交渉
- 利用可能な機能を決定する能力交渉
- メッセージ転送とJSON-RPC通信
- ツールの発見と実行
- リソースアクセスと管理
- プロンプト システム相互作用
- ルート管理やサンプリングサポートなどのオプション機能
- openaiおよびanthropicモデルを支えて下さい
要件
Java 17 以降 Maven か Gradle ドッカー(オプション) Anthropic API キーまたは OpenAI API キー
- Anthropic ConsoleのAnthropic APIキー。
- OpenAIコンソールからOpenAI APIキー。
インストール
##1. リポジトリのクローン
git クローン cdのばね-ai-mcp-client
##2. MCPサーバーの設定
MCP サーバー情報は mcp-servers に追加する必要があります.
このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。
README
spring-ai-mcp-client
The Model Context Protocol (MCP) client application utilizes Spring AI and Anthropic Claude models (Or OpenAI). It integrates with MCP protocol-supported servers to enable AI-powered chat interactions.
What is Spring MCP Client
The MCP Client is a key component in the Model Context Protocol (MCP) architecture, responsible for establishing and managing connections with MCP servers. It implements the client-side of the protocol, handling:
- Protocol version negotiation to ensure compatibility with servers
- Capability negotiation to determine available features
- Message transport and JSON-RPC communication
- Tool discovery and execution
- Resource access and management
- Prompt system interactions
- Optional features like roots management and sampling support
- Supports openai and anthropic models
Requirements
Java 17+
Maven or Gradle
Docker (Optional)
Anthropic API key Or OpenAI API key
- Anthropic API key from the Anthropic Console.
- OpenAI API key from the OpenAI Console.
Installation
1. Clone Repository
git clone
cd spring-ai-mcp-client
2. MCP Server Configuration
The MCP server information must be added to the mcp-servers.json file as follows.
{
"mcpServers":{
"any-mcp-server":{
"command":"node",
"args":[
"any-mcp-server/build/index.js"
]
}
}
}
3. Spring Configuration
The application.yml file should be configured as follows:
spring:
ai:
mcp:
client:
enabled: true
name: any-mcp-server # MCP server name
version: 1.0.0
type: SYNC
request-timeout: 20s
stdio:
root-change-notification: true
servers-configuration: classpath:mcp-servers.json # MCP server config such/same as claude desktop configs.
anthropic:
api-key: ${ANTHROPIC_API_KEY}
# openai:
# api-key: ${OPENAI_API_KEY}
server:
port: 8081
4. Run Applicaton
mvn clean install
mvn spring-boot:run
Usage
Once the application is running, it can be accessed via the following endpoint:
You can start a chat with the following cURL command:
curl -X GET "http://localhost:8081/ai?message=Hello" -H "Accept: application/json"
インストール
This server does not publish a one-line install command.
Open the repository installation guide MCP 初心者?mcpskill.org のガイドから始めましょう →設定
{
"mcpServers":{
"any-mcp-server":{
"command":"node",
"args":[
"any-mcp-server/build/index.js"
]
}
}
}