# Moltis Gateway Mcp

> personal agent server mcp with multi-provider LLMs, voice, memory, Telegram, WhatsApp, Discord, Teams | mcp server of several socials

- **Type:** MCP server
- **Install:** `agentstack add mcp-trifillara-moltis-gateway-mcp`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [trifillara](https://agentstack.voostack.com/s/trifillara)
- **Installs:** 0
- **Category:** [Communication](https://agentstack.voostack.com/c/communication)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [trifillara](https://github.com/trifillara)
- **Source:** https://github.com/trifillara/moltis-gateway-mcp
- **Website:** https://moltis.org/

## Install

```sh
agentstack add mcp-trifillara-moltis-gateway-mcp
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Moltis TS Gateway Fork

TypeScript-first AI gateway fork of Moltis with a real-time chat UI, WebSocket RPC, SQLite session storage, and optional Redis tooling.

This README is intentionally fork-specific and focused on what you can run **today** in this repo.

---

## Why this fork

- TypeScript gateway runtime under `src/gateway/`
- Existing Preact UI retained and integrated
- SQLite-backed sessions and chat history
- OpenAI streaming chat in the new gateway
- Optional Redis helper under `src/redis/`
- Clear migration path from Rust workspace to full TS stack

## Quick start (2 minutes)

```bash
npm install
cp .env.example .env
# set OPENAI_API_KEY in .env
npm run build:web
npm start
```

Open: `http://127.0.0.1:8080`

## What you get right now

| Area | Status |
|---|---|
| Web UI served by TS gateway | Ready |
| WebSocket `connect` handshake | Ready |
| `chat.send` streaming replies | Ready |
| Sessions list/switch + history API | Ready |
| SQLite persistence (`better-sqlite3`) | Ready |
| Redis utility module (`src/redis`) | Ready |
| Full upstream parity (tools/channels/sandbox) | In migration |

## Architecture (current fork)

```mermaid
flowchart LR
  UI[Preact Web UI] --> WS[WebSocket RPC /ws/chat]
  UI --> HTTP[REST /api/*]
  WS --> GW[TypeScript Gateway src/gateway]
  HTTP --> GW
  GW --> DB[(SQLite)]
  GW --> OAI[OpenAI API]
  GW -. optional .-> REDIS[(Redis helper)]
```

## Runtime modes

### Recommended: TypeScript gateway

```bash
npm run build:web
npm start
```

### Legacy: upstream Rust runtime

Use this only if you need upstream-only features not migrated yet.

```bash
cargo build
cargo run
```

## Commands

| Command | Purpose |
|---|---|
| `npm start` | Start TypeScript gateway |
| `npm run build:web` | Build Preact assets from `crates/web/ui` |
| `npm run dev` | Build web assets and run gateway |
| `npm run typecheck` | Type-check TS sources |
| `npm run test` | Run Vitest suite |
| `npm run validate:redis` | Typecheck + tests for Redis tooling |

## Configuration

Copy `.env.example` and set at least `OPENAI_API_KEY`.

### Core gateway

| Variable | Default | Notes |
|---|---|---|
| `MOLTIS_GATEWAY__HOST` | `127.0.0.1` | Bind host |
| `MOLTIS_GATEWAY__PORT` | `8080` | HTTP/WebSocket port |
| `MOLTIS_DATA_DIR` | `.moltis/data` | SQLite DB location |
| `OPENAI_API_KEY` | unset | Required for live chat |
| `MOLTIS_DEFAULT_MODEL` | `gpt-4o-mini` | Default model |
| `MOLTIS_DEFAULT_PROVIDER` | `openai` | Provider id |

### Optional Redis tooling

```ts
import { RedisConnectionManager, withRedis } from "moltis/redis";
```

| Variable | Default |
|---|---|
| `REDIS_URL` | unset |
| `REDIS_HOST` | `127.0.0.1` |
| `REDIS_PORT` | `6379` |
| `REDIS_DB` | `0` |
| `REDIS_KEY_PREFIX` | `moltis:` |

## Project map

```text
moltis/
├── src/
│   ├── gateway/          # TypeScript gateway runtime
│   └── redis/            # Optional Redis module
├── tests/redis/          # Vitest tests for Redis module
├── crates/web/ui/        # Existing Preact UI source
├── package.json
├── tsconfig.json
└── docs/internal/
    └── TYPESCRIPT-GATEWAY.md
```

## Migration note

This fork is migrating from the original Rust workspace to a full TypeScript stack in phases.

- Current migration details: `docs/internal/TYPESCRIPT-GATEWAY.md`
- `crates/` still exists to preserve upstream compatibility while TS features are brought over.

## Troubleshooting

- **Blank UI after start**: run `npm run build:web` again.
- **Chat returns fallback response**: check `OPENAI_API_KEY`.
- **Port in use**: change `MOLTIS_GATEWAY__PORT` in `.env`.
- **Redis tests fail**: Redis is optional for runtime; ensure env values are valid when testing Redis-specific code.

## Contributing

PRs are welcome. Keep changes scoped, include verification commands, and call out whether changes target:

- TypeScript gateway (`src/gateway`)
- Redis tooling (`src/redis`)
- UI integration (`crates/web/ui`)
- Migration/docs

## License

MIT. See `LICENSE.md`.

## Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [trifillara](https://github.com/trifillara)
- **Source:** [trifillara/moltis-gateway-mcp](https://github.com/trifillara/moltis-gateway-mcp)
- **License:** MIT
- **Homepage:** https://moltis.org/

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** yes
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** yes
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/mcp-trifillara-moltis-gateway-mcp
- Seller: https://agentstack.voostack.com/s/trifillara
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
