@cliniq360/eigi-mcp 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. package/README.md +718 -0
  2. package/dist/main.d.ts +5 -0
  3. package/dist/main.d.ts.map +1 -0
  4. package/dist/main.js +119 -0
  5. package/dist/server.d.ts +3 -0
  6. package/dist/server.d.ts.map +1 -0
  7. package/dist/server.js +42 -0
  8. package/dist/src/api/client.d.ts +10 -0
  9. package/dist/src/api/client.d.ts.map +1 -0
  10. package/dist/src/api/client.js +36 -0
  11. package/dist/src/api/index.d.ts +3 -0
  12. package/dist/src/api/index.d.ts.map +1 -0
  13. package/dist/src/api/index.js +1 -0
  14. package/dist/src/config/constants.d.ts +29 -0
  15. package/dist/src/config/constants.d.ts.map +1 -0
  16. package/dist/src/config/constants.js +54 -0
  17. package/dist/src/config/index.d.ts +2 -0
  18. package/dist/src/config/index.d.ts.map +1 -0
  19. package/dist/src/config/index.js +1 -0
  20. package/dist/src/lib/utils.d.ts +7 -0
  21. package/dist/src/lib/utils.d.ts.map +1 -0
  22. package/dist/src/lib/utils.js +9 -0
  23. package/dist/src/resources/agents.d.ts +6 -0
  24. package/dist/src/resources/agents.d.ts.map +1 -0
  25. package/dist/src/resources/agents.js +16 -0
  26. package/dist/src/resources/conversation-detail.d.ts +6 -0
  27. package/dist/src/resources/conversation-detail.d.ts.map +1 -0
  28. package/dist/src/resources/conversation-detail.js +16 -0
  29. package/dist/src/resources/conversations-list.d.ts +6 -0
  30. package/dist/src/resources/conversations-list.d.ts.map +1 -0
  31. package/dist/src/resources/conversations-list.js +16 -0
  32. package/dist/src/resources/conversations.d.ts +6 -0
  33. package/dist/src/resources/conversations.d.ts.map +1 -0
  34. package/dist/src/resources/conversations.js +16 -0
  35. package/dist/src/resources/index.d.ts +6 -0
  36. package/dist/src/resources/index.d.ts.map +1 -0
  37. package/dist/src/resources/index.js +6 -0
  38. package/dist/src/resources/interactive-agent.d.ts +6 -0
  39. package/dist/src/resources/interactive-agent.d.ts.map +1 -0
  40. package/dist/src/resources/interactive-agent.js +16 -0
  41. package/dist/src/tools/agents.d.ts +7 -0
  42. package/dist/src/tools/agents.d.ts.map +1 -0
  43. package/dist/src/tools/agents.js +474 -0
  44. package/dist/src/tools/base.d.ts +22 -0
  45. package/dist/src/tools/base.d.ts.map +1 -0
  46. package/dist/src/tools/base.js +26 -0
  47. package/dist/src/tools/calls.d.ts +7 -0
  48. package/dist/src/tools/calls.d.ts.map +1 -0
  49. package/dist/src/tools/calls.js +136 -0
  50. package/dist/src/tools/chat.d.ts +7 -0
  51. package/dist/src/tools/chat.d.ts.map +1 -0
  52. package/dist/src/tools/chat.js +88 -0
  53. package/dist/src/tools/conversations.d.ts +7 -0
  54. package/dist/src/tools/conversations.d.ts.map +1 -0
  55. package/dist/src/tools/conversations.js +87 -0
  56. package/dist/src/tools/index.d.ts +9 -0
  57. package/dist/src/tools/index.d.ts.map +1 -0
  58. package/dist/src/tools/index.js +9 -0
  59. package/dist/src/tools/interactive-agent.d.ts +7 -0
  60. package/dist/src/tools/interactive-agent.d.ts.map +1 -0
  61. package/dist/src/tools/interactive-agent.js +25 -0
  62. package/dist/src/tools/prompts.d.ts +7 -0
  63. package/dist/src/tools/prompts.d.ts.map +1 -0
  64. package/dist/src/tools/prompts.js +140 -0
  65. package/dist/src/tools/providers.d.ts +7 -0
  66. package/dist/src/tools/providers.d.ts.map +1 -0
  67. package/dist/src/tools/providers.js +69 -0
  68. package/dist/src/types/agent.d.ts +29 -0
  69. package/dist/src/types/agent.d.ts.map +1 -0
  70. package/dist/src/types/agent.js +4 -0
  71. package/dist/src/types/api.d.ts +20 -0
  72. package/dist/src/types/api.d.ts.map +1 -0
  73. package/dist/src/types/api.js +4 -0
  74. package/dist/src/types/calls.d.ts +18 -0
  75. package/dist/src/types/calls.d.ts.map +1 -0
  76. package/dist/src/types/calls.js +4 -0
  77. package/dist/src/types/chat-session.d.ts +52 -0
  78. package/dist/src/types/chat-session.d.ts.map +1 -0
  79. package/dist/src/types/chat-session.js +1 -0
  80. package/dist/src/types/conversation.d.ts +105 -0
  81. package/dist/src/types/conversation.d.ts.map +1 -0
  82. package/dist/src/types/conversation.js +1 -0
  83. package/dist/src/types/index.d.ts +6 -0
  84. package/dist/src/types/index.d.ts.map +1 -0
  85. package/dist/src/types/index.js +6 -0
  86. package/dist/src/utils/logger.d.ts +8 -0
  87. package/dist/src/utils/logger.d.ts.map +1 -0
  88. package/dist/src/utils/logger.js +41 -0
  89. package/package.json +75 -0
