Skip to main content
Glama

Huice · MCP Protocol Platform

In one sentence: An MCP protocol infrastructure — letting production lines self-register data sources and Tools, while downstream Agents discover and invoke them through the standard MCP protocol. The platform is a "protocol pipeline" and carries no business logic.


Table of Contents


Positioning and Boundaries

Why Build an MCP Protocol Platform?

The company has multiple production lines (cross-border ERP, domestic e-commerce, warehouse WMS, financial settlement...), and each production line has data query needs. If every new production line meant forking an MCP Server and modifying Tool implementations, we'd fall into the trap of "changing code for every new production line."

Core idea: Build an infrastructure that only handles MCP protocol implementation and the tool scheduling framework. The platform defines the protocol contract, and production lines self-integrate according to that contract.

What the Platform Does and Does Not Do

                    ┌─────────── 本平台范围 ───────────┐
                    │                                  │
  AI Agent ──MCP──→ │  MCP Protocol   Tool Registry    │ ←── API 契约 ←── 产线
                    │  Auth / Rate    Cache / Degrade  │
                    │  Adapter Framework               │
                    │  Admin Console  Observability    │
                    │                                  │
                    └────────────┬─────────────────────┘
                                 │ Data Source Adapter SPI
                                 ▼
              ┌──────────────────────────────────────┐
              │         产线数据源(产线自管)         │
              │  MySQL / Doris / StarRocks / HTTP API │
              │  Redis / ES / ...                    │
              └──────────────────────────────────────┘

✅ In Scope

❌ Out of Scope

Full MCP protocol implementation (based on Spring AI MCP Server 1.1.2)

Any instance Tool SQL/API logic (done by production lines)

Tool registry (CRUD + version management + hot reload)

ETL pipelines / wide-table construction / data cleaning

Data source adapter framework (MySQL/PG/Doris/HTTP/Redis)

Upstream API integration (ERP, BI, third-party)

Middleware pipeline (auth/rate limiting/caching/degradation/logging/monitoring)

Business formulas / algorithms / rules

Admin console (data source management + Tool management + monitoring dashboard)

OAuth2.0 / RBAC / multi-tenancy (Phase 2)

Production line SDK (Java + Python)

Production line onboarding / Tool development

Key design principle: The platform doesn't understand business. A Tool is just a configuration record in MySQL (name + JSON Schema + data source reference + query template). Production lines decide what Tools are called, how the SQL is written, and what the cache TTL is.


Core Concept: What Is MCP

MCP (Model Context Protocol) is a standard protocol for AI Agents to interact with external tools/data, open-sourced by Anthropic. Think of it as USB-C: before MCP, every AI application integrating with a data source had to write custom glue code; with MCP, Agents discover and invoke tools through the unified tools/listtools/call protocol.

flowchart LR
    A["🤖 AI Agent<br/>Claude Desktop / LangChain / OpenAI"] -->|"tools/list<br/>tools/call<br/>JSON-RPC 2.0"| B["🔌 MCP 协议中台<br/>Spring AI MCP Server"]
    B -->|"Adapter SPI"| C["🗄️ MySQL"]
    B -->|"Adapter SPI"| D["🗄️ Doris"]
    B -->|"Adapter SPI"| E["🌐 HTTP API"]
    B -->|"Adapter SPI"| F["📦 Redis"]

Key design principle: Agents handle "intent" (understanding what the user wants), the platform handles "protocol" (MCP implementation + Tool routing + middleware), and production lines handle "data" (registering data sources + writing SQL/config).


Architecture Overview

Layered Architecture

