Photon: The Universal TypeScript Runtime

Turn any TypeScript class into a production-ready MCP server, CLI tool, or API instantly

1
File Required
0
Boilerplate
100%
Type Safety

⚡ Focus on Logic, Not Infrastructure

Building developer tools shouldn't require complex setups, multiple configuration files, or manual schema definitions. With Photon, your business logic is the interface. Just write a TypeScript class, and Photon handles the rest—whether you need an MCP server, a CLI, or an API.

Why Developers Choose Photon

📄

Single File Simplicity

Entire application in one file. No dispersed logic, no complex folder structures. Perfect for micro-tools and rapid prototyping.

🔄

Auto-Schema Generation

Forget writing JSON schemas or argument parsers manually. Photon reflects on your TypeScript types and generates everything automatically.

🚀

Instant Execution

Run directly with npx. Photon handles compilation, dependency resolution, and runtime execution in milliseconds.

How It Works

1. Create ~/.photon/weather.photon.ts

export default class WeatherTool {
  /**
   * Get current weather
   * @param city The city name
   */
  get(city: string): string { // Changed from getWeather to get
    return `Sunny in ${city}`;
  }
}

2. Run Your Server

npx @portel/photon mcp weather

Photon automatically loads weather.photon.ts from your ~/.photon directory and starts an MCP server exposing the get tool. Want a CLI instead? Just swap mcp for cli.

The Photon Ecosystem

🧩 Universal Runtime

One codebase, multiple outputs. Run your class as an MCP server for AI agents, or as a CLI tool for human developers.

🤖 Claude Integration

Seamlessly integrates with Claude Desktop and Claude Code. Just drop your Photon file into the config and go.

📦 Zero Dependencies

Photon manages its own runtime environment. You don't need to mess with package.json or node_modules for simple tools.

Start Building Faster

Stop fighting with configuration and start building intelligence.

Open source and ready for your next idea.

Get Photon on GitHub