@ex-machina/facets-mcp package provides an MCP (Model Context Protocol) server that exposes facet operations to AI coding assistants. It’s a thin wrapper around the @ex-machina/facets core library, communicating over stdio.
Running the server
Configuration
Project root
The server determines which project to operate on using:FACETS_PROJECT_ROOTenvironment variable (if set)- Current working directory (default)
OpenCode setup
If you ranfacets init, the MCP server is already registered. Otherwise, add it manually to .opencode/opencode.jsonc:
Other assistants
For any MCP-compatible assistant, configure a stdio server with:- Command:
bunx @ex-machina/facets-mcp - Transport: stdio
- Environment: Optionally set
FACETS_PROJECT_ROOTto the target project directory
Security
The server validates facet names to prevent path traversal — names containing.. or / are rejected with a not_found result.
What’s exposed
The server registers exactly 5 tools covering the full facet lifecycle:| Tool | Description |
|---|---|
facet-list | List all facets and their status |
facet-add | Cache a remote facet by URL |
facet-install | Install a facet’s resources |
facet-update | Check for updates to a cached facet |
facet-remove | Remove a facet and its resources |