package/README.md ADDED
@@ -0,0 +1,718 @@
1
+ # eigi.ai MCP Server
2
+
3
+ [![MCP Registry](https://img.shields.io/badge/MCP-Registry-blue)](https://github.com/modelcontextprotocol/registry)
4
+ [![npm version](https://img.shields.io/npm/v/@cliniq360/eigi-mcp)](https://www.npmjs.com/package/@cliniq360/eigi-mcp)
5
+
6
+ MCP (Model Context Protocol) server for [eigi.ai](https://eigi.ai) - enabling AI-native integration with your AI voice and chat agents through Claude Desktop and other MCP-compatible clients.
7
+
8
+ ## Table of Contents
9
+
10
+ - [Quick Start](#quick-start)
11
+ - [Installation Options](#installation-options)
12
+ - [MCP Registry](#mcp-registry)
13
+ - [Configuration](#configuration)
14
+ - [Claude Desktop Setup](#claude-desktop-setup)
15
+ - [Commands](#commands)
16
+ - [API Endpoints](#api-endpoints)
17
+ - [MCP Tools Reference](#mcp-tools-reference)
18
+ - [MCP Resources (UI)](#mcp-resources-ui)
19
+ - [Project Structure](#project-structure)
20
+ - [Docker](#docker)
21
+ - [Authentication](#authentication)
22
+ - [Publishing](#publishing)
23
+
24
+ ## Features
25
+
26
+ - **20+ MCP Tools** for managing agents, conversations, calls, chats, and prompts
27
+ - **5 UI Resources** for rich interactive experiences
28
+ - **Real-time Voice Testing** via Pipecat AI integration
29
+ - **Dual Transport Support** - Remote (HTTP) and Local (stdio) modes
30
+ - **Hot-reload Development** with Vite and tsx watchers
31
+ - **TypeScript** for type safety
32
+ - **Tailwind CSS 4** for modern UI styling
33
+
34
+ ## Quick Start
35
+
36
+ ### Get Your API Key
37
+
38
+ 1. Sign up at [eigi.ai](https://eigi.ai)
39
+ 2. Navigate to Settings → API Keys
40
+ 3. Generate a new API key
41
+
42
+ ### Connect via Remote Server (Fastest)
43
+
44
+ Add to your Claude Desktop config - no installation required:
45
+
46
+ ```json
47
+ {
48
+ "mcpServers": {
49
+ "eigi": {
50
+ "url": "https://mcp.eigi.ai/mcp",
51
+ "transport": "streamable-http",
52
+ "headers": {
53
+ "X-API-Key": "YOUR_EIGI_API_KEY"
54
+ }
55
+ }
56
+ }
57
+ }
58
+ ```
59
+
60
+ ---
61
+
62
+ ## Installation Options
63
+
64
+ ### Option 1: Remote Server (Recommended)
65
+
66
+ Connect directly to the hosted eigi.ai MCP server. **No installation required.**
67
+
68
+ **Supported authentication methods:**
69
+ - Header: `X-API-Key: YOUR_KEY`
70
+ - Header: `Authorization: Bearer YOUR_KEY`
71
+ - Query parameter: `?api_key=YOUR_KEY`
72
+
73
+ ### Option 2: Local via npm
74
+
75
+ Install and run locally:
76
+
77
+ ```bash
78
+ # Using npx (no install)
79
+ EIGI_API_KEY=your-key npx @cliniq360/eigi-mcp --stdio
80
+
81
+ # Or install globally
82
+ npm install -g @cliniq360/eigi-mcp
83
+ EIGI_API_KEY=your-key eigi-mcp --stdio
84
+ ```
85
+
86
+ ### Option 3: From Source (Development)
87
+
88
+ ```bash
89
+ # Clone the repository
90
+ git clone https://github.com/eigi-ai/eigi-mcp.git
91
+ cd eigi-mcp/eigi-app
92
+
93
+ # Install dependencies
94
+ npm install
95
+
96
+ # Copy environment file
97
+ cp .env.example .env
98
+
99
+ # Run development server
100
+ npm run dev
101
+ ```
102
+
103
+ ---
104
+
105
+ ## MCP Registry
106
+
107
+ This server is published to the [MCP Registry](https://github.com/modelcontextprotocol/registry) as:
108
+
109
+ ```
110
+ io.github.eigi-ai/eigi
111
+ ```
112
+
113
+ | Mode | Transport | Endpoint |
114
+ |------|-----------|----------|
115
+ | **Remote** | streamable-http | `https://mcp.eigi.ai/mcp` |
116
+ | **Local** | stdio | `npx @cliniq360/eigi-mcp --stdio` |
117
+
118
+ ---
119
+
120
+ ## Claude Desktop Setup
121
+
122
+ ### Remote Mode (Recommended)
123
+
124
+ No installation needed. Edit `claude_desktop_config.json`:
125
+
126
+ **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
127
+ **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
128
+
129
+ ```json
130
+ {
131
+ "mcpServers": {
132
+ "eigi": {
133
+ "url": "https://mcp.eigi.ai/mcp",
134
+ "transport": "streamable-http",
135
+ "headers": {
136
+ "X-API-Key": "YOUR_EIGI_API_KEY"
137
+ }
138
+ }
139
+ }
140
+ }
141
+ ```
142
+
143
+ ### Local Mode (stdio)
144
+
145
+ For offline use or custom deployments:
146
+
147
+ ```json
148
+ {
149
+ "mcpServers": {
150
+ "eigi": {
151
+ "command": "npx",
152
+ "args": ["-y", "@cliniq360/eigi-mcp", "--stdio"],
153
+ "env": {
154
+ "EIGI_API_KEY": "YOUR_EIGI_API_KEY"
155
+ }
156
+ }
157
+ }
158
+ }
159
+ ```
160
+
161
+ ---
162
+
163
+ ## Configuration
164
+
165
+ ### Environment Variables
166
+
167
+ | Variable | Description | Default | Required |
168
+ |----------|-------------|---------|----------|
169
+ | `EIGI_API_KEY` | Your eigi.ai API key | - | **Yes** (stdio mode) |
170
+ | `EIGI_API_BASE_URL` | Backend API URL | `https://prod.eigi.ai` | No |
171
+ | `VITE_EIGI_API_BASE_URL` | API URL for browser builds | `https://prod.eigi.ai` | No |
172
+ | `PORT` | Server port (HTTP mode) | `3001` | No |
173
+
174
+ ### Environment File (Development)
175
+
176
+ ```bash
177
+ cp .env.example .env
178
+ ```
179
+
180
+ ```env
181
+ # Your eigi.ai API key (required for stdio mode)
182
+ EIGI_API_KEY=your-api-key-here
183
+
184
+ # API Base URL
185
+ EIGI_API_BASE_URL=https://prod.eigi.ai
186
+
187
+ # Browser builds
188
+ VITE_EIGI_API_BASE_URL=https://prod.eigi.ai
189
+
190
+ # MCP Server Port
191
+ PORT=3001
192
+ ```
193
+
194
+ ---
195
+
196
+ ## Commands
197
+
198
+ ### Quick Reference
199
+
200
+ | Command | Description |
201
+ |---------|-------------|
202
+ | `npm install` | Install dependencies |
203
+ | `npm run dev` | Development mode with hot-reload |
204
+ | `npm run build` | Build for production (HTTP server) |
205
+ | `npm run build:npm` | Build for npm package (stdio) |
206
+ | `npm run serve` | Start HTTP server |
207
+ | `npm run serve:stdio` | Start stdio server |
208
+ | `npm run start` | Build + serve HTTP |
209
+ | `npm run start:stdio` | Build + serve stdio |
210
+
211
+ ### Helper Script
212
+
213
+ ```bash
214
+ # Make executable
215
+ chmod +x start.sh
216
+
217
+ # Run commands
218
+ ./start.sh dev # Development mode
219
+ ./start.sh stdio # stdio mode
220
+ ./start.sh http # HTTP server mode
221
+ ./start.sh build # Production build
222
+ ```
223
+
224
+ ### Detailed Command Reference
225
+
226
+ #### `npm run dev` - Development Mode
227
+
228
+ Starts the development server with hot-reload. Runs **6 concurrent processes**:
229
+
230
+ ```bash
231
+ npm run dev
232
+
233
+ # What it runs:
234
+ # 1. vite build --watch (conversations-app.html)
235
+ # 2. vite build --watch (conversations-list-app.html)
236
+ # 3. vite build --watch (conversation-detail-app.html)
237
+ # 4. vite build --watch (agents-app-v2.html)
238
+ # 5. vite build --watch (interactive-agent-v2.html)
239
+ # 6. tsx --watch main.ts (server with hot-reload)
240
+ ```
241
+
242
+ **Output:**
243
+
244
+ - Server runs at `http://localhost:3001`
245
+ - MCP endpoint at `http://localhost:3001/mcp`
246
+ - All file changes trigger automatic rebuild
247
+
248
+ #### `npm run build` - Production Build
249
+
250
+ Compiles TypeScript and builds all UI apps:
251
+
252
+ ```bash
253
+ npm run build
254
+
255
+ # What it does:
256
+ # 1. tsc --noEmit (TypeScript type checking only)
257
+ # 2. Builds conversations-app.html → dist/
258
+ # 3. Builds conversations-list-app.html → dist/
259
+ # 4. Builds conversation-detail-app.html → dist/
260
+ # 5. Builds agents-app-v2.html → dist/
261
+ # 6. Builds interactive-agent-v2.html → dist/
262
+ ```
263
+
264
+ **Output:**
265
+
266
+ - Creates `dist/` folder with compiled assets
267
+ - Each HTML page becomes a single-file bundle (via vite-plugin-singlefile)
268
+
269
+ #### `npm run build:npm` - Build for npm Package
270
+
271
+ Compiles server-side code for stdio mode (npm package):
272
+
273
+ ```bash
274
+ npm run build:npm
275
+
276
+ # What it does:
277
+ # 1. Compiles TypeScript using tsconfig.build.json
278
+ # 2. Outputs to dist/ (server code only, no UI)
279
+ ```
280
+
281
+ #### `npm run serve:stdio` - stdio Mode
282
+
283
+ Runs the MCP server in stdio mode (for local MCP clients):
284
+
285
+ ```bash
286
+ npm run serve:stdio
287
+
288
+ # Or with environment variable:
289
+ EIGI_API_KEY=your-key npm run serve:stdio
290
+ ```
291
+
292
+ #### `npm run serve` - Start Server
293
+
294
+ Starts the MCP server in production mode:
295
+
296
+ ```bash
297
+ npm run serve
298
+
299
+ # What it runs:
300
+ # tsx main.ts
301
+ ```
302
+
303
+ **Note:** Requires `npm run build` to be run first.
304
+
305
+ #### `npm run start` - Full Production Start
306
+
307
+ Builds and then starts the server:
308
+
309
+ ```bash
310
+ npm run start
311
+
312
+ # Equivalent to:
313
+ # npm run build && npm run serve
314
+ ```
315
+
316
+ ---
317
+
318
+ ## Usage Examples
319
+
320
+ ### Starting Development
321
+
322
+ ```bash
323
+ # 1. Install dependencies (first time only)
324
+ npm install
325
+
326
+ # 2. Configure environment
327
+ cp .env.example .env
328
+ # Edit .env with your API URL
329
+
330
+ # 3. Start development server
331
+ npm run dev
332
+
333
+ # Server is now running at http://localhost:3001
334
+ # MCP endpoint: http://localhost:3001/mcp
335
+ ```
336
+
337
+ ### Production Deployment
338
+
339
+ ```bash
340
+ # 1. Build production assets
341
+ npm run build
342
+
343
+ # 2. Start server
344
+ npm run serve
345
+
346
+ # Or do both in one command
347
+ npm run start
348
+ ```
349
+
350
+ ### Testing MCP Endpoint
351
+
352
+ ```bash
353
+ # Health check
354
+ curl http://localhost:3001/health
355
+ # Response: {"status":"ok"}
356
+
357
+ # Welcome endpoint
358
+ curl http://localhost:3001/
359
+ # Response: Welcome to eigi.ai MCP
360
+
361
+ # MCP endpoint (requires proper JSON-RPC request)
362
+ curl -X POST http://localhost:3001/mcp \
363
+ -H "Content-Type: application/json" \
364
+ -H "Authorization: Bearer YOUR_API_KEY" \
365
+ -d '{"jsonrpc":"2.0","method":"tools/list","id":1}'
366
+ ```
367
+
368
+ ---
369
+
370
+ ## API Endpoints
371
+
372
+ | Endpoint | Method | Description |
373
+ | --------- | ------ | ------------------------------------------ |
374
+ | `/` | GET | Welcome message (`Welcome to eigi.ai MCP`) |
375
+ | `/health` | GET | Health check (`{"status": "ok"}`) |
376
+ | `/mcp` | ALL | MCP protocol endpoint (JSON-RPC 2.0) |
377
+ | `/log` | POST | Browser logging endpoint |
378
+
379
+ ### Health Check Example
380
+
381
+ ```bash
382
+ curl http://localhost:3001/health
383
+ ```
384
+
385
+ Response:
386
+
387
+ ```json
388
+ { "status": "ok" }
389
+ ```
390
+
391
+ ---
392
+
393
+ ## MCP Tools Reference
394
+
395
+ ### Conversations
396
+
397
+ | Tool | Description |
398
+ | -------------------- | ----------------------------------------------------------------------------------- |
399
+ | `list-conversations` | List voice and chat conversations with filters (page, status, date range, agent_id) |
400
+ | `get-conversation` | Get full conversation details including transcript and analysis |
401
+
402
+ ### Agents
403
+
404
+ | Tool | Description |
405
+ | ------------------ | --------------------------------------------------- |
406
+ | `list-agents` | List AI voice agents with pagination |
407
+ | `get-agent` | Get agent details and configuration by ID |
408
+ | `create-agent` | Create a new AI voice agent with STT/LLM/TTS config |
409
+ | `update-agent` | Update an existing agent's settings |
410
+ | `delete-agent` | Delete an agent by ID |
411
+ | `test-voice-agent` | Open interactive UI to test an agent in real-time |
412
+
413
+ ### Calls
414
+
415
+ | Tool | Description |
416
+ | ------------------------ | ------------------------------------------------- |
417
+ | `initiate-outbound-call` | Initiate an outbound voice call using an AI agent |
418
+ | `get-mobile-numbers` | Get available mobile numbers for agents |
419
+
420
+ ### Chat
421
+
422
+ | Tool | Description |
423
+ | ------------------------- | ---------------------------------------------- |
424
+ | `list-chat-sessions` | List text chat sessions with pagination |
425
+ | `get-chat-session` | Get complete chat session with all messages |
426
+ | `send-chat-message` | Send a message to an AI agent and get response |
427
+ | `get-agent-first-message` | Get agent's greeting/intro message |
428
+
429
+ ### Prompts
430
+
431
+ | Tool | Description |
432
+ | --------------------- | ------------------------------------------------- |
433
+ | `list-prompts` | List prompts with pagination |
434
+ | `get-prompt` | Get a prompt by name (latest or specific version) |
435
+ | `get-prompt-versions` | Get version history for a prompt |
436
+ | `create-prompt` | Create a new prompt (or new version if exists) |
437
+ | `update-prompt` | Update an existing prompt |
438
+
439
+ ### Providers
440
+
441
+ | Tool | Description |
442
+ | ---------------- | --------------------------------------------------------------------- |
443
+ | `list-providers` | List available LLM, TTS, and STT providers with their models |
444
+ | `list-voices` | List available voices for a TTS provider (CARTESIA, ELEVENLABS, etc.) |
445
+
446
+ ---
447
+
448
+ ## MCP Resources (UI)
449
+
450
+ Rich UI resources for enhanced interaction within MCP clients:
451
+
452
+ | Resource URI | Description |
453
+ | ------------------------------------------------------- | ----------------------------------- |
454
+ | `ui://conversations/conversations-app.html` | Main conversations dashboard |
455
+ | `ui://conversations-list/conversations-list-app.html` | Conversations list view |
456
+ | `ui://conversation-detail/conversation-detail-app.html` | Conversation detail with transcript |
457
+ | `ui://agents/agents-app-v2.html` | Agents management interface |
458
+ | `ui://interactive-agent/interactive-agent-v2.html` | Interactive agent testing widget |
459
+
460
+ ---
461
+
462
+ ## Project Structure
463
+
464
+ ```
465
+ eigi-app/
466
+ ├── main.ts # Server entry point (Express + MCP)
467
+ ├── server.ts # MCP server configuration and tool registration
468
+ ├── package.json # Dependencies and npm scripts
469
+ ├── tsconfig.json # TypeScript configuration
470
+ ├── vite.config.ts # Vite build configuration
471
+ ├── Dockerfile # Docker image definition
472
+ ├── .env.example # Environment template
473
+
474
+ ├── pages/ # HTML entry points for UI apps
475
+ │ ├── agents-app-v2.html
476
+ │ ├── conversations-app.html
477
+ │ ├── conversations-list-app.html
478
+ │ ├── conversation-detail-app.html
479
+ │ └── interactive-agent-v2.html
480
+
481
+ ├── dist/ # Built output (generated by npm run build)
482
+
483
+ └── src/
484
+ ├── index.ts # Main exports
485
+ ├── global.css # Global styles
486
+
487
+ ├── api/ # API client for eigi.ai backend
488
+ │ ├── client.ts # HTTP client with auth handling
489
+ │ └── index.ts
490
+
491
+ ├── apps/ # React application entry points
492
+ │ ├── agents-app.tsx
493
+ │ ├── conversations-app.tsx
494
+ │ ├── conversations-list-app.tsx
495
+ │ ├── conversation-detail-app.tsx
496
+ │ └── interactive-agent-app.tsx
497
+
498
+ ├── components/ # Shared React components
499
+ │ ├── VoiceCallDialog.tsx
500
+ │ ├── VoiceCallUI.tsx
501
+ │ ├── VoiceCallUI.module.css
502
+ │ └── ui/ # UI primitives
503
+ │ ├── avatar.tsx
504
+ │ ├── badge.tsx
505
+ │ ├── button.tsx
506
+ │ ├── card.tsx
507
+ │ └── index.ts
508
+
509
+ ├── config/ # Configuration constants
510
+ │ ├── constants.ts # API URLs, resource URIs, enums
511
+ │ └── index.ts
512
+
513
+ ├── lib/ # Utility functions
514
+ │ └── utils.ts # cn() for class merging
515
+
516
+ ├── resources/ # MCP resource registrations
517
+ │ ├── agents.ts
518
+ │ ├── conversations.ts
519
+ │ ├── conversations-list.ts
520
+ │ ├── conversation-detail.ts
521
+ │ ├── interactive-agent.ts
522
+ │ └── index.ts
523
+
524
+ ├── tools/ # MCP tool implementations
525
+ │ ├── agents.ts # Agent CRUD tools
526
+ │ ├── calls.ts # Outbound call tools
527
+ │ ├── chat.ts # Chat session tools
528
+ │ ├── conversations.ts # Conversation list/detail tools
529
+ │ ├── interactive-agent.ts
530
+ │ ├── prompts.ts # Prompt management tools
531
+ │ ├── providers.ts # Provider/voice listing tools
532
+ │ ├── base.ts # Shared utilities
533
+ │ └── index.ts
534
+
535
+ ├── types/ # TypeScript type definitions
536
+ │ ├── agent.ts
537
+ │ ├── api.ts
538
+ │ ├── calls.ts
539
+ │ ├── chat-session.ts
540
+ │ ├── conversation.ts
541
+ │ └── index.ts
542
+
543
+ └── utils/ # Logging utilities
544
+ ├── browser-logger.ts # Browser-side logging
545
+ └── logger.ts # Server-side logging
546
+ ```
547
+
548
+ ---
549
+
550
+ ## Docker
551
+
552
+ ### Build and Run
553
+
554
+ ```bash
555
+ # Build Docker image
556
+ docker build -t eigi-app .
557
+
558
+ # Build with custom API URL
559
+ docker build \
560
+ --build-arg VITE_EIGI_API_BASE_URL=https://prod.eigi.ai \
561
+ -t eigi-app .
562
+
563
+ # Run container
564
+ docker run -p 7500:7500 --env-file .env eigi-app
565
+
566
+ # Run with environment variables inline
567
+ docker run -p 7500:7500 \
568
+ -e EIGI_API_BASE_URL=https://prod.eigi.ai \
569
+ -e PORT=7500 \
570
+ eigi-app
571
+ ```
572
+
573
+ ### Dockerfile Overview
574
+
575
+ ```dockerfile
576
+ FROM node:20-alpine
577
+ WORKDIR /app
578
+
579
+ # Build arg for Vite (embedded at build time)
580
+ ARG VITE_EIGI_API_BASE_URL=https://prod.qa.eigi.ai
581
+ ENV VITE_EIGI_API_BASE_URL=$VITE_EIGI_API_BASE_URL
582
+
583
+ COPY package*.json .
584
+ RUN npm install
585
+ COPY . .
586
+ RUN npm run build
587
+ EXPOSE 7500
588
+ CMD ["npm", "run", "serve"]
589
+ ```
590
+
591
+ ---
592
+
593
+ ## Authentication
594
+
595
+ ### Remote Mode (HTTP)
596
+
597
+ The MCP server extracts API keys from requests in the following priority order:
598
+
599
+ 1. **Authorization Header**: `Authorization: Bearer <token>`
600
+ 2. **X-API-Key Header**: `X-API-Key: <token>`
601
+ 3. **Query Parameter**: `?api_key=<token>`
602
+
603
+ ### Local Mode (stdio)
604
+
605
+ API key is passed via environment variable:
606
+
607
+ ```bash
608
+ EIGI_API_KEY=your-key npx @cliniq360/eigi-mcp --stdio
609
+ ```
610
+
611
+ Or in Claude Desktop config:
612
+ ```json
613
+ {
614
+ "env": {
615
+ "EIGI_API_KEY": "your-key"
616
+ }
617
+ }
618
+ ```
619
+
620
+ ### Example Requests (HTTP)
621
+
622
+ ```bash
623
+ # Using Authorization header (recommended)
624
+ curl -X POST http://localhost:3001/mcp \
625
+ -H "Authorization: Bearer your-api-key-here" \
626
+ -H "Content-Type: application/json" \
627
+ -d '{"jsonrpc":"2.0","method":"tools/list","id":1}'
628
+
629
+ # Using X-API-Key header
630
+ curl -X POST http://localhost:3001/mcp \
631
+ -H "X-API-Key: your-api-key-here" \
632
+ -H "Content-Type: application/json" \
633
+ -d '{"jsonrpc":"2.0","method":"tools/list","id":1}'
634
+
635
+ # Using query parameter
636
+ curl -X POST "http://localhost:3001/mcp?api_key=your-api-key-here" \
637
+ -H "Content-Type: application/json" \
638
+ -d '{"jsonrpc":"2.0","method":"tools/list","id":1}'
639
+ ```
640
+
641
+ ---
642
+
643
+ ## Tech Stack
644
+
645
+ | Category | Technology | Version |
646
+ | -------------- | ------------------------- | ------- |
647
+ | **Runtime** | Node.js | 20+ |
648
+ | **Server** | Express.js | 5.x |
649
+ | **MCP SDK** | @modelcontextprotocol/sdk | 1.24+ |
650
+ | **Frontend** | React | 19.x |
651
+ | **Build Tool** | Vite | 6.x |
652
+ | **Styling** | Tailwind CSS | 4.x |
653
+ | **Voice** | Pipecat AI + Daily | 1.x |
654
+ | **Validation** | Zod | 4.x |
655
+ | **Language** | TypeScript | 5.9+ |
656
+
657
+ ---
658
+
659
+ ## Publishing
660
+
661
+ ### npm Package
662
+
663
+ The package is published as `@cliniq360/eigi-mcp` via GitHub Actions.
664
+
665
+ **Automated Publishing:**
666
+ 1. Update version in `package.json`
667
+ 2. Commit changes
668
+ 3. Create a git tag: `git tag v1.0.0`
669
+ 4. Push tag: `git push origin v1.0.0`
670
+ 5. GitHub Actions automatically publishes to npm
671
+
672
+ **Manual Publishing (if needed):**
673
+ ```bash
674
+ # Build for npm
675
+ npm run build:npm
676
+
677
+ # Publish (requires npm auth)
678
+ npm publish --access public
679
+ ```
680
+
681
+ ### MCP Registry
682
+
683
+ The server is registered with:
684
+ - **Registry Name**: `io.github.eigi-ai/eigi`
685
+ - **npm Package**: `@cliniq360/eigi-mcp`
686
+
687
+ Configuration is in `server.json`:
688
+ ```json
689
+ {
690
+ "mcpName": "io.github.eigi-ai/eigi",
691
+ "remotes": {
692
+ "streamable-http": {
693
+ "transportType": "streamable-http",
694
+ "url": "https://mcp.eigi.ai/mcp"
695
+ }
696
+ },
697
+ "packages": {
698
+ "npm": {
699
+ "name": "@cliniq360/eigi-mcp",
700
+ "transportType": "stdio"
701
+ }
702
+ }
703
+ }
704
+ ```
705
+
706
+ ### GitHub Actions Workflow
707
+
708
+ The `.github/workflows/publish-mcp.yml` workflow:
709
+ - Triggers on `v*` tags
710
+ - Uses OIDC for npm provenance
711
+ - Builds and publishes to npm registry
712
+ - Adds to MCP Registry automatically
713
+
714
+ ---
715
+
716
+ ## License
717
+
718
+ Proprietary - © ClinIQ360
package/dist/main.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ import "dotenv/config";
2
+ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
3
+ export declare function startStreamableHTTPServer(factory: (apiKey?: string) => McpServer): Promise<void>;
4
+ export declare function startStdioServer(factory: (apiKey?: string) => McpServer): Promise<void>;
5
+ //# sourceMappingURL=main.d.ts.map