Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions sample-apps/TwinAgent-OS/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
NODE_ENV=development
PORT=4000
HOST=0.0.0.0
DATABASE_URL="postgresql://postgres:postgres@localhost:5432/twinagent_os?schema=public"
REDIS_URL="redis://localhost:6379"
JWT_SECRET="twinagent_super_secret_jwt_key_32_chars_min_length_spec"
JWT_EXPIRES_IN="1d"
REFRESH_TOKEN_SECRET="twinagent_super_secret_refresh_key_spec"
REFRESH_TOKEN_EXPIRES_IN="7d"
LOG_LEVEL=info
CORS_ORIGIN="*"

OPENAI_API_KEY="your-openai-api-key"
ANTHROPIC_API_KEY="your-anthropic-api-key"
GEMINI_API_KEY="your-gemini-api-key"
12 changes: 12 additions & 0 deletions sample-apps/TwinAgent-OS/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"parser": "@typescript-eslint/parser",
"extends": ["plugin:@typescript-eslint/recommended"],
"parserOptions": {
"ecmaVersion": 2022,
"sourceType": "module"
},
"rules": {
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/no-unused-vars": ["warn", { "argsIgnorePattern": "^_" }]
}
}
6 changes: 6 additions & 0 deletions sample-apps/TwinAgent-OS/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules
dist
.env
*.log
coverage
.DS_Store
7 changes: 7 additions & 0 deletions sample-apps/TwinAgent-OS/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"semi": true,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "es5",
"printWidth": 120
}
38 changes: 38 additions & 0 deletions sample-apps/TwinAgent-OS/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
FROM node:20-alpine AS builder

WORKDIR /app

COPY package*.json ./
COPY prisma ./prisma/

RUN npm ci

COPY . .

RUN npx prisma generate
RUN npm run build

FROM node:20-alpine AS runner

WORKDIR /app

ENV NODE_ENV=production

RUN apk add --no-cache procps
RUN npm install -g @nitrostack/cli --no-audit --no-fund --progress=false

COPY package*.json ./
RUN npm ci --omit=dev

COPY --from=builder --chown=node:node /app/dist ./dist
COPY --from=builder --chown=node:node /app/prisma ./prisma
COPY --from=builder --chown=node:node /app/node_modules/.prisma ./node_modules/.prisma
COPY --from=builder --chown=node:node /app/node_modules/@prisma ./node_modules/@prisma

USER node

EXPOSE 3000
EXPOSE 4000

CMD ["nitrostack-cli", "start"]

102 changes: 102 additions & 0 deletions sample-apps/TwinAgent-OS/MCP_COMPATIBILITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
# TwinAgent OS — Multi-Transport MCP Client Connection Guide

TwinAgent OS supports **Dual-Transport Official MCP Capabilities**:
1. **STDIO Transport** (JSON-RPC over Stdio command)
2. **URL / SSE Transport** (Server-Sent Events streaming over HTTP URL)

---

## 1. Connection Configurations by Client

### NitroStudio

NitroStudio supports both **STDIO Command** and **URL / SSE** connections.

#### Option A: STDIO Command Connection (Recommended)
- **Project / Server Name**: `TwinAgent OS`
- **Connection Type**: `STDIO`
- **Command**: `npm`
- **Arguments**: `run`, `--silent`, `mcp:start`
- **Working Directory**: `/Users/sunilprasad/richelle/TwinAgent OS`
- **Environment Variables**:
```json
{
"NODE_ENV": "production"
}
```

> *(Direct Execution)*:
> - **Command**: `npx`
> - **Arguments**: `-y`, `tsx`, `src/mcp/cli.ts`

#### Option B: URL / SSE Connection
- **Project / Server Name**: `TwinAgent OS (SSE)`
- **Connection Type**: `SSE` / `HTTP`
- **Server URL**: `http://localhost:4000/api/v1/mcp/sse`

---

### Claude Desktop

Add to `claude_desktop_config.json`:

```json
{
"mcpServers": {
"twinagent-os": {
"command": "npx",
"args": ["-y", "tsx", "/Users/sunilprasad/richelle/TwinAgent OS/src/mcp/cli.ts"],
"env": {
"NODE_ENV": "production"
}
}
}
}
```

---

### Cursor IDE

1. Open **Cursor Settings** -> **Features** -> **MCP Servers** -> **+ Add New MCP Server**.
2. Configure:
- **Name**: `twinagent-os`
- **Type**: `command`
- **Command**: `npx -y tsx /Users/sunilprasad/richelle/TwinAgent OS/src/mcp/cli.ts`

---

### Gemini CLI / Agent

Add to `~/.gemini/mcp_servers.json`:

```json
{
"mcpServers": {
"twinagent-os": {
"command": "npx",
"args": ["-y", "tsx", "/Users/sunilprasad/richelle/TwinAgent OS/src/mcp/cli.ts"]
}
}
}
```

---

## 2. Production Build & Launch Commands

### Development Mode:
```bash
npm run mcp:start
```

### Production Mode:
```bash
npm run build
node dist/mcp/cli.js
```

### Automated Compatibility Validation:
```bash
npm run validate:mcp
```
Loading