Skip to main content
Glama
ajemssolutions

AJEMS MCP Connector

Official

AJEMS MCP 连接器

让 Claude 和 ChatGPT 能够回答关于 AJEMS 工作区的问题——并可选地创建应用、表单和记录——而无需任何人登录 AJEMS。

一次部署即可服务所有租户。用户使用其组织名称和 AJEMS 密钥登录。


文件

文件

作用

server.js

配置、认证、HTTP 传输、健康检查、关闭

tools.js

AI 可以调用的每个工具

ajems.js

唯一与 AJEMS API 通信的模块

oauth.js

Claude 和 ChatGPT 所需的 OAuth 握手

cache.js

按租户缓存和上游并发限制

util.js

小型共享辅助函数

diagnose.js

11 步端到端检查器

mock-ajems.js

带有示例数据的假 AJEMS,用于在没有真实工作区的情况下进行测试


Related MCP server: Synapse

快速开始

npm install
cp .env.example .env      # set PUBLIC_URL and AJEMS_HOST_TEMPLATE
npm start

针对真实工作区进行验证:

node diagnose.js https://mcp.ajems.com <organisation> <secret-key>

或者完全不用 AJEMS 试试:

npm run mock              # terminal 1
# set AJEMS_HOST_TEMPLATE=http://localhost:9090/{org}/json_builder
npm start                 # terminal 2
node diagnose.js http://localhost:8080 testco test-secret-key

有关 nginx、TLS、pm2 和调优,请参阅 DEPLOY.md。


工具

默认只读。设置 ALLOW_WRITES=true 以启用四个写入工具。

工具

用途

list_apps_and_forms

发现——每个应用和表单,带有可读/可写标志

describe_form

字段键、人类可读标签、类型、下拉选项

query_responses

带有过滤器、日期范围、字段选择的记录

aggregate_responses

count / sum / avg / min / max,可选分组

create_app

新应用

create_form

新表单;字段键自动生成

create_record

一条或多条记录,以有界并发插入

update_record

更改现有记录上的字段

search

跨表单和记录的关键字搜索(ChatGPT)

fetch

单个搜索结果的全部详情(ChatGPT)

aggregate_responses 在服务器上计算。没有它,“按城市统计总数”会把数千行拉入模型的上下文并手动计数——速度慢、成本高,而且超过一定规模就会出错。

search 和 fetch 之所以存在,是因为在开发者模式之外,ChatGPT 只会调用这两个名称的工具,而忽略其他所有工具。


问题如何得到回答

Claude 问 “七月份按城市统计有多少条记录?”:

  1. list_apps_and_forms → 找到表单

  2. describe_form → 得知 date_1750943312417 是日期字段,dropdown_1750943301432 保存城市

  3. aggregate_responses 带有日期范围和 group_by → 返回三个数字

  4. 用通俗易懂的英语写出答案

字段键是自动生成的(date_1750943312417),这就是为什么第 2 步不是可选的。工具描述会告诉模型这一点,模型会自行串联这些调用。


租户隔离

  • 租户来自会话,在服务器端从 bearer 令牌解析

  • 没有工具模式具有 tenant、org 或 url 参数——不存在任何可被模型说服更改的内容

  • ajems.js 是唯一发出出站请求的模块,并且只发送到该租户的基础 URL

  • 缓存键按租户 和 密钥的哈希进行命名空间隔离,因此租户无法读取彼此的缓存条目,且轮换的密钥会自动过期

  • 组织名称会被剥离为子域安全字符,因此像 evil.com/x 这样的条目无法将服务器重定向到其他地方

  • 每次工具调用都会以 JSON 形式记录,包含租户和用户

添加工具时,请重新检查第二点。


测试

46 项检查针对模拟环境通过:认证、全部 10 个工具、过滤器、日期范围、created_at 回退、分组聚合、批量插入、写入后的缓存失效、错误消息、租户隔离、20 个并发用户以及速率限制。

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables AI assistants to interact with Jurisly workspaces for tasks like drafting invoices, finding hearing dates, and editing documents through natural language.
    Apache 2.0
  • A
    license
    Not graded
    quality
    A
    maintenance
    Enables LLM clients to securely read and write Frappe/ERPNext data under a real user's permissions, with audited calls and granular access control.
    1
    AGPL 3.0
  • A
    license
    Not graded
    quality
    C
    maintenance
    Enables AI assistants to connect to a Flow Master workspace and perform project, task, ticket, board, relationship, tag, and comment operations under the user's own account and permissions.
    10 npm
    ISC
  • A
    license
    Not graded
    quality
    B
    maintenance
    Enables AI assistants to securely connect to a vybeflow tenant for multi-channel messaging operations such as reading inbox tickets, looking up contacts, checking campaign progress, and sending messages under scoped permissions.
    MIT