Skip to main content
Glama
serve7-mcp-connectors

serve7-mcp-connectors

by MilosJova

Serve7 MCP Connector Library

为 Amazon Connect AI Agents 和 Bedrock AgentCore 提供的可复用 MCP 工具。七个通用连接器——客户查询、创建支持工单、检查工单状态、安排预约、更新 CRM 记录、检索知识及创建任务——在这里一次性构建,然后在 Serve7 的每个客户交互中复用,而无需在每个项目中从头接入。

这是 2026 年秋季项目点子列表中的项目 #6(“Serve7 MCP Connector Library”)。它是一个可运行的第一版:目前每个连接器都能在内存模拟后端上端到端运行(无需 AWS 账户、无需真实 CRM、无需凭据即可试用),并留有清晰的接缝,便于日后接入真实后端。

为什么用适配器,而不是直接集成

每个连接器的业务逻辑(结构校验、什么算错误,以及输入/输出字段)都位于 src/connectors/*.ts 中,并且不会直接调用具体后端的 SDK。它调用的是 src/adapters/types.ts 中五个小接口——CrmAdapter、TicketingAdapter、SchedulingAdapter、KnowledgeAdapter、TaskAdapter。目前它们全部在内存中实现(src/adapters/mock.ts)。日后要接入真实的 Salesforce/ServiceNow/Connect-Cases/Bedrock-Knowledge-Base 等后端,只需编写一个新的适配器类并改动一处 switch 语句(src/adapters/index.ts)——连接器代码、其测试,或智能体见到的 MCP 工具定义均不必改动。参见 docs/adding-a-real-adapter.md。

MCP client (Claude Desktop, Bedrock AgentCore, ...)
        │  tool call: customer_lookup({ customerId: "cust-1001" })
        ▼
src/server.ts (stdio) or src/http-server.ts (deployed)
        │  registers every connector as an MCP tool
        ▼
src/connectors/customer-lookup.ts
        │  validates input (zod), calls adapters.crm.lookupCustomer(...)
        ▼
src/adapters/index.ts  →  mock.ts today, a real adapter later

Related MCP server: CRM Agent Tools

项目结构

src/
  connectors/       one file per MCP tool — schema + business logic only
  adapters/          the CRM/ticketing/scheduling/knowledge/task interfaces,
                      plus the in-memory mock implementations
  mock-data/         seed data the mock adapters serve
  mcp-server-factory.ts   registers every connector on an McpServer instance
  server.ts          stdio entrypoint (local dev, Claude Desktop, Claude Code)
  http-server.ts      Streamable-HTTP entrypoint (deployed, e.g. behind Lambda)
tests/               one test file per connector + a registry sanity test
deploy/              Dockerfile + AWS SAM template for a Lambda deployment
docs/                per-connector reference + how to add a real adapter

在本地运行

npm install
npm test              # 29 tests, all against the mock adapters
npm run typecheck      # strict TypeScript, zero `any` in connector code
npm start              # stdio MCP server — Ctrl+C to stop
npm run start:http      # HTTP MCP server on :8080 (curl http://localhost:8080/health)
npm run smoke           # real MCP client over stdio, calls all 7 tools end to end
npm run smoke:http      # same, over HTTP — start:http must be running first

接入 Claude Desktop / Claude Code

将 MCP 客户端指向 stdio 服务器即可,例如,在 Claude Desktop 的 claude_desktop_config.json 中配置:

{
  "mcpServers": {
    "serve7-connectors": {
      "command": "npx",
      "args": ["tsx", "/absolute/path/to/serve7-mcp-connectors/src/server.ts"]
    }
  }
}

然后可以提问,比如“查询客户 cust-1001”或“我们有哪些关于紧急停业通知的知识文章?”——它会在模拟数据上调用 customer_lookup / retrieve_knowledge。

为真实场景部署(例如,通过 Bedrock AgentCore)

参见 deploy/README.md —— 通过 sam deploy 构建一个容器镜像 Lambda,并将其置于一个 IAM 认证的 Function URL 之后。

添加第 8 个连接器

  1. 使用 defineConnector() 创建 src/connectors/my-new-tool.ts,可以复制一个现有连接器的形态,例如 create-task.ts。

  2. 将其添加到 src/connectors/index.ts 中的 CONNECTORS 数组。

  3. 在 tests/ 中添加测试文件。

  4. 在 docs/connectors.md 中为其添加文档。

server.ts、http-server.ts 以及 registry 测试都会自动发现它,此外无需再改任何文件。

本第一版刻意不包括的内容

根据原始项目说明,每个连接器最终还应包括认证方案(已完成,位于适配器层)、部署模板(已完成,deploy/)和文档(已完成,docs/)——这些已全部交付。尚未实现、值得快速跟进的是:至少为一种后端提供真实适配器(这样它就不全是模拟实现),以及将可运行的 Bedrock AgentCore 智能体通过已部署的 HTTP 端点到端地接入。

Available Tools

7 tools
create_support_ticketCreate Support TicketA

File a new support ticket for a customer when their issue can't be resolved in the current interaction. Use retrieve_status afterward to check progress on a ticket already created.

Inputs: subject (required), customerId (required), description (required), priority.

create_taskCreate TaskA

Create a follow-up task for a human teammate — e.g. 'call customer back with a refund confirmation' — when something needs manual handling after the AI-driven part of the interaction ends.

Inputs: title (required), assignee (required), description (required), dueDate.

customer_lookupCustomer LookupA

Look up a customer record by customer ID, email, or phone number. Returns account status and tier so an agent (human or AI) can personalize the interaction. Call this first in nearly every flow.

Inputs: email, phone, customerId.

retrieve_knowledgeRetrieve KnowledgeA

Search the knowledge base for articles relevant to a customer's question. Returns the top matches with a relevance score and source URL so responses can be grounded and cited.

Inputs: query (required), topK.

retrieve_statusRetrieve Ticket StatusA

Check the current status of a previously created support ticket by its ticket ID. Use this before telling a customer their issue is still 'in progress' vs resolved.

Inputs: ticketId (required).

schedule_appointmentSchedule AppointmentB

Book an appointment (call-back, in-branch visit, technician visit, etc.) for an existing customer.

Inputs: startTime (required), customerId (required), serviceType (required), durationMinutes.

update_crm_recordUpdate CRM RecordA

Patch fields on an existing customer's CRM record (e.g. after verifying a new phone number or email during a call). Only include the fields you want changed.

Inputs: customerId (required), tier, email, phone, +1 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.8/5.0

    Scored across 7 tools

    Disambiguation5/5

    Each tool targets a clearly distinct resource and action: customer lookup, ticket creation/status, appointment scheduling, CRM patching, knowledge search, and task creation. There is no meaningful overlap or ambiguity between tool purposes.

    Naming Consistency4/5

    Most tools follow the verb_noun pattern (create_support_ticket, retrieve_status, schedule_appointment, update_crm_record, retrieve_knowledge, create_task). The exception is customer_lookup, which reverses the order to noun_verb, creating a minor consistency deviation.

    Tool Count5/5

    Seven tools is a well-scoped size for a customer support/CRM connector. Each tool covers a distinct workflow step, and none feel redundant or unnecessary.

    Completeness3/5

    The surface covers customer lookup, ticket creation and status, knowledge retrieval, and follow-up tasks, but ticket lifecycle is incomplete (no update or close) and appointment management lacks cancellation/rescheduling. These are notable gaps for a full customer support workflow.

    Related MCP Connectors

    Related MCP Servers