Token导航 LogoToken导航TokenDH.com
Openlibrary Mesh MCP logo
AI代理未说明官方级别未说明来源级核验

Openlibrary Mesh MCP

MCP Server

将OpenLibrary的REST搜索API转换为GraphQL端点,并通过MCP为AI助手提供安全工具。

工具数

0

提示词数

0

GitHub Stars

0

资源数

0
GraphQL开源工具JavaScriptAPI转换

安装说明

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

作者 / 组织

chris-page-gov

提供方

chris-page-gov

最后核验

2026/5/17 20:19

快速接入

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

详细介绍

OpenLibrary Mesh+MCP(开源StepZen风格演示)

将公共OpenLibrary REST搜索包装为 图查询语言 使用 GraphQL网格,然后暴露一个安全工具 主控程序 AI助手。

这反映了StepZen的工作流程(curl→ 图查询语言→ MCP)使用 100%开源 组件。

______________________________________________________________________

你得到了什么

  • GraphQL端点http://localhost:4000/graphql 带有字段:
  searchBooks(title: String!, page: Int): {
    numFound, start, docs { title, author_name, first_publish_year, key }
  }
  • MCP服务器 暴露一个工具: open-library-search(title, page?)

______________________________________________________________________

先决条件

  • Node.js 18.17+
  • 互联网访问(OpenLibrary是一个公共的API)

______________________________________________________________________

快速启动

# 1) Install deps
npm i

# 2) Start GraphQL Mesh (Terminal A)
npm run mesh:dev
# -> http://localhost:4000/graphql

# 3) Start MCP server (Terminal B)
npm run mcp:server
# (optional) change endpoint via env:
#   MESH_GRAPHQL=http://localhost:4000/graphql npm run mcp:server

# 4) (Optional) Run a smoke test (requires Mesh running)
npm test

打开GraphiQL http://localhost:4000/graphql 并运行:

query($title: String!, $page: Int) {
  searchBooks(title: $title, page: $page) {
    numFound
    start
    docs {
      title
      author_name
      first_publish_year
      key
    }
  }
}

变量:

{ "title": "the lord of the rings", "page": 1 }

______________________________________________________________________

使用MCP工具

添加包含 mcp/mcp.json 将代码片段添加到启用MCP的客户端配置中。它声明了一个名为 openlibrary-mesh-mcp 这始于:

{
  "command": "node",
  "args": ["mcp/server.mjs"],
  "env": { "MESH_GRAPHQL": "http://localhost:4000/graphql" }
}

然后,您的客户端应该列出一个名为 open-library-search。用以下方式称呼它:

{ "title": "the lord of the rings", "page": 1 }

______________________________________________________________________

项目布局

openlibrary-mesh-mcp/
├─ package.json
├─ mesh.config.yml
├─ openlibrary.yaml
├─ src/
│  └─ search.mjs           # shared function used by MCP + tests
├─ mcp/
│  ├─ server.mjs           # minimal MCP server (stdio)
│  └─ mcp.json             # example client config
├─ test/
│  └─ test.mjs             # smoke test against Mesh endpoint
└─ .gitignore

______________________________________________________________________

注意事项和后续步骤

  • 架构形状:展开 Doc 内部 openlibrary.yaml 具有更多字段(例如。, subject, publisher)Mesh会立即将其暴露出来。
  • 安全:箝位参数(例如。, page)并考虑向仅项目所需字段添加转换。
  • 缓存:使用简单的缓存或使用Mesh插件。
  • 认证:OpenLibrary搜索是公开的。对于经过身份验证的API,请添加 operationHeadersmesh.config.yml 并通过env提供机密。

______________________________________________________________________

许可证

MIT为这个示例代码;OpenLibrary API术语适用于上游数据。

目录标签

目录标签

GraphQL开源工具JavaScriptAPI转换本地部署MCP图书搜索

接入字段

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

未说明

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

none

工具数量(toolCount,工具数)

0

资源数量(resourceCount,资源数)

0

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

0

权限和风险

未说明none部署方式未说明

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

安装前确认

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

仍需确认:installCommand

来源信息

继续浏览同类 MCP