flowchart TB
    subgraph Agent["AI Agent 层(外部)"]
        Claude["Claude Desktop"]
        LangChain["LangChain Client"]
        OpenAI["OpenAI Agent SDK"]
    end

    subgraph Platform["MCP 协议中台(本平台)"]
        direction TB

        subgraph Protocol["MCP Protocol Layer"]
            Handshake["initialize 握手<br/>协议版本协商 · 能力交换"]
            JSONRPC["JSON-RPC 2.0 Router<br/>tools/list · tools/call · tools/schema<br/>resources/list · resources/read"]
            Transport["Transport: HTTP SSE / Streamable HTTP"]
        end

        subgraph Middleware["Middleware Pipeline(Filter Chain)"]
            direction LR
            Auth["鉴权<br/>API Key + BCrypt"] --> RateLimit["限流<br/>Token Bucket"]
            RateLimit --> Cache["缓存<br/>Caffeine L1 + Redis L2"]
            Cache --> Degrade["降级<br/>4 级状态机"]
            Degrade --> Log["日志·监控<br/>TraceId · Prometheus"]
        end

        subgraph Core["Tool Engine"]
            Dispatcher["ToolDispatcher<br/>Tool 解析 · 路由"]
            Registry["Tool Registry<br/>元数据管理 · 版本管理 · 热加载"]
            Executor["Tool Executor<br/>参数校验 · 模板渲染<br/>结果映射 · 输出校验"]
        end

        subgraph Adapter["Data Source Adapter Framework"]
            SPI["Adapter SPI<br/>接口契约 · 连接池 · 健康检查 · 查询护栏"]
            Builtin["内置适配器<br/>MySQL · PostgreSQL · Doris · HTTP · Redis"]
        end

        subgraph Admin["Admin Console"]
            ToolMgmt["Tool 管理"]
            DSMgmt["数据源管理"]
            Dashboard["监控大盘"]
            Alarm["告警配置"]
        end
    end

    subgraph Datasources["产线数据源(产线自管)"]
        MySQL_DS["MySQL 产线 A"]
        Doris_DS["Doris 产线 B"]
        HTTP_API["HTTP API 产线 C"]
        Redis_DS["Redis 产线 D"]
    end

    Agent -->|"MCP Protocol"| Handshake
    Handshake --> JSONRPC
    JSONRPC --> Auth
    Middleware --> Dispatcher
    Dispatcher --> Registry
    Dispatcher --> Executor
    Executor --> SPI
    Admin --> Registry
    Admin --> DSMgmt
    SPI --> Builtin
    Builtin --> Datasources

Layer Responsibilities

Layer

Core Responsibilities

Boundary Constraints

MCP Protocol Layer

initialize handshake, JSON-RPC 2.0 Router, SSE/Streamable HTTP Transport (based on Spring AI MCP Server 1.1.2, not reinventing the wheel)

The protocol layer doesn't care where Tools come from or what the data source is

Middleware Pipeline

Auth → rate limiting → caching → degradation → logging/monitoring, Filter Chain pattern, mandatory path for every request

Fully config-driven; production lines select policies in the Tool config

Tool Engine

ToolDispatcher parses routing, Tool Registry manages metadata, Tool Executor handles parameter validation + template rendering + result mapping

Decouples Protocol and Registry via ToolDispatcher

Adapter Framework

Adapter SPI interface contract + 5 built-in adapters + query guardrails (max_rows/timeout/DDL blacklist)

The platform only adapts; it doesn't care about data content

Admin Console

Data source management, Tool registration management, monitoring dashboard, alert configuration (Vue 3 + Arco Design)

Self-service for production line admins


Core Design

Tool = Metadata, Not Code

From the platform's perspective, a Tool is just a MySQL record. Production lines register Tools via API or the console:

{
  "id": "my_query_tool",
  "name": "my_query_tool",
  "description": "查询最近 N 条订单(给 LLM 看的描述)",
  "parameters": {
    "type": "object",
    "properties": {
      "limit": { "type": "integer", "default": 20, "maximum": 100 }
    }
  },
  "datasource_id": "ds_my_line",
  "query": {
    "type": "SQL",
    "template": "SELECT a, b, c FROM orders ORDER BY created_at DESC LIMIT {{.limit}}"
  },
  "cache": { "level": "BOTH", "l1_ttl_sec": 60, "l2_ttl_sec": 300 }
}

What the platform does: validate parameter legality → render the template → execute through the Adapter → map results → return. Production lines decide all business logic.

Data Model (6 Core Tables)

