MCP Catalogs
首页mcp_mediator screenshot

mcp_mediator

by makbn·10·综合分 37

Java 框架,可根据现有源码、服务和外部工具自动生成 MCP 服务器。

developer-toolsai-llmops-infra
3
Forks
3
活跃 Issue
4 个月前
最近提交
2 天前
收录于

概述

MCP Mediator 是一个 Java 实现,将现有代码和服务与模型上下文协议 (MCP) 连接起来。它将各种组件聚合到一个统一的 MCP 服务器中,无需手动维护多个服务器。该框架支持从现有代码生成工具和代理多个 MCP 服务器,具有可扩展的请求处理机制,并支持 stdio 和 sse 等不同的传输方式。

试试问 AI

装完之后,这里有 6 个你可以让 AI 做的事:

:使用注解自动将现有的 Java 服务类和方法转换为 MCP 服务器
:创建代理 MCP 服务器,聚合来自多个远程 MCP 服务器的工具
:与 Spring Boot 应用程序集成,将现有控制器作为 MCP 工具暴露
:如何将现有的 Java 代码转换为 MCP 工具?
:它可以与现有的 Spring Boot 应用程序一起工作吗?
:支持哪些传输机制?

什么时候选它

如果您使用Java代码库,希望快速将现有服务转换为MCP服务器而不修改代码,或者需要在单个接口后聚合多个MCP服务器,可以选择它。

什么时候不要选它

如果您需要生产就绪的功能、全面的文档,或者不使用Java/Spring生态系统,应该避免使用它,因为许多功能仍在开发中。

此 server 暴露的工具

从 README 抽取出 4 个工具
  • docker_start_containerboolean startContainerCmd(String containerId)

    Start an existing Docker container using its containerId

  • wikipedia_queryObject queryWikipedia(String query)

    Search Wikipedia for content related to the input query

  • stackoverflow_queryObject queryStackoverflow(String query)

    Search Stackoverflow for questions and answers related to the input query

  • github_queryObject searchGitHub(String query)

    Search GitHub for projects related to the input query

说明:Tool names were inferred from documentation of example implementations (DockerClientService) and mentioned query servers. The README doesn't provide a comprehensive list of all available tools but gives examples of how they would be impleme

可对比工具

mcp-server-templatenexus-mcpmcp-py-serverlangchain-mcp-server

安装

安装

先决条件

  • Java 17 或更高版本
  • Maven 3.6 或更高版本
  • Spring Boot 3.2.2 或更高版本(用于 Spring Boot 集成)

Maven 依赖

<dependency>
    <groupId>com.makbn</groupId>
    <artifactId>mcp-mediator-api</artifactId>
    <version>1.0.0</version>
</dependency>

Claude Desktop 配置

添加到 Claude Desktop 的配置文件中:

{
  "mcpServers": {
    "java_mcp_mediator": {
      "command": "java",
      "args": [
        "-jar",
        "[路径]/mcp-mediator-example.jar",
        "DefaultMcpMediatorStdioExample"
      ]
    }
  }
}

FAQ

如何将现有的 Java 代码转换为 MCP 工具?
在您的类和方法上使用 @McpService 和 @McpTool 注解。然后使用 McpServiceFactory.create() 将服务注册到 DefaultMcpMediator。
它可以与现有的 Spring Boot 应用程序一起工作吗?
是的,有一个 Spring Boot 启动器模块(mcp-mediator-spring-boot-starter),它提供自动配置,为可用端点自动生成 MCP 服务器。
支持哪些传输机制?
目前支持 stdio 和 SSE 传输机制。计划在未来版本中添加更多传输方式。

mcp_mediator 对比

GitHub →

最后更新于 · 由 README + GitHub 公开数据自动生成。