Skip to content

feat: mcp - #33

Merged
brunozoric merged 12 commits into
mainfrom
bruno/feat/mcp
Jul 28, 2026
Merged

feat: mcp#33
brunozoric merged 12 commits into
mainfrom
bruno/feat/mcp

Conversation

@brunozoric

Copy link
Copy Markdown
Contributor

Summary

Adds an MCP server to @webiny/stdlib that helps AI agents discover available tools and features.

  • New src/mcp/ slice with list_stdlib_skills and get_stdlib_skill MCP tools
  • stdlib-mcp serve starts the server on stdio; stdlib-mcp configure sets up agent config files
  • 27 discoverable skills: front-matter added to all 24 feature READMEs + 3 cross-cutting guides (DI patterns, adding a feature, testing patterns)
  • 7 agent adapters: Claude Code, Cursor, Cline, GitHub Copilot, Windsurf, Kiro, OpenCode
  • Subpath export @webiny/stdlib/mcp, binary stdlib-mcp

How it works

Agents call list_stdlib_skills to get a grouped catalog (common/node/browser/guides), then get_stdlib_skill with a skill name to load full documentation. Skills are sourced from feature README.md files with YAML front-matter and standalone SKILL.md files in skills/.

Setup in a consuming project

npx stdlib-mcp configure   # select your agent, writes .mcp.json + hint file
git add .mcp.json           # commit so all devs get it

Also included

  • publishConfig.directory: "dist" — published package now has flat structure (no dist/ nesting)
  • ArtifactCopier uses type-fest PackageJson type instead of hand-rolled interfaces
  • Build copies README.md files into dist/ for npm consumers
  • Build ensures CLI shebang survives compilation

Test plan

  • yarn test:coverage — 493 tests pass, coverage thresholds met
  • yarn build && head -1 dist/mcp/cli.js — shebang present
  • echo '{"jsonrpc":"2.0","id":1,"method":"initialize",...}' | npx stdlib-mcp serve — server responds
  • npx stdlib-mcp configure — select Claude, verify .mcp.json and CLAUDE.md written
  • find dist -name "README.md" | wc -l — 25 READMEs in dist

🤖 Generated with Claude Code

brunozoric and others added 10 commits July 28, 2026 12:59
Consumers previously saw all files nested under dist/ (e.g.
@webiny/stdlib/dist/node/features/...). Adding publishConfig.directory
tells changesets to publish from dist/, where ArtifactCopier already
places a package.json with rewritten exports pointing to root-relative
paths. ArtifactCopier now also strips publishConfig from the dist copy
so the published package.json stays clean.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace hand-rolled PackageJson/PackageJsonExports interfaces with
type-fest's PackageJson type. Handles the full Exports union (null,
string, array, ExportConditions) instead of only string | object.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add tsconfig.mcp.json / tsconfig.check.mcp.json, wire the mcp slice
into the root tsconfig references and the BuildPackages build script,
and add package.json exports/bin/deps for the upcoming mcp server.

BuildOrchestrator gains copyReadmes (mirrors src/**/README.md into
dist/) and ensureShebang (prepends #!/usr/bin/env node to dist/mcp/cli.js
once it exists) so packaging works ahead of the actual MCP
implementation. src/mcp/index.ts is an empty placeholder barrel so
tsgo has something to compile for the new slice.

Note: @modelcontextprotocol/sdk@1.30.0 was published within the repo's
3-day npmMinimalAgeGate window, so yarn install currently fails to
resolve it until the gate clears or it is added to
npmPreapprovedPackages in .yarnrc.yml (a security-policy file this
agent is not permitted to edit).
Scans directories for README.md and SKILL.md files with YAML
front-matter via @11ty/gray-matter. Extracts name, description,
context, and body. First-match-wins on name collision. Skips missing
directories and invalid front-matter with warnings.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Registers list_stdlib_skills and get_stdlib_skill MCP tools.
Skills discovered via SkillDiscovery and cached at startup.
Catalog grouped by context, sorted alphabetically.
Interactive CLI for configuring Claude, Cursor, Cline, Copilot,
Windsurf, Kiro, and OpenCode. Writes MCP config and hint files.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Dispatches stdlib-mcp serve (starts MCP server) and stdlib-mcp
configure (interactive agent setup). Resolves default scan paths
from package root with src/dist fallback.
…ng skills

All 24 feature READMEs now have YAML front-matter for MCP discovery.
Three cross-cutting skill files added: di-patterns, adding-a-feature,
testing-patterns.
Both are process-level interactive code (stdio transport, readline
prompts) that cannot be meaningfully unit tested. Excluding them
keeps coverage thresholds passing without hollow tests.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@brunozoric brunozoric self-assigned this Jul 28, 2026
brunozoric and others added 2 commits July 28, 2026 14:56
- actions/checkout v4 → v7
- actions/setup-node v4 → v7
- actions/dependency-review-action v4.9.0 → v5.0.0
- amannn/action-semantic-pull-request v5 → v6

Resolves Node 20 deprecation warnings from action runtimes.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@brunozoric
brunozoric merged commit 3fb0ed7 into main Jul 28, 2026
15 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant