Skip to main content
Glama

fbdl-mcp

用于 Meta FBDL(Facebook 开发语言)的 MCP 服务器。允许 AI 代理生成、验证和探索 Meta 漏洞赏金计划 (MMBRC) 中使用的 FBDL 脚本。

无需身份验证 —— FBDL 是一种文本格式。此服务器在本地运行,从不与 Meta 的基础设施通信。

功能介绍

  • validate_fbdl -- 解析并验证 FBDL 脚本。捕获未知实体/操作、缺失的必需参数、无效的枚举值以及语法错误。

  • list_entities -- 浏览所有设置实体类型(User, Page, Group, Album, Friendship, Business, App, Event)及其参数和示例。

  • list_actions -- 浏览所有 70 多种 FBDL 操作,包括签名、参数和示例。支持按名称或类别过滤。

  • explain_fbdl -- 将 FBDL 脚本转换为通俗易懂的逐步解释。

  • generate_fbdl (prompt) -- 提示词模板,为调用 LLM 提供完整的 FBDL 语法,以便其能从自然语言生成有效的脚本。

Claude Code 技能(无需 MCP 服务器)

该仓库包含独立的 Claude Code 技能,无需 MCP 服务器即可工作。将 .claude/skills/ 目录复制到任何项目中:

cp -r /path/to/fbdl-mcp/.claude/skills/ your-project/.claude/skills/

可用技能:

  • /generate-fbdl -- 从自然语言生成 FBDL 脚本。嵌入了完整的语法参考,以便 Claude 可以直接生成有效脚本。

  • /validate-fbdl -- 根据语法验证 FBDL 脚本。包含结构、实体、操作和引用检查的完整清单。

这些技能将整个 FBDL 规范作为提示词上下文嵌入 —— 无需服务器,无需依赖项,无需构建步骤。

安装

git clone <repo-url> && cd fbdl-mcp
npm install
npm run build

验证一切是否正常工作:

npm run check   # typecheck + lint + format + tests

使用 Claude Code 设置

添加到您的 Claude Code MCP 配置(~/.claude/settings.json 或项目 .claude/settings.json):

{
  "mcpServers": {
    "fbdl": {
      "command": "node",
      "args": ["/absolute/path/to/fbdl-mcp/dist/server.js"]
    }
  }
}

然后在 Claude Code 中,您可以说:

"生成一个 FBDL 脚本,其中两个用户是好友,一个拥有一个页面,另一个发布了一张照片并被屏蔽"

"验证此 FBDL 脚本:[setup] User UserOne Page PageOne with {owner: UserOne}"

"有哪些可用于群组的 FBDL 操作?"

使用 OpenAI Codex / 代理设置

对于 Codex 或任何兼容 MCP 的代理,将其指向服务器二进制文件:

node /absolute/path/to/fbdl-mcp/dist/server.js

服务器通过 stdio 使用 MCP 协议进行通信。它公开了:

  • 4 个工具:validate_fbdl, list_entities, list_actions, explain_fbdl

  • 1 个资源:fbdl://reference(完整的语言规范,Markdown 格式)

  • 1 个提示词:generate_fbdl(自然语言转 FBDL 的提示词模板)

AGENTS.md 片段

如果您的代理框架使用 AGENTS.md 进行工具发现,请添加:

## FBDL MCP Server

Tools for working with Meta's FBDL (Facebook Developer Language) scripts:

- Use `validate_fbdl` after generating a script to check it for errors
- Use `list_entities` and `list_actions` to discover available FBDL constructs
- Use `explain_fbdl` to understand what an existing script does
- Use the `generate_fbdl` prompt to produce scripts from natural language

The server runs on stdio. Start with: `node /path/to/fbdl-mcp/dist/server.js`

工作流示例

  1. 代理收到:“创建一个测试场景,其中页面管理员屏蔽了一名群组成员”

  2. 代理调用 list_entities 以检查需要什么设置

  3. 代理调用 list_actions 并传入 category: "block" 以查找正确的操作

  4. 代理使用 generate_fbdl 提示词生成:

[setup] User OwnerOne User MemberOne Page PageOne with {owner: OwnerOne} Group GroupOne with {owner: OwnerOne, privacy: private, members: [MemberOne]}
OwnerOne as PageOne block MemberOne
  1. 代理调用 validate_fbdl 以验证脚本是否正确

  2. 研究人员将脚本粘贴到 Meta 的 MMBRC 平台中

FBDL 快速参考

设置块

[setup] Type Label [with {key: value, ...}] [Type Label ...]

实体类型:User, Page, Group, Album, Friendship, Business, App, Event

操作行

Subject [as VoiceSwitcher] action_name Label [with {key: value, ...}]

身份切换 (as) 允许用户以其拥有的页面身份进行操作。

规则

  • 所有实体必须在操作中使用前在设置块中创建

  • 设置块是单行,以 [setup] 开头

  • 每个操作占一行

  • 标签必须为 PascalCase 且必须唯一

开发

npm run build         # compile TypeScript
npm run test          # run tests
npm run lint          # eslint with strict TypeScript rules
npm run format        # prettier
npm run check         # all of the above

项目结构

src/
  schema.ts           # FBDL language spec as typed data (entities + actions)
  validator.ts        # FBDL script parser and validator
  server.ts           # MCP server (tools, resources, prompts)
  __tests__/
    schema.test.ts    # Schema integrity tests
    validator.test.ts # Validator correctness tests
    server.test.ts    # MCP tool integration tests
F
license - not found
-
quality - not tested
C
maintenance

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

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/GangGreenTemperTatum/fbdl-mcp'

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