Skip to main content
The @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

bunx @ex-machina/facets-mcp
The server uses stdio transport — it reads JSON-RPC messages from stdin and writes responses to stdout.

Configuration

Project root

The server determines which project to operate on using:
  1. FACETS_PROJECT_ROOT environment variable (if set)
  2. Current working directory (default)

OpenCode setup

If you ran facets init, the MCP server is already registered. Otherwise, add it manually to .opencode/opencode.jsonc:
{
  "mcp": {
    "facets": {
      "type": "local",
      "command": ["bunx", "facets-mcp"],
      "enabled": true
    }
  }
}

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_ROOT to 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:
ToolDescription
facet-listList all facets and their status
facet-addCache a remote facet by URL
facet-installInstall a facet’s resources
facet-updateCheck for updates to a cached facet
facet-removeRemove a facet and its resources
No MCP resources or prompts are registered — only tools.