Skip to main content
Glama
LynxBay

magic-api-mcp

by LynxBay

magic-api MCP

让 AI 通过 MCP 操作运行中的 magic-api 实例:接口增删改查 + 运行、分组 / 函数 / 数据源管理,并内置 magic-script 知识。

支持两种部署:

  • stdio:本地跑,Claude 启动子进程(适合个人开发机)

  • http:远程服务,全公司 / 团队共用一个(适合集中部署)

安装

cd magic-api-mcp
npm install
npm run build

Related MCP server: magic-api-mcp-server

配置(环境变量)

变量

必填

默认

说明

MAGIC_API_BASE

magic-api 地址,如 http://your-magic-api-host:9999

MAGIC_API_WEB

/magic/web

管理端路径(非默认实例要改,如 /your-app/magic/dev

MAGIC_API_TOKEN

*

静态 token

MAGIC_API_USERNAME / MAGIC_API_PASSWORD

*

账号密码(自动 login)

MAGIC_API_READONLY

false

只读模式,禁用写工具

MAGIC_API_PREFIX

接口路径前缀

MAGIC_API_TRANSPORT

stdio

stdiohttp

MAGIC_API_HTTP_PORT

3111

http 模式监听端口

MAGIC_API_HTTP_HOST

0.0.0.0

http 模式监听地址

MAGIC_API_ACCESS_TOKEN

http 模式访问令牌(Bearer),不设则不鉴权

* 鉴权二选一(账号密码优先)。

多 target(一套服务操作多个 magic-api 实例)

如果同一个 MCP 部署需要操作多个 magic-api 实例(如 prod / dev),无需再部署多套,用 MAGIC_API_TARGETS 声明即可。

原理: 目标实例由 URL path 选定(/mcp/<target>),path 写死在 claude mcp add 命令里,整个 session 不可变,AI 没有任何工具能跨 target——选择权完全在人手里。

服务端(多 target 启动)

MAGIC_API_TARGETS=prod,dev \
MAGIC_API_TARGET_PROD_BASE=http://prod-host:9999 \
MAGIC_API_TARGET_PROD_TOKEN=静态令牌 \
MAGIC_API_TARGET_PROD_READONLY=true \
MAGIC_API_TARGET_DEV_BASE=http://dev-host:9999 \
MAGIC_API_TARGET_DEV_USERNAME=admin \
MAGIC_API_TARGET_DEV_PASSWORD=密码 \
MAGIC_API_TRANSPORT=http \
MAGIC_API_ACCESS_TOKEN=团队令牌 \
node dist/index.js

每 target 的字段(前缀为 MAGIC_API_TARGET_<NAME>_,NAME 转为大写):

变量

必填

默认

说明

_BASE

target 必填

magic-api 地址

_WEB

/magic/web

管理端路径

_TOKEN

否*

静态 token

_USERNAME / _PASSWORD

否*

账号密码(自动 login)

_READONLY

false

只读模式

_PREFIX

接口路径前缀

同事连接(每人按需选 target)

# 连生产
claude mcp add --transport http magic-api-prod http://部署机:3111/mcp/prod \
  --header "Authorization: Bearer 团队令牌"

# 连开发
claude mcp add --transport http magic-api-dev http://部署机:3111/mcp/dev \
  --header "Authorization: Bearer 团队令牌"
  • target 名仅允许 [A-Za-z0-9_-]+,同一 session 锁定一个 target。

  • 不设 MAGIC_API_TARGETS 时仍为单 target(legacy 模式),现有部署零改动。

  • stdio 不支持多 target(无 path 路由),设了 MAGIC_API_TARGETS 又用 stdio 会启动报错。

  • 全局 MAGIC_API_ACCESS_TOKEN 守卫所有 path;per-target 隔离由 URL 完成。

模式一:stdio(本地,个人用)

Claude 直接启动本地进程。

Claude Code

claude mcp add magic-api --scope user \
  -e MAGIC_API_BASE=http://your-magic-api-host:9999 \
  -e MAGIC_API_WEB=/your-app/magic/dev \
  -e MAGIC_API_USERNAME=your-username \
  -e MAGIC_API_PASSWORD=your-password \
  -- node /绝对路径/magic-api-mcp/dist/index.js

Claude Desktopclaude_desktop_config.json

{
  "mcpServers": {
    "magic-api": {
      "command": "node",
      "args": ["/绝对路径/magic-api-mcp/dist/index.js"],
      "env": {
        "MAGIC_API_BASE": "http://your-magic-api-host:9999",
        "MAGIC_API_WEB": "/your-app/magic/dev",
        "MAGIC_API_USERNAME": "your-username",
        "MAGIC_API_PASSWORD": "your-password"
      }
    }
  }
}

模式二:http(远程,团队共用)

在一台服务器(如内网)常驻运行,所有人连同一个地址。凭据集中在服务端,客户端无需知道 magic-api 密码。

直接启动

MAGIC_API_TRANSPORT=http \
MAGIC_API_HTTP_PORT=3111 \
MAGIC_API_ACCESS_TOKEN=团队令牌 \
MAGIC_API_BASE=http://your-magic-api-host:9999 \
MAGIC_API_WEB=/your-app/magic/dev \
MAGIC_API_USERNAME=your-username \
MAGIC_API_PASSWORD=your-password \
node dist/index.js

常驻(pm2)

pm2 start dist/index.js --name magic-api-mcp
pm2 save && pm2 startup

Docker

docker build -t magic-api-mcp .
docker run -d -p 3111:3111 \
  -e MAGIC_API_BASE=http://your-magic-api-host:9999 \
  -e MAGIC_API_WEB=/your-app/magic/dev \
  -e MAGIC_API_USERNAME=your-username -e MAGIC_API_PASSWORD=your-password \
  -e MAGIC_API_ACCESS_TOKEN=团队令牌 \
  magic-api-mcp

同事的 Claude Code 连接

claude mcp add --transport http magic-api http://部署机:3111/mcp \
  --header "Authorization: Bearer 团队令牌"

http 模式为无状态(每个请求独立 transport),适合低频管理操作。强烈建议设置 MAGIC_API_ACCESS_TOKEN,否则任何能访问该端口的人都能操作 magic-api。

工具一览

  • 接口:list_apis get_api create_api update_api_script delete_api run_api

  • 分组:list_groups create_group

  • 函数:list_functions get_function

  • 数据源:list_datasources

  • 知识:magic_script_help search_code

只读模式(MAGIC_API_READONLY=true)下,写工具被隐藏并在调用时拒绝。

冒烟测试

手动脚本(只读,对真实实例):

MAGIC_API_BASE=... MAGIC_API_WEB=... MAGIC_API_USERNAME=... MAGIC_API_PASSWORD=... \
node scripts/smoke.mjs

或接进 Claude 后试:「列出所有接口分组,看看 getPrintData 的脚本」。

开发

npm test        # 单元 + 集成(73 测试)
npm run dev     # tsx 直跑(stdio)
npm run build

Available Tools

13 tools
create_apiA

创建接口。自动建立缺失分组。返回 id 与完整运行路径 runPath。

ParametersJSON Schema
NameRequiredDescriptionDefault
pathYes接口路径,如 /detail
methodYesHTTP 方法,如 GET/POST
nameYes
groupYes分组名(不存在则自动创建)
scriptYesmagic-script 脚本
descriptionNo

TDQS

A3.6/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description discloses the auto-creation of missing groups as a side effect and the return of id and runPath. However, it does not address potential destructive behavior (e.g., overwriting existing APIs), permissions required, or error conditions. With no annotations, this carries the full burden but is only partially met.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise, consisting of three short clauses in one sentence. It is front-loaded with purpose. However, it could be slightly more structured or elaborate on return values for clarity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 6 parameters and no output schema, the description provides core purpose and return info but lacks details on error handling, idempotency, and edge cases (e.g., duplicate path). It is adequate but not complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 67% description coverage (4 of 6 parameters described). The tool description adds no additional parameter-level meaning; it only mentions the return values. It does not compensate for the two undocumented parameters (name, description). Baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb '创建接口' (create API) and the resource, and provides a key side effect '自动建立缺失分组' (auto-create missing groups) and return values. This differentiates it from siblings like create_group.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies use for creating API endpoints and auto-creating groups, but does not provide explicit guidance on when to use this tool versus alternatives like create_group or run_api. No exclusions or when-not-to-use information.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

create_groupC

创建分组。type 默认 api。返回新分组 id。

ParametersJSON Schema
NameRequiredDescriptionDefault
nameYes分组名称
pathYes分组路径段,如 user
typeNoapi
parentNo父分组 id,默认 0(根)

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so description carries full burden. It discloses creation and return of new id, but lacks information on permissions, idempotency, error conditions, or side effects.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Very brief, but missing key behavioral details that should be present. Every sentence earns its place but overall under-specified.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool is a group create with 4 params, no output schema, and no annotations, the description is incomplete: lacks constraints, hierarchy explanation, and authentication needs.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 75% (missing description for 'type'). Description only restates schema default for type, adding no new meaning for name, path, or parent.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action 'create group' and the resource, and distinguishes from sibling tools like list_groups. It also specifies the default type and return value.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives (e.g., create_api), or any prerequisites or conditions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

delete_apiC

删除接口。ref 可为 id/name/path。

ParametersJSON Schema
NameRequiredDescriptionDefault
refYes

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description must disclose behavioral traits. It only states that the tool deletes and that ref can be various forms, but it does not reveal whether the deletion is permanent, whether confirmation is required, what permissions are needed, or any side effects. Given that this is a destructive operation, more transparency is critical.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is very concise at two sentences. It front-loads the primary action ('Delete interface') and then explains the parameter. There is no wasted text, but it could be slightly more structured with explicit parameter details.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the low complexity (one parameter, no output schema), the description covers the basic purpose and parameter meaning. However, it lacks important context such as irreversibility, authorization requirements, and potential impact on dependent resources. These gaps make it insufficient for an agent to safely invoke the tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema describes ref as a required string with no additional details. The description adds that ref can be an id, name, or path, which is useful context beyond the schema. However, it does not specify format, examples, or how to distinguish between these types. With 0% schema description coverage, the description partially compensates but remains minimal.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Delete interface' and specifies that the ref parameter can be id, name, or path. The verb and resource are specific, and in the context of sibling tools like create_api and get_api, it's clear which resource is being deleted. No sibling tool has a similar delete function, so differentiation is not required.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It does not mention prerequisites, such as whether the interface must exist first, or suggest what to do before deleting (e.g., using get_api to confirm the correct ref). There is no explanation of when deleting is appropriate or what happens to related resources.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_apiA

获取接口详情(含脚本)。ref 可为 id、name 或 path。

ParametersJSON Schema
NameRequiredDescriptionDefault
refYes

TDQS

A3.7/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, and the description does not disclose behavioral traits such as side effects, required permissions, or rate limits. It only notes that the tool includes script in the response.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Extremely concise, two clauses with no superfluous information. Front-loads the core action and parameter specifics.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Adequate for a simple tool with one parameter, but lacks details about return format or what exactly 'details' includes beyond scripts. No output schema means the agent must infer.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Description adds significant value to the schema by clarifying that 'ref' accepts id, name, or path, which is not evident from the schema alone. With 0% schema description coverage, this compensates well.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states it retrieves API details including script, and specifies that 'ref' can be id, name, or path, effectively distinguishing it from sibling tools like 'list_apis' and 'get_function'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit guidance on when to use this tool versus alternatives like 'run_api' or 'update_api_script'. Context is implied but not stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_functionA

获取函数详情(含脚本)。ref 为 id 或 name。

ParametersJSON Schema
NameRequiredDescriptionDefault
refYes

TDQS

A3.6/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool returns details including script, but omits any information about read-only nature, permissions, error handling, or side effects. For a read operation, this is minimal.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise with two short sentences, front-loading the key action and parameter clarification. Every word serves a purpose, and there is no redundancy or filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given there is no output schema, the description should provide insight into return values. It only mentions '包括脚本' (including script), which is incomplete. Details about other fields, error cases, or success indicators are missing, making it insufficient for an agent to fully understand the tool's behavior.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has zero description coverage for the only parameter 'ref'. The description adds meaning by clarifying that 'ref' can be an id or name, which is valuable for correct invocation. However, it could be enhanced with format examples or constraints.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb '获取' (get) and the resource '函数详情' (function details) with the additional qualifier '含脚本' (including script). It also explains that the reference parameter can be an id or name, making the purpose specific and distinguishing it from sibling tools like 'get_api' or 'list_functions'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage (to get function details by ref) but provides no explicit guidance on when to use this tool versus alternatives such as 'list_functions' or 'search_code'. There are no usage exclusions or context for selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_apisB

列出所有接口,含 id/name/method/path/runPath/group。可按分组名过滤。

ParametersJSON Schema
NameRequiredDescriptionDefault
groupNo分组名(可选)

TDQS

B3.4/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description must disclose behavioral traits. It only states it lists and filters, but omits details like permissions, rate limits, response format, or whether it is read-only.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two concise sentences that front-load the purpose and include key details. Every word adds value with no redundancy or filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple list tool with no output schema, the description adequately covers the returned fields and filtering capability. Could mention pagination or default behavior if group is omitted, but acceptable given low complexity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% for the single parameter 'group'. The description adds that it can filter by group name, which reiterates the schema description. No additional semantic value beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool lists all APIs with specific fields (id/name/method/path/runPath/group) and supports filtering by group. It distinguishes from sibling tools like get_api (single API) and other list tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives (e.g., get_api for a single API). The description implies listing all or filtered APIs but doesn't provide explicit usage context or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_datasourcesB

列出所有数据源。

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

B3.1/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description only indicates a read operation (list), but no annotations exist. It does not disclose any behavioral traits beyond listing, such as whether it requires authentication or returns a specific format.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise at one short sentence. It could be slightly more informative, but it earns its place with no waste.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple list tool with no parameters and no output schema, the description is minimal but sufficient to indicate the action. It could mention the return type or scope, but overall it is adequate.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

There are zero parameters, so the schema coverage is 100%. The description adds no parameter information, which is acceptable given the absence of parameters. Baseline 4 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'list' and resource 'data sources'. It is a single, unambiguous sentence. While it does not explicitly distinguish from sibling tools, the sibling tools are about APIs and groups, so the distinction is implicit.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives is provided. The description does not mention prerequisites, context, or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_functionsB

列出所有 magic-script 函数。

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

B3.3/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, and the description does not disclose any behavioral traits beyond the bare purpose. It doesn't mention pagination, sorting, or side effects, leaving the agent to infer behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence that is efficiently front-loaded with the purpose. No extraneous words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the simplicity of a zero-parameter listing tool, the description is adequate but lacks detail on what information is returned (e.g., names, metadata). It could be more complete by specifying the output structure.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

There are no parameters, so schema coverage is 100%. The description adds no extra context about the output format, which would be helpful since there is no output schema. Score at baseline for zero-param tools but could be improved.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('列出所有' meaning 'list all') and the resource ('magic-script 函数' meaning 'functions'). It distinguishes from siblings like get_function and list_apis.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives such as get_function. The description simply states what it does without contextual cues.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_groupsB

列出 magic-api 中所有分组(folder)。

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

B3.2/5.0
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, and the description lacks behavioral details such as pagination, sorting, or authentication requirements. The agent gets no insight into the tool's behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single, front-loaded sentence with no wasted words. It efficiently conveys the core action and resource.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no output schema and minimal description, the tool lacks context about what a 'group' entails, what data is returned, or any usage constraints. This is insufficient for an agent to fully understand the tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

There are zero parameters, so schema coverage is 100%. The description adds no parameter information, but baseline is 4 as per rubric for no parameters.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'list' and resource 'groups (folders)' within 'magic-api', effectively distinguishing it from sibling tools like list_apis or list_datasources.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives such as list_apis or search_code. The description provides no context for decision-making.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

magic_script_helpB

查询 magic-script 用法(db/http/response/env 模块、请求变量、分页、事务等)。

ParametersJSON Schema
NameRequiredDescriptionDefault
topicYes主题关键词,如 db / http / 分页 / query

TDQS

B3.2/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations exist, so the description must disclose behavior. It only states 'query usage' without detailing whether it's read-only, authentication needs, return format, or error cases. Minimal transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

One sentence that directly states purpose and scope. No unnecessary words, front-loaded with relevance. Concise and effective.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple help tool, the description is too brief. It does not specify what the output contains (e.g., text, code snippets, examples) or how errors are handled. Would benefit from more detail on return format.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% with a good description of 'topic'. The tool description adds example modules (db/http/response/env) but mostly echoes the schema examples, providing little extra semantic value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool queries magic-script usage for specific modules (db/http/response/env, etc.). It is distinct from sibling tools which manage APIs and groups, so agents can differentiate.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is implied: use when you need help on magic-script topics. No explicit when-not or alternatives are given, but sibling context makes it clear it's not for resource management.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

run_apiA

运行(测试)接口。向真实路径发请求并返回 status/headers/body。被测接口的错误不算工具错误。

ParametersJSON Schema
NameRequiredDescriptionDefault
pathYes完整运行路径,如 /user/list
methodYes
paramsNoquery 参数
bodyNo请求体(任意 JSON)
headersNo

TDQS

A3.6/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Discloses that errors from the tested API are not tool errors, a key behavioral trait. No annotations provided, so description carries full burden; could add more details like auth requirements or rate limits.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, front-loaded with purpose, no unnecessary words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Returns status/headers/body but not format details. No output schema to compensate. Could explain structure or error handling more thoroughly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Description does not elaborate on parameters beyond what schema provides. With 60% schema coverage, description should add value but doesn't explain method, body, or headers.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states it runs tests by sending requests to real paths and returns status/headers/body. It distinguishes from sibling tools like create_api or get_api by specifying its testing purpose.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Implied usage for testing APIs, but no explicit guidance on when not to use it or alternatives among sibling tools like get_api for definitions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

search_codeC

在所有接口/函数脚本中全局搜索关键词。

ParametersJSON Schema
NameRequiredDescriptionDefault
keywordYes

TDQS

C2.4/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided. The description adds minimal behavioral detail: only that search is 'global' and across 'all interface/function scripts'. Lacks specifics on case sensitivity, regex, or scope limitations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence, no wasted words. However, it is under-specified for the task; conciseness should not come at the cost of essential information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema, no annotations, and a single parameter with no description, the description is insufficient for an agent to fully understand the tool's behavior and expected results.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%. The description mentions 'keyword' in context but provides no explanation of the parameter's format, constraints, or matching behavior. Fails to compensate for absent schema descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states a specific verb ('search') and resource ('code in all interface/function scripts'). It distinguishes from sibling tools which are create/delete/list operations, but does not explicitly differentiate.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives, no exclusions or prerequisites. The description only states the basic function.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

update_api_scriptB

更新接口脚本。ref 可为 id/name/path。

ParametersJSON Schema
NameRequiredDescriptionDefault
refYes
scriptYes

TDQS

B3.2/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description must carry the full burden of behavioral disclosure. It only states 'update' and the ref format, but does not describe mutation behavior, side effects, error handling, or any prerequisites. This is insufficient for a mutation tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single concise sentence that efficiently communicates the core purpose and a key parameter detail. Every word adds value, making it well-structured and front-loaded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema, no annotations, and low schema coverage, the description is incomplete. It lacks information about return values, error behavior, or update semantics. The tool requires more context for an agent to use it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It adds meaning for the 'ref' parameter by specifying it can be id/name/path, but provides no description for the 'script' parameter. This partial coverage is helpful but incomplete.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Update API script' and explains that 'ref' can be id/name/path. This gives a specific verb and resource, but does not explicitly differentiate from sibling tools like create_api or delete_api beyond the verb.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is implied: use this tool to update an API script identified by ref. However, no explicit when-to-use, when-not-to-use, or alternatives are mentioned. Siblings like create_api suggest alternative actions, but guidance is not provided.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 13 tool updatesv0.1.0
    • First observedcreate_api
    • First observedcreate_group
    • First observeddelete_api
    • First observedget_api
    • First observedget_function
    • First observedlist_apis
    • First observedlist_datasources
    • First observedlist_functions
    • First observedlist_groups
    • First observedmagic_script_help
    • First observedrun_api
    • First observedsearch_code
    • First observedupdate_api_script

TDQS

B3.4/5.0
Disambiguation5/5

Each tool targets a distinct resource or action (e.g., create_api, delete_api, get_api, run_api, search_code, magic_script_help). There is no overlap or ambiguity between tools, as they clearly differentiate between APIs, groups, functions, datasources, and help.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern in snake_case (e.g., create_api, list_groups, update_api_script). Even magic_script_help uses a noun but still fits the style. No mixing of conventions.

Tool Count5/5

13 tools is well-scoped for a server managing APIs, groups, functions, datasources, and scripts. It covers the essential operations without being overwhelming or too sparse.

Completeness3/5

While CRUD for APIs is covered (create, delete, get, update_script), groups and functions lack update and delete operations. Datasources only have list. The presence of run_api and search_code adds value, but missing lifecycle operations on groups and functions are notable gaps.

Maintenance

ActivityStale
ResponsivenessSyncing

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

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    Provides comprehensive development tools for Magic-API including documentation lookup, API testing, resource management, debugging with breakpoints, backup operations, and code search capabilities. Enables developers to efficiently build, test, and maintain Magic-API projects through natural language interactions.
    30
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables AI assistants to interact with Magic-API development environment, supporting script syntax query, API management, debugging, and knowledge search for efficient development.
    MIT
  • A
    license
    A
    quality
    D
    maintenance
    Exposes Swagger/OpenAPI API documentation to AI models, enabling exploration, search, and interaction with endpoints, schemas, and execution of API calls.
    14
    13
    2
    MIT

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/LynxBay/magic-api-mcp'

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