LIGHT MCP Server
by teslasolar
README.md
# LIGHT
The photonic programming language. 38 emoji opcodes. 888 registers. 7 rings. 5 buses.
```
๐ต
๐ป 4.0 "hello"
๐ป 4.1 42
๐ 4.2 4.1 4.1
๐ก๐งต {msg:4.0,answer:4.2}
๐
```
## Install
```bash
npm install -g light-lang
```
## CLI
```bash
light run program.light # run a file
light eval "๐ป 4.0 42 ๐" # eval inline
light template add a=10 b=32 # run template with params
light pipe add:a=5:b=3 phi # chain templates
light mcp sys # MCP tool call
light ops # opcode table
light repl # interactive REPL
```
## Templates
Parameterized programs โ `{{key}}` replaced at call time:
```bash
light template invoice qty=10 rate=149 tax_pct=0.23
light template binding hr=97 hrv=10.5 stress=0.79
light template gate hr=106 stress=0.88
```
Available: `hello`, `add`, `branch`, `loop`, `phi`, `binding`, `invoice`, `gate`, `pipe`
## MCP API
```js
const {createMCP} = require('light-lang/src/mcp')
const mcp = createMCP()
mcp.handle('run', {src: '๐ป 4.0 42\n๐ก๐งต 4.0\n๐'})
mcp.handle('template', {name: 'add', params: {a: 10, b: 32}})
mcp.handle('pipe', {chain: [{template: 'add', params: {a: 5, b: 3}}, {template: 'phi', params: {}}]})
mcp.handle('eval', {expr: '๐ 5.0 | ๐ก๐งต 5.0 | ๐'})
mcp.handle('ops', {})
mcp.handle('sys', {})
```
## Opcodes
| Emoji | PRASM | Prime | LIGHT physics |
|-------|-------|-------|---------------|
| โซ | NOP | 2 | dark |
| ๐ป | LD | 3 | absorb |
| ๐บ | ST | 5 | emit |
| ๐ | ADD | 7 | interfere |
| ๐ | MUL | 11 | lens |
| ๐ฎ | ATT | 13 | filter |
| ๐ | VAL | 17 | spectrum |
| ๐ | PLN | 19 | cavity |
| ๐ชข | MDL | 23 | entangle |
| ๐ | OBS | 29 | reflect |
| โก | JMP | 31 | redirect |
| โ๏ธ | CMP | 37 | compare ฮป |
| ๐ต | JEQ | 41 | resonate |
| ๐ฅ | JNE | 43 | scatter |
| ๐ | JGT | 47 | amplify |
| ๐จ | INT | 53 | alarm |
| ๐ฝ | REC | 59 | nest |
| ๐ผ | UNR | 61 | unnest |
| ๐ก | EMT | 67 | radiate |
| ๐ | RSN | 71 | tune |
| ๐ | SLP | 73 | dim |
| โจ | DRM | 79 | fluoresce |
| โ๏ธ | WAK | 83 | excite |
| ๐งฏ | ABT | 89 | quench |
| ๐ง | FRZ | 97 | freeze |
| ๐ซง | CLR | 101 | bleach |
| โ ๏ธ | DIE | 103 | annihilate |
| ๐ฑ | GEO | 107 | diffract |
| ๐ | PHI | 109 | cohere |
| โพ๏ธ | PSI | 113 | self-ref |
## Rings
| Ring | Emoji | ฮป nm | Function |
|------|-------|------|----------|
| R0 | ๐ด | 700 | MATERIAL |
| R1 | ๐ | 630 | WEAVE |
| R2 | ๐ก | 590 | NODE |
| R3 | ๐ข | 520 | ZONE |
| R4 | ๐ต | 470 | PROTOCOL |
| R5 | ๐ฃ | 405 | PRODUCT |
| R6 | โช | 350 | FACTORY |
Total registers: 2 + 3 + 5 + 11 + 31 + 127 + 709 = **888**
## Architecture
```
mcp( โ tool interface (run/template/pipe/eval/ops/sys)
api( โ programmatic access (createMCP, createVM)
cli( โ command line (light run/eval/template/pipe/mcp/ops/repl)
cmd( โ command dispatch
sys( โ runtime (parse, exec, 888 registers, 7 rings)
params( โ template resolution ({{key}} โ value)
light โ the photonic instruction set
)
)
)
)
)
)
```
## License
MIT
This server cannot be deployed
Maintenance
ActivitySlowing
ResponsivenessUnresponsive