ybrain

ybrain

Company knowledge MCP server for discovering prompts, owners, docs, and skills, with open read/suggest access and supervisor-controlled publishing via Git.

Category
访问服务器

README

ybrain

Company knowledge MCP server. One HTTP endpoint an ordinary user adds to their MCP client to ask "what prompts do we have?", "who owns billing?", "where are the Grafana docs?", and "what skills exist and how do I install them?". Anyone can also suggest a new prompt/owner/doc/skill — it's saved as a draft that a supervisor reviews and publishes. Every change is a real Git commit in a single data repo.

MCP client ──HTTP──▶ ybrain (this server) ──git clone/pull/push──▶ github.com/<acct>/ybrain-data
   read + suggest = open                    (drafts/ → supervisor publishes → live)

What it does

Ask (open, no token) Read tools
List / detail company prompts list_prompts, get_prompt, search_prompts
Who owns what who_owns, list_owners
Docs / links to systems list_docs, get_doc, search_docs
Skills — internal + external, with install commands list_skill_sources, list_skills, search_skills, get_skill
See pending suggestions list_drafts, get_draft
Contribute (open, → drafts/) Suggest tools
Propose a prompt / owner / doc / skill suggest_prompt, suggest_owner, suggest_doc, suggest_skill
Supervisor (named token) Privileged tools
Promote / discard a draft publish_draft, reject_draft
Register an external skill source add_skill_source

Access model: read-only + suggest → draft → supervisor merges

  • Reads and suggest_* are open — no token. A suggestion never goes live; it's committed under drafts/ for review.
  • The real access control is Git itself. A supervisor promotes a draft with publish_draft (a git mv from drafts/x to live), rejects it, or just merges/edits it directly in GitHub. "Write rights only for some" = whoever can merge/publish — ybrain implements no roles of its own.
  • Supervisor tokens are named (YBRAIN_SUPERVISOR_TOKENS=alice=…,bob=…): the name authors published commits, and one token can be revoked without rotating the rest. Suggestion commits use a fixed suggestion author (the suggested_by field is client-supplied and unverified — metadata only).
  • Because suggestions are open, the server caps request body size and rate-limits per IP.

This dissolves the shared-write-token blast radius: a leaked credential (or an anonymous caller) can only propose a draft — never overwrite live content or forge merged history.

Data repo layout

ybrain reads and writes one Git repo (YBRAIN_DATA_REPO_URL):

prompts/<slug>.md        # title, tags, variables, usage (frontmatter) + body
owners/<area>.md         # area, owner, backup, contact, systems
docs/<system>.md         # system, category, links[] + description
skills/<slug>/SKILL.md   # name, description + instructions
skill-sources.yaml       # external skill repos to index
drafts/…                 # open suggestions awaiting publish (mirrors the above)

See data-repo-template/ for a ready-to-fork seed.

Skills: index, don't copy

ybrain gives one searchable view over your internal skills and external skill repos (e.g. mattpocock/skills, Claude Code plugin marketplaces). It does not vendor anyone's skills — it reads each repo's SKILL.md frontmatter (name + description) via the GitHub API and, for each skill, returns the exact client-side install command for that source. (An MCP server can't install into your ~/.claude/skills/ — so ybrain discovers and advises; the client installs.)

Sources live in skill-sources.yaml in the data repo:

sources:
  - id: internal
    kind: internal            # this data repo's skills/ dir
  - id: mattpocock
    repo: mattpocock/skills
    kind: skills-cli          # → npx skills@latest add mattpocock/skills
    path: skills
  - id: anthropic
    repo: anthropics/skills
    kind: marketplace         # → /plugin marketplace add … ; /plugin install …@…

kind drives the install advice get_skill prints: skills-cli, marketplace, folder (git clone + copy into .claude/skills/), or internal. Register more with add_skill_source (supervisor only — a source is served to every user, so it's an injection surface). External descriptions are labelled untrusted in get_skill output.

Phase 2 (planned): ship a .claude-plugin/marketplace.json in the data repo so internal skills get one-command native /plugin install + auto-update, alongside this MCP discovery layer.

How the Git backend works

  • Local clone, not the GitHub API. Reads hit the filesystem — instant, searchable, and they keep working if GitHub is briefly down. (The API would burn rate limits on every "list everything".) The only GitHub-API use is the read-only indexing of external skill repos.
  • Single in-process write queue. Each write commits first, then rebases onto the remote and pushes; on conflict/rejection it hard-resets to the remote so a failed write is a true no-op. Git ops have timeouts so a hung network op can't wedge the queue. Assumes exactly one server instance.
  • Freshness: a background git fetch + reset --hard origin every YBRAIN_PULL_INTERVAL seconds picks up edits/merges made on GitHub. An optional POST /webhook (HMAC-verified) refreshes immediately on push.
  • Swappable: tools talk to a DataStore interface (src/store.ts), so a future GitHub-API or Cloudflare-KV backend is one file — no tool changes. Do not horizontally scale the local-clone backend (two clones pushing = races the queue can't fix).

Run

cp .env.example .env      # set YBRAIN_DATA_REPO_URL, YBRAIN_GIT_TOKEN; optional YBRAIN_SUPERVISOR_TOKENS
bun install
bun run dev               # or: docker compose up --build
curl localhost:8080/healthz

Add it to an MCP client

Streamable HTTP endpoint at POST /mcp. Read + suggest (no token):

{ "mcpServers": { "ybrain": { "url": "https://ybrain.example.com/mcp" } } }

Supervisor (add a named token to unlock publish/reject/register-source):

{
  "mcpServers": {
    "ybrain": {
      "url": "https://ybrain.example.com/mcp",
      "headers": { "Authorization": "Bearer YOUR_SUPERVISOR_TOKEN" }
    }
  }
}

Layout

src/
  server.ts     # HTTP + Streamable HTTP transport; /mcp /healthz /webhook; rate limit + body cap
  auth.ts       # Bearer token → { canPublish, author }; constant-time compare
  config.ts     # env resolution (named supervisor tokens, limits)
  store.ts      # DataStore interface (backend-agnostic): read/write/remove/move/refresh
  git-store.ts  # local-clone Git backend: commit-then-rebase queue, resilient refresh
  content.ts    # frontmatter parse/format + renderers; live/draft path helpers
  skills.ts     # skill source registry + unified index + install-hint generator
  tools.ts      # read + suggest (open) tools, supervisor tools (token-gated)
  log.ts

Built with Bun + TypeScript + @modelcontextprotocol/sdk, matching the yreview toolchain.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选