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.
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.
export default class WeatherTool {
/**
* Get current weather
* @param city The city name
*/
get(city: string): string {
return `Sunny in ${city}`;
}
}
$ 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