Photon by Portel

One File. MCP Server. CLI Tool. Done.

Write a TypeScript class. Photon turns it into a production-ready MCP server or CLI tool with minimal boilerplate.

1
File Required
0
Boilerplate
100%
TypeScript

Why Photon

Building a tool should take minutes, not days. Photon removes every layer between your logic and the runtime.

Single File

Your entire tool lives in one file. No dispersed logic, no config sprawl. Perfect for micro-tools and rapid prototyping.

Auto-Schema Generation

Photon reflects on your TypeScript types and generates MCP schemas and CLI argument parsers automatically. No manual definitions.

Instant Execution

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

One Codebase, Two Outputs

The same class runs as an MCP server for AI agents or as a CLI tool for human developers. Switch with a single flag.

Claude Integration

Integrates with Claude Desktop and Claude Code. Drop your Photon file into the config and your tool is immediately available.

Built-In Dependency Management

Photon handles its own dependencies internally. No package.json to maintain or node_modules to manage for your tools.

How It Works

Two steps from idea to running MCP server.

1 Write your class
weather.photon.ts
export default class WeatherTool {
  /**
   * Get current weather
   * @param city The city name
   */
  get(city: string): string {
    return `Sunny in ${city}`;
  }
}
2 Run it
Terminal
$ npx @portel/photon mcp weather
# or as a command line tool:
$ npx @portel/photon cli weather

Photon compiles weather.photon.ts and starts an MCP server. The get method becomes a tool that Claude Desktop can call directly. Swap mcp for cli and the same class runs as a command line tool instead - no code changes needed.

Open source. Start building your first tool in 5 minutes.

Get Photon on GitHub