Token导航 LogoToken导航TokenDH.com
MCP Server Generic logo
运维云端未说明官方级别未说明来源级核验

MCP Server Generic

MCP Server

一个基于Kotlin/Spring的单一数据访问MCP服务器,具有薄层MCP工具处理程序和可插拔的域适配器,适用于多源数据集成和查询。

工具数

4

提示词数

0

GitHub Stars

0

资源数

0
Kotlin数据集成微服务Spring Boot

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

AravinthhKrish

提供方

AravinthhKrish

最后核验

2026/5/17 20:20

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

详细介绍

mcp服务器通用

Kotlin/Spring启动器的实现 单数据访问MCP服务器 使用精简的MCP工具处理程序和可插拔的域适配器。

架构(4层)

  1. MCP层

- 工具端点(第一阶段): - drive.search_files - gmail.search_messages - news.search_articles - market.quote - 资源终结点: - resource://news/sources - resource://system/provider-health

  1. 域适配器

- GoogleDriveAdapter - GmailAdapter - NewsAdapter - MarketDataAdapter

  1. 认证层

- 访问上下文和令牌存储抽象。

  1. 缓存/事件层

- 缓存服务抽象(MVP的内存实现)。

实施计划

第一阶段(已实施)

  • Bootstrap Kotlin+Spring Boot应用程序。
  • 添加规范化域模型:

- DriveFile, MailMessage, Article, Quote.

  • 为以下对象添加工具合同和处理程序:

- drive.search_files - gmail.search_messages - news.search_articles - market.quote

  • 添加适配器接口和存根实现。
  • 为报价响应添加短期缓存。
  • 添加基本集成测试 market.quote.

第二阶段(下)

  • 添加 drive.read_file_text, gmail.get_thread, market.quotes_batch, news.get_topic_digest.
  • 添加分页标记持久性和更强的结果新鲜度元数据。
  • 添加Redis支持的缓存实现。

第三阶段(下一阶段)

  • 驱动器/Gmail手表集成。
  • 市场WebSocket流消费者。
  • 提供程序路由+故障转移策略。
  • 源注册表持久化和项目删除管道。

封装结构

src/main/kotlin/com/example/mcp
├── auth
├── cache
├── domain
│   ├── drive
│   ├── gmail
│   ├── market
│   └── news
└── mcp

./gradlew bootRun

k6回归测试

使用k6脚本在所有当前公开的MCP工具和资源端点上运行轻量级回归扫描。

# start app
./gradlew bootRun

# in another terminal
k6 run perf/mcp-regression.k6.js

# optional overrides
BASE_URL=http://localhost:8080 VUS=2 ITERATIONS=5 k6 run perf/mcp-regression.k6.js

# helper wrapper (writes logs to perf/results/)
./perf/run-k6-regression.sh

最新运行输出记录在 perf/results/k6-regression-run.log,JSON摘要写入 perf/results/mcp-regression-summary.json,并在以下位置生成可读的动态HTML报告 perf/results/mcp-regression-report.html 直接通过k6(handleSummary).

该脚本验证:

  • 工具端点: drive.search_files, gmail.search_messages, news.search_articles, market.quote
  • 资源终结点: /mcp/resources/news/sources, /mcp/resources/system/provider-health

示例通话

curl -X POST http://localhost:8080/mcp/tools/market.quote \
  -H 'content-type: application/json' \
  -d '{"symbol":"AAPL"}'

curl http://localhost:8080/mcp/resources/news/sources

Kotlin/Spring启动器的实现 单数据访问MCP服务器 使用精简的MCP工具处理程序和可插拔的域适配器。

架构(4层)

  1. MCP层

- 工具端点(第一阶段): - drive.search_files - gmail.search_messages - news.search_articles - market.quote - 资源终结点: - resource://news/sources - resource://system/provider-health

  1. 域适配器

- GoogleDriveAdapter - GmailAdapter - NewsAdapter - MarketDataAdapter

  1. 认证层

- 访问上下文和令牌存储抽象。

  1. 缓存/事件层

- 缓存服务抽象(MVP的内存实现)。

实施计划

第一阶段(已实施)

  • Bootstrap Kotlin+Spring Boot应用程序。
  • 添加规范化域模型:

- DriveFile, MailMessage, Article, Quote.

  • 为以下对象添加工具合同和处理程序:

- drive.search_files - gmail.search_messages - news.search_articles - market.quote

  • 添加适配器接口和存根实现。
  • 为报价响应添加短期缓存。
  • 添加基本集成测试 market.quote.

第二阶段(下)

  • 添加 drive.read_file_text, gmail.get_thread, market.quotes_batch, news.get_topic_digest.
  • 添加分页标记持久性和更强的结果新鲜度元数据。
  • 添加Redis支持的缓存实现。

第三阶段(下一阶段)

  • 驱动器/Gmail手表集成。
  • 市场WebSocket流消费者。
  • 提供程序路由+故障转移策略。
  • 源注册表持久化和项目删除管道。

封装结构

src/main/kotlin/com/example/mcp
├── auth
├── cache
├── domain
│   ├── drive
│   ├── gmail
│   ├── market
│   └── news
└── mcp

Gmail真实-API模式

默认情况下,Gmail使用存根适配器。要连接到实时Gmail数据,请启用Gmail集成并提供OAuth承载令牌:

integrations:
  gmail:
    enabled: true
    base-url: https://gmail.googleapis.com/gmail/v1
    user-id: me
    access-token: ${GMAIL_ACCESS_TOKEN}

当启用时, gmail.search_messages 电话:

  • GET /users/{userId}/messages
  • GET /users/{userId}/messages/{messageId}?format=metadata

并将结果标准化为 MailMessage.

新闻多源real-API模式

默认情况下,News使用存根适配器。要在单个请求中聚合多个实时源,请启用新闻集成并配置 integrations.news.sources.

integrations:
  news:
    enabled: true
    sources:
      - id: pinterest
        url: https://www.pinterest.com/news.rss
        type: RSS
        auth: NONE
      - id: toi
        url: https://timesofindia.indiatimes.com/rssfeedstopstories.cms
        type: RSS
        auth: NONE
      - id: github
        url: https://api.github.com/repos/spring-projects/spring-boot/issues
        type: JSON
        auth: HEADER
        auth-header: Authorization
        auth-token: ${GITHUB_TOKEN}
        query-param: q

news.search_articles 然后可以跨所有启用的源(或通过以下方式查询子集 sources[] 在工具输入中)在一个请求中。

./gradlew bootRun

示例通话

curl -X POST http://localhost:8080/mcp/tools/market.quote \
  -H 'content-type: application/json' \
  -d '{"symbol":"AAPL"}'

curl http://localhost:8080/mcp/resources/news/sources

容器映像和Kubernetes自动缩放

为应用程序构建一个容器映像:

docker build -t mcp-server-generic:latest .

部署到启用HPA的Kubernetes:

kubectl apply -f k8s/deployment.yaml
kubectl apply -f k8s/service.yaml
kubectl apply -f k8s/hpa.yaml

检查卷展栏和自动缩放器状态:

kubectl rollout status deployment/mcp-server-generic
kubectl get hpa mcp-server-generic

目录标签

目录标签

Kotlin数据集成微服务Spring Boot本地部署多源查询SpringBoot

接入字段

传输方式(transport,传输协议)

未说明

鉴权方式(authType,认证方式)

oauth

工具数量(toolCount,工具数)

4

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

未说明oauth部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

仍需确认:installCommand

来源信息

继续浏览同类 MCP