# Mcp Spring Ai Mcp Client

> 使用java实现mcp client了解底层的调用机制，demo示例

- **Type:** MCP server
- **Install:** `agentstack add mcp-chaozai0304-mcp-spring-ai-mcp-client`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [chaozai0304](https://agentstack.voostack.com/s/chaozai0304)
- **Installs:** 0
- **Category:** [Integrations](https://agentstack.voostack.com/c/integrations)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [chaozai0304](https://github.com/chaozai0304)
- **Source:** https://github.com/chaozai0304/mcp-spring-ai-mcp-client

## Install

```sh
agentstack add mcp-chaozai0304-mcp-spring-ai-mcp-client
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# 代码介绍和启动方式说明
## 1. springboot ai创建mcp client

   `````
   1.调用AI查询使用那个call
   入参为：
   入口为：org.springframework.ai.openai.OpenAiChatModel#internalCall
   -调用->>org.springframework.ai.openai.api.OpenAiApi#chatCompletionEntity(org.springframework.ai.openai.api.OpenAiApi.ChatCompletionRequest, org.springframework.util.MultiValueMap)
   返回使用mcp的入参
   2.调用org.springframework.ai.mcp.SyncMcpToolCallback#call 所有的call mcpserver的入口
   日志打印io.modelcontextprotocol.spec.McpSchema#deserializeJsonRpcMessage
   
   3.最后在调用AI进行信息汇总
   入参为：
   入口为：org.springframework.ai.openai.OpenAiChatModel#internalCall
   -调用->>org.springframework.ai.openai.api.OpenAiApi#chatCompletionEntity(org.springframework.ai.openai.api.OpenAiApi.ChatCompletionRequest, org.springframework.util.MultiValueMap)
   `````

  ### 请求大模型的入参示例

   `````
   {
       "messages": [
           {
               "content": "查询chaozai0304所有项目",
               "role": "user"
           }
       ],
       "model": "gpt-4o",
       "stream": false,
       "temperature": 0.7,
       "tools": [
           {
               "type": "function",
               "function": {
                   "description": "Create or update a single file in a GitHub repository",
                   "name": "create_or_update_file",
                   "parameters": {
                       "additionalProperties": false,
                       "type": "object",
                       "properties": {
                           "owner": {
                               "type": "string",
                               "description": "Repository owner (username or organization)"
                           },
                           "repo": {
                               "type": "string",
                               "description": "Repository name"
                           },
                           "path": {
                               "type": "string",
                               "description": "Path where to create/update the file"
                           },
                           "content": {
                               "type": "string",
                               "description": "Content of the file"
                           },
                           "message": {
                               "type": "string",
                               "description": "Commit message"
                           },
                           "branch": {
                               "type": "string",
                               "description": "Branch to create/update the file in"
                           },
                           "sha": {
                               "type": "string",
                               "description": "SHA of the file being replaced (required when updating existing files)"
                           }
                       },
                       "required": [
                           "owner",
                           "repo",
                           "path",
                           "content",
                           "message",
                           "branch"
                       ]
                   }
               }
           },
           {
               "type": "function",
               "function": {
                   "description": "Search for GitHub repositories",
                   "name": "search_repositories",
                   "parameters": {
                       "additionalProperties": false,
                       "type": "object",
                       "properties": {
                           "query": {
                               "type": "string",
                               "description": "Search query (see GitHub search syntax)"
                           },
                           "page": {
                               "type": "number",
                               "description": "Page number for pagination (default: 1)"
                           },
                           "perPage": {
                               "type": "number",
                               "description": "Number of results per page (default: 30, max: 100)"
                           }
                       },
                       "required": [
                           "query"
                       ]
                   }
               }
           },
           {
               "type": "function",
               "function": {
                   "description": "Create a new GitHub repository in your account",
                   "name": "create_repository",
                   "parameters": {
                       "additionalProperties": false,
                       "type": "object",
                       "properties": {
                           "name": {
                               "type": "string",
                               "description": "Repository name"
                           },
                           "description": {
                               "type": "string",
                               "description": "Repository description"
                           },
                           "private": {
                               "type": "boolean",
                               "description": "Whether the repository should be private"
                           },
                           "autoInit": {
                               "type": "boolean",
                               "description": "Initialize with README.md"
                           }
                       },
                       "required": [
                           "name"
                       ]
                   }
               }
           },
           {
               "type": "function",
               "function": {
                   "description": "Get the contents of a file or directory from a GitHub repository",
                   "name": "get_file_contents",
                   "parameters": {
                       "additionalProperties": false,
                       "type": "object",
                       "properties": {
                           "owner": {
                               "type": "string",
                               "description": "Repository owner (username or organization)"
                           },
                           "repo": {
                               "type": "string",
                               "description": "Repository name"
                           },
                           "path": {
                               "type": "string",
                               "description": "Path to the file or directory"
                           },
                           "branch": {
                               "type": "string",
                               "description": "Branch to get contents from"
                           }
                       },
                       "required": [
                           "owner",
                           "repo",
                           "path"
                       ]
                   }
               }
           },
           {
               "type": "function",
               "function": {
                   "description": "Push multiple files to a GitHub repository in a single commit",
                   "name": "push_files",
                   "parameters": {
                       "additionalProperties": false,
                       "type": "object",
                       "properties": {
                           "owner": {
                               "type": "string",
                               "description": "Repository owner (username or organization)"
                           },
                           "repo": {
                               "type": "string",
                               "description": "Repository name"
                           },
                           "branch": {
                               "type": "string",
                               "description": "Branch to push to (e.g., 'main' or 'master')"
                           },
                           "files": {
                               "type": "array",
                               "items": {
                                   "type": "object",
                                   "properties": {
                                       "path": {
                                           "type": "string"
                                       },
                                       "content": {
                                           "type": "string"
                                       }
                                   },
                                   "required": [
                                       "path",
                                       "content"
                                   ],
                                   "additionalProperties": false
                               },
                               "description": "Array of files to push"
                           },
                           "message": {
                               "type": "string",
                               "description": "Commit message"
                           }
                       },
                       "required": [
                           "owner",
                           "repo",
                           "branch",
                           "files",
                           "message"
                       ]
                   }
               }
           },
           {
               "type": "function",
               "function": {
                   "description": "Create a new issue in a GitHub repository",
                   "name": "create_issue",
                   "parameters": {
                       "additionalProperties": false,
                       "type": "object",
                       "properties": {
                           "owner": {
                               "type": "string"
                           },
                           "repo": {
                               "type": "string"
                           },
                           "title": {
                               "type": "string"
                           },
                           "body": {
                               "type": "string"
                           },
                           "assignees": {
                               "type": "array",
                               "items": {
                                   "type": "string"
                               }
                           },
                           "milestone": {
                               "type": "number"
                           },
                           "labels": {
                               "type": "array",
                               "items": {
                                   "type": "string"
                               }
                           }
                       },
                       "required": [
                           "owner",
                           "repo",
                           "title"
                       ]
                   }
               }
           },
           {
               "type": "function",
               "function": {
                   "description": "Create a new pull request in a GitHub repository",
                   "name": "create_pull_request",
                   "parameters": {
                       "additionalProperties": false,
                       "type": "object",
                       "properties": {
                           "owner": {
                               "type": "string",
                               "description": "Repository owner (username or organization)"
                           },
                           "repo": {
                               "type": "string",
                               "description": "Repository name"
                           },
                           "title": {
                               "type": "string",
                               "description": "Pull request title"
                           },
                           "body": {
                               "type": "string",
                               "description": "Pull request body/description"
                           },
                           "head": {
                               "type": "string",
                               "description": "The name of the branch where your changes are implemented"
                           },
                           "base": {
                               "type": "string",
                               "description": "The name of the branch you want the changes pulled into"
                           },
                           "draft": {
                               "type": "boolean",
                               "description": "Whether to create the pull request as a draft"
                           },
                           "maintainer_can_modify": {
                               "type": "boolean",
                               "description": "Whether maintainers can modify the pull request"
                           }
                       },
                       "required": [
                           "owner",
                           "repo",
                           "title",
                           "head",
                           "base"
                       ]
                   }
               }
           },
           {
               "type": "function",
               "function": {
                   "description": "Fork a GitHub repository to your account or specified organization",
                   "name": "fork_repository",
                   "parameters": {
                       "additionalProperties": false,
                       "type": "object",
                       "properties": {
                           "owner": {
                               "type": "string",
                               "description": "Repository owner (username or organization)"
                           },
                           "repo": {
                               "type": "string",
                               "description": "Repository name"
                           },
                           "organization": {
                               "type": "string",
                               "description": "Optional: organization to fork to (defaults to your personal account)"
                           }
                       },
                       "required": [
                           "owner",
                           "repo"
                       ]
                   }
               }
           },
           {
               "type": "function",
               "function": {
                   "description": "Create a new branch in a GitHub repository",
                   "name": "create_branch",
                   "parameters": {
                       "additionalProperties": false,
                       "type": "object",
                       "properties": {
                           "owner": {
                               "type": "string",
                               "description": "Repository owner (username or organization)"
                           },
                           "repo": {
                               "type": "string",
                               "description": "Repository name"
                           },
                           "branch": {
                               "type": "string",
                               "description": "Name for the new branch"
                           },
                           "from_branch": {
                               "type": "string",
                               "description": "Optional: source branch to create from (defaults to the repository's default branch)"

…

## Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [chaozai0304](https://github.com/chaozai0304)
- **Source:** [chaozai0304/mcp-spring-ai-mcp-client](https://github.com/chaozai0304/mcp-spring-ai-mcp-client)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/mcp-chaozai0304-mcp-spring-ai-mcp-client
- Seller: https://agentstack.voostack.com/s/chaozai0304
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
