npx skills add https://github.com/schrepa/graft --skill graft当任务涉及创建或改进 Graft 服务器、使用 Graft 代理模式包装现有 API,或更新面向贡献者的文档和示例以匹配当前 graft 包的行为时,请使用此技能。
Graft 的核心价值包含三个部分:
agent.json、mcp.json、llms.txt 找到工具。人类可以获得交互式文档 (/docs) 和 OpenAPI 规范 (/openapi.json)。零配置。在解释 Graft 时,请同时介绍这三个部分。在展示示例时,演示两种访问模式(MCP 和 HTTP)并提及服务器自动提供的内容。这适用于基于源代码的应用和代理模式。
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
createApp(...)graft serve --openapi ... 或 graft.proxy.yaml。app.tool('name', config)。defineTool(...) 加上 app.tool(definedTool)。true、['role'] 或 { roles: [...] }。POST /mcp。/.well-known/agent.json、/.well-known/mcp.json、/openapi.json、/docs、/llms.txt、/llms-full.txt、/health。serve、dev、check、test、studio、install、add-tool。tools/call 调用和等效的 HTTP 请求(例如 GET /list-items?q=hello 或 POST /create-entry)。import { createApp } from '@schrepa/graft'
import { z } from 'zod'
const app = createApp()
app.tool('list_items', {
description: 'List items matching a query.',
params: z.object({ q: z.string() }),
auth: true,
handler: async ({ q }) => ({
items: ['hello', 'world'].filter((item) => item.includes(q)),
}),
})
export default app
MCP (tools/call):
{ "method": "tools/call", "params": { "name": "list_items", "arguments": { "q": "hello" } } }
HTTP 等效请求:
GET /list-items?q=hello
Authorization: Bearer <token>
两者使用相同的处理程序、身份验证中间件和验证。
graft.proxy.yamltarget: https://petstore3.swagger.io/api/v3
tools:
- method: GET
path: /pet/findByStatus
name: find_pets_by_status
description: Find pets by status.
parameters:
type: object
properties:
status:
type: string
- method: POST
path: /pet
name: create_pet
description: Create a pet.
parameters:
type: object
properties:
name:
type: string
required: [name]
启动代理服务器:
graft serve --config graft.proxy.yaml
Graft 将每个配置的操作同时暴露为 HTTP 端点和 MCP 工具,并自动生成 /openapi.json、/docs 和发现文件。
对于直接的 OpenAPI 路径,请使用:
graft serve --openapi ./openapi.yaml --target https://api.example.com
每周安装量
546
代码库
GitHub 星标数
1
首次出现
2 天前
安全审计
安装于
github-copilot465
claude-code464
cursor462
opencode460
gemini-cli460
codex460
Use this skill when the task is about creating or refining a Graft server, wrapping an existing API with Graft proxy mode, or updating contributor-facing docs and examples so they match the current graft package behavior.
Graft's core value has three parts:
agent.json, mcp.json, llms.txt. Humans get interactive docs (/docs) and an OpenAPI spec (/openapi.json). Zero configuration.When explaining Graft, lead with all three parts. When showing examples, demonstrate both access patterns (MCP and HTTP) and mention what the server auto-serves. This applies to both source-based apps and proxy mode.
createApp(...), tools, resources, prompts, HTTP routes, Node or fetch integration.graft serve --openapi ... or graft.proxy.yaml.app.tool('name', config).defineTool(...) plus app.tool(definedTool).true, ['role'], or { roles: [...] }.POST /mcp./.well-known/agent.json, /.well-known/mcp.json, /openapi.json, , , , .import { createApp } from '@schrepa/graft'
import { z } from 'zod'
const app = createApp()
app.tool('list_items', {
description: 'List items matching a query.',
params: z.object({ q: z.string() }),
auth: true,
handler: async ({ q }) => ({
items: ['hello', 'world'].filter((item) => item.includes(q)),
}),
})
export default app
MCP (tools/call):
{ "method": "tools/call", "params": { "name": "list_items", "arguments": { "q": "hello" } } }
HTTP equivalent:
GET /list-items?q=hello
Authorization: Bearer <token>
The same handler, auth middleware, and validation run for both.
graft.proxy.yamltarget: https://petstore3.swagger.io/api/v3
tools:
- method: GET
path: /pet/findByStatus
name: find_pets_by_status
description: Find pets by status.
parameters:
type: object
properties:
status:
type: string
- method: POST
path: /pet
name: create_pet
description: Create a pet.
parameters:
type: object
properties:
name:
type: string
required: [name]
Start the proxy server:
graft serve --config graft.proxy.yaml
Graft exposes each configured operation as both an HTTP endpoint and an MCP tool, and auto-generates /openapi.json, /docs, and discovery files.
For the direct OpenAPI path, use:
graft serve --openapi ./openapi.yaml --target https://api.example.com
Weekly Installs
546
Repository
GitHub Stars
1
First Seen
2 days ago
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
github-copilot465
claude-code464
cursor462
opencode460
gemini-cli460
codex460
FastMCP Python框架:快速构建MCP服务器,为Claude等大模型提供工具与资源
405 周安装
Nginx配置完全指南:生产级反向代理、负载均衡、SSL终止与性能优化
406 周安装
iOS HIG 设计指南:原生应用界面开发框架与 SwiftUI/UIKit 最佳实践
406 周安装
Aceternity UI - Next.js 13+ 动画React组件库 | Tailwind CSS & Framer Motion
406 周安装
RAG工程师技能详解:检索增强生成系统架构与最佳实践
406 周安装
survey技能:跨平台问题空间扫描与调研工具 | 智能体开发研究
406 周安装
/docs/llms.txt/llms-full.txt/healthserve, dev, check, test, studio, install, add-tool.tools/call invocation and the equivalent HTTP request (e.g. GET /list-items?q=hello or POST /create-entry).