erDiagram
    Datasource ||--o{ Tool : "绑定"
    Tool ||--o{ ToolVersion : "版本"
    Tool ||--o{ CachePolicy : "缓存策略"
    Tool ||--o{ DegradePolicy : "降级策略"
    Tool ||--o{ InvocationLog : "调用记录"

    Datasource {
        string id PK "ds_example"
        string type "DORIS / MYSQL / PG / HTTP / REDIS"
        json connection "主机·端口·库名·凭据引用"
        json pool_config "连接池配置"
        string status "ONLINE / OFFLINE / ERROR"
    }

    Tool {
        string id PK "my_tool_001"
        string name "对 Agent 可见的工具名"
        string description "详细的工具描述给 LLM 看"
        json parameters "JSON Schema — 输入参数定义"
        string datasource_id FK "绑定数据源"
        string query_template "SQL 或 HTTP URL 模板"
        json result_mapping "字段映射"
        json transform "字段级转换规则"
        string status "DRAFT / ONLINE / OFFLINE"
    }

    InvocationLog {
        bigint id PK
        string tool_id FK
        string trace_id "全链路追踪 ID"
        int latency_ms "执行耗时"
        boolean cache_hit "是否命中缓存"
        int degrade_level "降级级别"
        timestamp created_at "TTL 7 天"
    }

Middleware Capabilities (the Platform's "Gift" to Production Lines)

Capability

Description

Auth

API Key + BCrypt, based on mcp-server-security 0.0.5 + Spring Security

Rate Limiting

Token Bucket, 3 levels: global / production line / Tool

Caching

Caffeine L1 (local <1ms) + Redis L2 (distributed shared), TTL configurable by production line

Degradation

4-level automatic degradation: expired cache → local cache only → static default values → 503 rejection

Observability

Automatic instrumentation: call volume/success rate/P95/cache hit rate/degradation count, Prometheus + Grafana

Invocation Logs

InvocationLog table; production lines can query "what parameters the Agent passed to my Tool and what it returned"

Three Integration Methods

Method

Applicable Scenario

Production Line Effort

SQL Template

Single-table queries, simple JOINs, aggregations

Write 1 SQL + fill in a form

HTTP Template

Call existing production line REST APIs

Fill in a URL template

SDK Plugin

Multi-step aggregation, complex computation

Write 50-200 lines of Java/Python


Tech Stack

Layer

Choice

Version

Rationale

MCP Protocol Implementation

Spring AI MCP Server

1.1.2

Validated in internal company Demo; built-in JSON-RPC Router + Transport + initialize handshake. Not reinventing the protocol wheel

Auth

mcp-server-security + Spring Security

0.0.5

Community library, validated in Demo. API Key + BCrypt

Base Framework

Java 21 + Spring Boot

3.4.7

Company Java tech stack, version-aligned with internal Demo

Admin Console Frontend

Vue 3 + Vite + Arco Design

Lightweight, company frontend team's tech stack

Metadata Storage

MySQL 8.0

Tool config, data source config, invocation logs

Cache

Caffeine (L1) + Redis 6.2 (L2)

L1 local <1ms, L2 distributed shared

Monitoring

Micrometer + Prometheus + Grafana

Native Spring Boot integration

Config Center

Nacos 2.x

Already in use at the company; stores credentials + config

Deployment

Docker Compose (dev) + K8s (prod)

Aligned with company infrastructure

Base framework choice: Spring AI MCP Server 1.1.2 already fully implements the MCP 2024-11-05 protocol. This platform does not reimplement the protocol layer; instead, it does three things on top of Spring AI: (1) dynamic Tool registration (replacing the static @McpTool annotation), (2) data source adaptation and template execution, and (3) a generic middleware pipeline.


Project Structure

intent_plan/
├── docs/
│   └── superpowers/
│       └── specs/
│           ├── 2026-07-16-mcp-platform-plan.md              # MCP 协议中台建设计划(主文档)
│           └── 2026-07-16-cross-border-mcp-boundary-design.md # 产线协作契约
├── mcp-server/                   # MCP Server 核心(Spring Boot)
│   └── src/main/java/com/wangdian/mcp/
│       ├── protocol/             # MCP 协议层(Spring AI 集成)
│       ├── registry/             # Tool 注册中心(动态注册 + 版本管理)
│       ├── executor/             # Tool 执行器(校验 + 模板 + 映射)
│       ├── adapter/              # 数据源适配框架(SPI + 内置适配器)
│       ├── middleware/           # 中间件管道(鉴权/限流/缓存/降级)
│       ├── admin/                # 管理控制台 API(/admin/*)
│       └── sdk/                  # 产线 SDK(Java)
├── mcp-server-admin/             # 管理控制台前端(Vue 3 + Arco Design)
├── mcp-sdk-python/               # 产线 SDK(Python)
├── docker-compose.yml            # 本地开发环境
└── README.md

Quick Start

⚠️ Project under development; the following is the expected startup flow.

Prerequisites

  • JDK 21 + Maven 3.9+

  • Docker 20.10+ & Docker Compose 2.20+

  • Company intranet access (Nacos / MySQL / Redis)

Local Development

# 1. 克隆项目
git clone <repo-url> && cd intent_plan

# 2. 启动开发环境中间件
docker compose up -d mysql redis nacos-standalone

# 3. 初始化数据库
# 执行 docs/superpowers/specs/ 下的 DDL 脚本

# 4. 启动 MCP Server
cd mcp-server
mvn spring-boot:run

# 5. 验证 MCP 协议
curl -X POST http://localhost:8080/mcp \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}},"id":0}'

Service Ports

Service

Port

Description

MCP Server

8080

MCP JSON-RPC endpoint (:8080/mcp)

Admin Console

8080

Admin console (:8080/admin/*)

MySQL

3306

Metadata storage

Redis

6379

L2 cache

Nacos

8848

Config center / service discovery


Production Line Integration

Production line integration takes only 3 steps, with no platform development involvement:

Step 1: Register a Data Source

curl -X POST http://mcp-platform:8080/api/v1/datasources \
  -H "Content-Type: application/json" \
  -H "X-API-Key: <your_api_key>" \
  -d '{
    "id": "ds_my_line",
    "type": "MYSQL",
    "connection": {
      "host": "10.x.x.x", "port": 3306, "database": "my_db",
      "credential_ref": "nacos:my-line/db-pwd"
    },
    "pool_config": { "min": 2, "max": 10, "timeout_sec": 30 }
  }'

Step 2: Register a Tool

curl -X POST http://mcp-platform:8080/api/v1/tools \
  -H "Content-Type: application/json" \
  -H "X-API-Key: <your_api_key>" \
  -d '{
    "id": "my_query",
    "name": "my_query",
    "description": "查询我的订单数据",
    "parameters": { "type": "object", "properties": { "limit": { "type": "integer" } } },
    "datasource_id": "ds_my_line",
    "query": { "type": "SQL", "template": "SELECT * FROM orders LIMIT {{.limit}}" }
  }'

Step 3: Agent Invocation

Tools take effect across all instances within 30s of registration. Downstream Agents invoke them through the standard MCP protocol:

Agent → POST /mcp
  {"jsonrpc":"2.0", "method":"tools/list", "id":1}
Agent ← {"jsonrpc":"2.0", "result":{"tools":[..., {"name":"my_query", ...}]}, "id":1}

Agent → POST /mcp
  {"jsonrpc":"2.0", "method":"tools/call", "params":{"name":"my_query","arguments":{"limit":20}}, "id":2}
Agent ← {"jsonrpc":"2.0", "result":{"content":[{"type":"text","text":"[{\"col\":\"val\"}]"}]}, "id":2}

Documentation Index

Document

Purpose

Audience

MCP Protocol Platform Construction Plan

Platform architecture, WBS breakdown, milestones, risks

Everyone

MCP Service Responsibility Boundary Design

Production line collaboration contract, integration protocol

Platform team + production line teams


Project Roadmap

gantt
    title MCP 协议中台路线图
    dateFormat  YYYY-MM-DD
    axisFormat  W%W

    section M1 · 协议核心(W1)
    Spring AI 集成 + 动态 Tool 注册 POC  :m1, 2026-07-20, 5d

    section M2 · 工具引擎(W2)
    Tool Registry + Executor + Adapter    :m2, after m1, 5d

    section M3 · 生产就绪(W3)
    Middleware Pipeline + 降级演练        :m3, after m2, 5d

    section M4 · 管理控制台(W4-W5)
    Admin Console + SDK                   :m4, after m3, 10d

    section M5 · 上线(W6)
    集成测试 + 压测 + 灰度                :m5, after m4, 5d

Phase

Goal

Time

Phase 1 · MVP

MCP protocol platform core capabilities: dynamic Tool registration + 5 data source adapters + middleware pipeline + admin console + SDK

6 weeks

Phase 2 · Enhancement

Plugin hot reload + OAuth2.0/RBAC/multi-tenancy + custom ClassLoader isolation + more adapters (ES/Mongo/GraphQL)

3-6 months

Phase 3 · Commercialization

MCP Marketplace + billing/metering + multi-cluster scheduling + data masking mirrors

6+ months


Project status: Design phase · pending review | Team: 2.5 people (TL + BE + FE shared) | Duration: 6 weeks

Questions? Start with the MCP Protocol Platform Construction Plan.

-
license - not tested
Not graded
quality - not tested
B
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

  • Hosted MCP endpoint with realistic fake data for prototyping agents. 12 tools, no setup.

  • Self-hosted MCP gateway: turn any API, database or MCP server into AI connectors — no code.

  • Control plane for autonomous software labor. Agents claim objectives over MCP with audit trail.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/qiyingshicaiji/mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server