Skip to content

PhotonSingle-file TypeScript runtime for MCP, CLI, and web UI

Define a capability once. Photon exposes it to AI agents, command lines, embedded app UIs, and Beam.

Photon logo

Install

bash
bun add -g @portel/photon
photon new my-tool
photon mcp install my-tool

Prefer a one-off run?

bash
bunx @portel/photon new my-tool

What Photon Builds

ts
export default class Hello {
  greet(params: { name: string }) {
    return `Hello, ${params.name}!`;
  }
}

That one file can run as a CLI command, a Beam web dashboard, and an MCP server.

Documentation Map

Start here
Getting StartedInstall, build, and run your first photon.
Core ConceptsLearn the mental model behind methods, comments, formats, state, settings, and surfaces.
From Method to Chat AppFollow the weather showcase across CLI, Beam, MCP, and embedded chat UI.
Output FormatsBrowse visual formats for tables, charts, cards, dashboards, markdown, and more.
Docblock TagsReference every public docblock tag Photon understands.
Complete Developer GuideDeep reference for authoring, deploying, and operating photons.

Released under the MIT License.