@meetbot/mcp 1.0.4 → 1.1.1
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.
- package/LICENSE +1 -1
- package/README.md +137 -12
- package/dist/__tests__/meetbot-client.test.d.ts +2 -0
- package/dist/__tests__/meetbot-client.test.d.ts.map +1 -0
- package/dist/__tests__/meetbot-client.test.js +172 -0
- package/dist/__tests__/meetbot-client.test.js.map +1 -0
- package/dist/__tests__/types.test.d.ts +2 -0
- package/dist/__tests__/types.test.d.ts.map +1 -0
- package/dist/__tests__/types.test.js +109 -0
- package/dist/__tests__/types.test.js.map +1 -0
- package/dist/cli-http.d.ts +3 -0
- package/dist/cli-http.d.ts.map +1 -0
- package/dist/cli-http.js +48 -0
- package/dist/cli-http.js.map +1 -0
- package/dist/cli.js +6 -8
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -21
- package/dist/index.js.map +1 -1
- package/dist/mcp-server-http.d.ts +26 -0
- package/dist/mcp-server-http.d.ts.map +1 -0
- package/dist/mcp-server-http.js +346 -0
- package/dist/mcp-server-http.js.map +1 -0
- package/dist/mcp-server.d.ts +1 -1
- package/dist/mcp-server.js +24 -28
- package/dist/mcp-server.js.map +1 -1
- package/dist/meetbot-client.d.ts +2 -2
- package/dist/meetbot-client.d.ts.map +1 -1
- package/dist/meetbot-client.js +10 -17
- package/dist/meetbot-client.js.map +1 -1
- package/dist/schemas.d.ts +1 -1
- package/dist/schemas.js +51 -54
- package/dist/schemas.js.map +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.js +2 -3
- package/dist/types.js.map +1 -1
- package/package.json +65 -62
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Meet.bot MCP (Model Context Protocol)
|
|
2
2
|
|
|
3
|
-
A Model Context Protocol (MCP) server for the
|
|
3
|
+
A Model Context Protocol (MCP) server for the Meet.bot Booking Page API, enabling AI assistants to interact with scheduling and booking functionality.
|
|
4
4
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
7
|
-
- **Complete API Coverage**: Implements all endpoints from the
|
|
7
|
+
- **Complete API Coverage**: Implements all endpoints from the Meet.bot Booking Page API v1
|
|
8
8
|
- **Type Safety**: Full TypeScript support with comprehensive type definitions
|
|
9
9
|
- **Runtime Validation**: Zod schemas for input validation and data integrity
|
|
10
10
|
- **Authentication Support**: Bearer token authentication
|
|
11
11
|
- **Error Handling**: Robust error handling with detailed error messages
|
|
12
12
|
- **Health Checks**: Built-in health monitoring using the /v1/pages endpoint
|
|
13
13
|
- **MCP Protocol Compliance**: Full Model Context Protocol server implementation
|
|
14
|
+
- **Dual Mode Support**: Run locally (stdio) or remotely (HTTP/SSE)
|
|
15
|
+
- **Production Deployed**: Live at https://meetbot-mcp-production.up.railway.app
|
|
14
16
|
- **Production Ready**: Thoroughly tested and validated for production use
|
|
15
17
|
|
|
16
18
|
## Installation
|
|
@@ -33,7 +35,7 @@ npm install -g @meetbot/mcp
|
|
|
33
35
|
|
|
34
36
|
### 2. Configure the MCP Server
|
|
35
37
|
|
|
36
|
-
Configure the
|
|
38
|
+
Configure the Meet.bot API client with your authentication token:
|
|
37
39
|
|
|
38
40
|
```typescript
|
|
39
41
|
// Configure with bearer token
|
|
@@ -91,6 +93,114 @@ await health_check();
|
|
|
91
93
|
// Verifies API connectivity using the /v1/pages endpoint
|
|
92
94
|
```
|
|
93
95
|
|
|
96
|
+
## Deployment Options
|
|
97
|
+
|
|
98
|
+
The MCP server can be run in two modes:
|
|
99
|
+
|
|
100
|
+
### 1. Local Mode (Stdio Transport)
|
|
101
|
+
|
|
102
|
+
For local integration with AI assistants like Claude Desktop. Uses stdio transport for communication.
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
# Run locally
|
|
106
|
+
npx @meetbot/mcp
|
|
107
|
+
|
|
108
|
+
# Or with environment variable
|
|
109
|
+
MEETBOT_AUTH_TOKEN="your_token" npx @meetbot/mcp
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### 2. HTTP Mode (SSE Transport)
|
|
113
|
+
|
|
114
|
+
For remote deployment with HTTP/SSE transport. This allows the MCP server to be accessed over the network.
|
|
115
|
+
|
|
116
|
+
#### Running the HTTP Server
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
# Build and start the HTTP server
|
|
120
|
+
npm run build
|
|
121
|
+
npm run start:http
|
|
122
|
+
|
|
123
|
+
# Or with custom port
|
|
124
|
+
PORT=8080 npm run start:http
|
|
125
|
+
|
|
126
|
+
# Or run directly with npx
|
|
127
|
+
npx meetbot-mcp-http
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
#### Server Endpoints
|
|
131
|
+
|
|
132
|
+
- **SSE Endpoint**: `GET /sse` - Establishes an SSE connection for MCP communication
|
|
133
|
+
- **Messages Endpoint**: `POST /messages?sessionId=<id>` - Receives client messages
|
|
134
|
+
- **Health Check**: `GET /health` - Server health status
|
|
135
|
+
|
|
136
|
+
#### Authentication
|
|
137
|
+
|
|
138
|
+
All requests require a Bearer token in the Authorization header:
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
Authorization: Bearer <your-meetbot-api-token>
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
The same token is used to authenticate with the Meet.bot API.
|
|
145
|
+
|
|
146
|
+
#### Testing the HTTP Server
|
|
147
|
+
|
|
148
|
+
**Local Testing:**
|
|
149
|
+
```bash
|
|
150
|
+
# Health check (should fail without auth)
|
|
151
|
+
curl http://localhost:3000/health
|
|
152
|
+
|
|
153
|
+
# Health check with authentication
|
|
154
|
+
curl -H "Authorization: Bearer YOUR_TOKEN" http://localhost:3000/health
|
|
155
|
+
|
|
156
|
+
# Connect to SSE endpoint
|
|
157
|
+
curl -N -H "Authorization: Bearer YOUR_TOKEN" http://localhost:3000/sse
|
|
158
|
+
|
|
159
|
+
# Or use the test script
|
|
160
|
+
./test-http-server.sh YOUR_TOKEN
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
**Production Testing:**
|
|
164
|
+
```bash
|
|
165
|
+
# Test the live Railway deployment
|
|
166
|
+
curl -H "Authorization: Bearer YOUR_TOKEN" \
|
|
167
|
+
https://meetbot-mcp-production.up.railway.app/health
|
|
168
|
+
|
|
169
|
+
# Expected response:
|
|
170
|
+
# {"status":"ok","service":"meetbot-mcp"}
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
#### Deployment
|
|
174
|
+
|
|
175
|
+
The HTTP server can be deployed to various platforms:
|
|
176
|
+
|
|
177
|
+
- **Railway**: `railway up` ✅ **Live at https://meetbot-mcp-production.up.railway.app**
|
|
178
|
+
- **Fly.io**: `fly launch && fly deploy`
|
|
179
|
+
- **Google Cloud Run**: Container-based deployment
|
|
180
|
+
- **AWS App Runner**: Container-based deployment
|
|
181
|
+
- **Any VPS**: Run with Node.js directly
|
|
182
|
+
|
|
183
|
+
**Example: Connecting to Production**
|
|
184
|
+
```bash
|
|
185
|
+
# Your MCP client should connect to:
|
|
186
|
+
# https://meetbot-mcp-production.up.railway.app/sse
|
|
187
|
+
|
|
188
|
+
# With Authorization header:
|
|
189
|
+
# Authorization: Bearer <your-meetbot-api-token>
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
Example Dockerfile:
|
|
193
|
+
|
|
194
|
+
```dockerfile
|
|
195
|
+
FROM node:18-alpine
|
|
196
|
+
WORKDIR /app
|
|
197
|
+
COPY package*.json ./
|
|
198
|
+
RUN npm ci --only=production
|
|
199
|
+
COPY dist ./dist
|
|
200
|
+
EXPOSE 3000
|
|
201
|
+
CMD ["node", "dist/cli-http.js"]
|
|
202
|
+
```
|
|
203
|
+
|
|
94
204
|
## MCP Integration
|
|
95
205
|
|
|
96
206
|
### Using with AI Assistants
|
|
@@ -128,11 +238,11 @@ The server exposes 6 tools for AI assistants:
|
|
|
128
238
|
|
|
129
239
|
The package has been thoroughly tested and validated:
|
|
130
240
|
|
|
131
|
-
✅ **MCP Protocol Compliance**: Full JSON-RPC 2.0 support
|
|
132
|
-
✅ **Tool Discovery**: All 6 tools properly exposed
|
|
133
|
-
✅ **Error Handling**: Graceful error responses
|
|
134
|
-
✅ **Type Safety**: Complete TypeScript support
|
|
135
|
-
✅ **Schema Validation**: Input validation with Zod
|
|
241
|
+
✅ **MCP Protocol Compliance**: Full JSON-RPC 2.0 support
|
|
242
|
+
✅ **Tool Discovery**: All 6 tools properly exposed
|
|
243
|
+
✅ **Error Handling**: Graceful error responses
|
|
244
|
+
✅ **Type Safety**: Complete TypeScript support
|
|
245
|
+
✅ **Schema Validation**: Input validation with Zod
|
|
136
246
|
✅ **Production Ready**: Tested with real MCP clients
|
|
137
247
|
|
|
138
248
|
### Package Statistics
|
|
@@ -305,7 +415,7 @@ The MCP server provides detailed error messages for common issues:
|
|
|
305
415
|
|
|
306
416
|
- **Configuration Errors**: Missing or invalid configuration parameters
|
|
307
417
|
- **Authentication Errors**: Invalid tokens
|
|
308
|
-
- **API Errors**: Detailed error messages from the
|
|
418
|
+
- **API Errors**: Detailed error messages from the Meet.bot API
|
|
309
419
|
- **Validation Errors**: Input validation failures with specific field errors
|
|
310
420
|
|
|
311
421
|
## Contributing
|
|
@@ -328,6 +438,21 @@ MIT License - see [LICENSE](LICENSE) file for details.
|
|
|
328
438
|
|
|
329
439
|
## Changelog
|
|
330
440
|
|
|
441
|
+
### 1.1.1
|
|
442
|
+
- **ES Module Fix**: Fixed ES module compatibility for Railway and other Node.js deployments
|
|
443
|
+
- **Import Extensions**: Added proper `.js` extensions to all relative imports
|
|
444
|
+
- **Live Deployment**: Successfully deployed to Railway at https://meetbot-mcp-production.up.railway.app
|
|
445
|
+
- **Production Validated**: Confirmed working in production environment
|
|
446
|
+
|
|
447
|
+
### 1.1.0
|
|
448
|
+
- **HTTP/SSE Transport**: Added HTTP server with SSE transport for remote deployment
|
|
449
|
+
- **Bearer Token Authentication**: Implemented authentication for HTTP endpoints
|
|
450
|
+
- **Multi-mode Support**: Can run as local stdio server or remote HTTP server
|
|
451
|
+
- **Deployment Ready**: Added Dockerfile and deployment configurations for Railway, Fly.io, etc.
|
|
452
|
+
- **Health Check Endpoint**: Added `/health` endpoint for monitoring
|
|
453
|
+
- **Session Management**: Proper session handling with transport cleanup
|
|
454
|
+
- **Production Ready**: Complete HTTP implementation with authentication and error handling
|
|
455
|
+
|
|
331
456
|
### 1.0.4
|
|
332
457
|
- **Fixed Health Check**: Now uses the real `/v1/pages` endpoint instead of a fake health endpoint
|
|
333
458
|
- **Updated Documentation**: Clarified health check implementation details
|
|
@@ -349,8 +474,8 @@ MIT License - see [LICENSE](LICENSE) file for details.
|
|
|
349
474
|
- **Testing Results**: Added validation and testing information
|
|
350
475
|
|
|
351
476
|
### 1.0.0
|
|
352
|
-
- **Initial release** - Production-ready MCP server for
|
|
353
|
-
- **Complete API coverage** - All
|
|
477
|
+
- **Initial release** - Production-ready MCP server for Meet.bot API
|
|
478
|
+
- **Complete API coverage** - All Meet.bot Booking Page API v1 endpoints
|
|
354
479
|
- **TypeScript support** - Full type safety with comprehensive definitions
|
|
355
480
|
- **Runtime validation** - Zod schemas for input validation and data integrity
|
|
356
481
|
- **MCP server implementation** - Full Model Context Protocol compliance
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meetbot-client.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/meetbot-client.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { MeetbotClient } from '../meetbot-client';
|
|
2
|
+
// Mock axios
|
|
3
|
+
jest.mock('axios');
|
|
4
|
+
const mockAxios = require('axios');
|
|
5
|
+
describe('MeetbotClient', () => {
|
|
6
|
+
let client;
|
|
7
|
+
const mockConfig = {
|
|
8
|
+
authToken: 'test-token',
|
|
9
|
+
};
|
|
10
|
+
beforeEach(() => {
|
|
11
|
+
jest.clearAllMocks();
|
|
12
|
+
mockAxios.create.mockReturnValue({
|
|
13
|
+
get: jest.fn(),
|
|
14
|
+
post: jest.fn(),
|
|
15
|
+
interceptors: {
|
|
16
|
+
request: { use: jest.fn() },
|
|
17
|
+
response: { use: jest.fn() },
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
describe('constructor', () => {
|
|
22
|
+
it('should create client with valid config', () => {
|
|
23
|
+
expect(() => new MeetbotClient(mockConfig)).not.toThrow();
|
|
24
|
+
});
|
|
25
|
+
it('should create axios instance with correct baseURL', () => {
|
|
26
|
+
new MeetbotClient(mockConfig);
|
|
27
|
+
expect(mockAxios.create).toHaveBeenCalledWith(expect.objectContaining({
|
|
28
|
+
baseURL: 'https://meet.bot',
|
|
29
|
+
timeout: 30000,
|
|
30
|
+
}));
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
describe('getPages', () => {
|
|
34
|
+
beforeEach(() => {
|
|
35
|
+
client = new MeetbotClient(mockConfig);
|
|
36
|
+
});
|
|
37
|
+
it('should call correct endpoint', async () => {
|
|
38
|
+
const mockResponse = { data: { email: 'test@example.com', pages: [] } };
|
|
39
|
+
const mockGet = jest.fn().mockResolvedValue(mockResponse);
|
|
40
|
+
mockAxios.create.mockReturnValue({
|
|
41
|
+
get: mockGet,
|
|
42
|
+
post: jest.fn(),
|
|
43
|
+
interceptors: {
|
|
44
|
+
request: { use: jest.fn() },
|
|
45
|
+
response: { use: jest.fn() },
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
client = new MeetbotClient(mockConfig);
|
|
49
|
+
await client.getPages();
|
|
50
|
+
expect(mockGet).toHaveBeenCalledWith('/v1/pages');
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
describe('getPageInfo', () => {
|
|
54
|
+
beforeEach(() => {
|
|
55
|
+
client = new MeetbotClient(mockConfig);
|
|
56
|
+
});
|
|
57
|
+
it('should validate params before making request', () => {
|
|
58
|
+
const invalidParams = { page: 'not-a-url' };
|
|
59
|
+
expect(() => client.getPageInfo(invalidParams)).rejects.toThrow();
|
|
60
|
+
});
|
|
61
|
+
it('should call correct endpoint with params', async () => {
|
|
62
|
+
const mockResponse = {
|
|
63
|
+
data: {
|
|
64
|
+
title: 'Test Page',
|
|
65
|
+
duration: 30,
|
|
66
|
+
url: 'https://meet.bot/user/30min',
|
|
67
|
+
owner_name: 'John Doe',
|
|
68
|
+
max_days_into_the_future: 30,
|
|
69
|
+
},
|
|
70
|
+
};
|
|
71
|
+
const mockGet = jest.fn().mockResolvedValue(mockResponse);
|
|
72
|
+
mockAxios.create.mockReturnValue({
|
|
73
|
+
get: mockGet,
|
|
74
|
+
post: jest.fn(),
|
|
75
|
+
interceptors: {
|
|
76
|
+
request: { use: jest.fn() },
|
|
77
|
+
response: { use: jest.fn() },
|
|
78
|
+
},
|
|
79
|
+
});
|
|
80
|
+
client = new MeetbotClient(mockConfig);
|
|
81
|
+
const params = { page: 'https://meet.bot/user/30min' };
|
|
82
|
+
await client.getPageInfo(params);
|
|
83
|
+
expect(mockGet).toHaveBeenCalledWith('/v1/info', { params });
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
describe('getSlots', () => {
|
|
87
|
+
beforeEach(() => {
|
|
88
|
+
client = new MeetbotClient(mockConfig);
|
|
89
|
+
});
|
|
90
|
+
it('should validate params before making request', () => {
|
|
91
|
+
const invalidParams = { page: 'not-a-url' };
|
|
92
|
+
expect(() => client.getSlots(invalidParams)).rejects.toThrow();
|
|
93
|
+
});
|
|
94
|
+
it('should call correct endpoint with params', async () => {
|
|
95
|
+
const mockResponse = {
|
|
96
|
+
data: {
|
|
97
|
+
count: 1,
|
|
98
|
+
duration: 30,
|
|
99
|
+
slots: [{ start: '2025-01-15T14:00:00Z' }],
|
|
100
|
+
},
|
|
101
|
+
};
|
|
102
|
+
const mockGet = jest.fn().mockResolvedValue(mockResponse);
|
|
103
|
+
mockAxios.create.mockReturnValue({
|
|
104
|
+
get: mockGet,
|
|
105
|
+
post: jest.fn(),
|
|
106
|
+
interceptors: {
|
|
107
|
+
request: { use: jest.fn() },
|
|
108
|
+
response: { use: jest.fn() },
|
|
109
|
+
},
|
|
110
|
+
});
|
|
111
|
+
client = new MeetbotClient(mockConfig);
|
|
112
|
+
const params = { page: 'https://meet.bot/user/30min' };
|
|
113
|
+
await client.getSlots(params);
|
|
114
|
+
expect(mockGet).toHaveBeenCalledWith('/v1/slots', { params });
|
|
115
|
+
});
|
|
116
|
+
});
|
|
117
|
+
describe('bookSlot', () => {
|
|
118
|
+
beforeEach(() => {
|
|
119
|
+
client = new MeetbotClient(mockConfig);
|
|
120
|
+
});
|
|
121
|
+
it('should validate request before making API call', () => {
|
|
122
|
+
const invalidRequest = {
|
|
123
|
+
page: 'not-a-url',
|
|
124
|
+
guest_email: 'test@example.com',
|
|
125
|
+
guest_name: 'Test User',
|
|
126
|
+
start: '2025-01-15T14:00:00Z'
|
|
127
|
+
};
|
|
128
|
+
expect(() => client.bookSlot(invalidRequest)).rejects.toThrow();
|
|
129
|
+
});
|
|
130
|
+
it('should call correct endpoint with request body', async () => {
|
|
131
|
+
const mockResponse = {
|
|
132
|
+
data: {
|
|
133
|
+
success: true,
|
|
134
|
+
page: 'https://meet.bot/user/30min',
|
|
135
|
+
guest_email: 'guest@example.com',
|
|
136
|
+
guest_name: 'Jane Doe',
|
|
137
|
+
start: '2025-01-15T14:00:00Z',
|
|
138
|
+
ical_uid: 'abc123',
|
|
139
|
+
},
|
|
140
|
+
};
|
|
141
|
+
const mockPost = jest.fn().mockResolvedValue(mockResponse);
|
|
142
|
+
mockAxios.create.mockReturnValue({
|
|
143
|
+
get: jest.fn(),
|
|
144
|
+
post: mockPost,
|
|
145
|
+
interceptors: {
|
|
146
|
+
request: { use: jest.fn() },
|
|
147
|
+
response: { use: jest.fn() },
|
|
148
|
+
},
|
|
149
|
+
});
|
|
150
|
+
client = new MeetbotClient(mockConfig);
|
|
151
|
+
const request = {
|
|
152
|
+
page: 'https://meet.bot/user/30min',
|
|
153
|
+
guest_email: 'guest@example.com',
|
|
154
|
+
guest_name: 'Jane Doe',
|
|
155
|
+
start: '2025-01-15T14:00:00Z',
|
|
156
|
+
};
|
|
157
|
+
await client.bookSlot(request);
|
|
158
|
+
expect(mockPost).toHaveBeenCalledWith('/v1/book', request);
|
|
159
|
+
});
|
|
160
|
+
});
|
|
161
|
+
describe('getConfig', () => {
|
|
162
|
+
beforeEach(() => {
|
|
163
|
+
client = new MeetbotClient(mockConfig);
|
|
164
|
+
});
|
|
165
|
+
it('should return a copy of the configuration', () => {
|
|
166
|
+
const config = client.getConfig();
|
|
167
|
+
expect(config).toEqual(mockConfig);
|
|
168
|
+
expect(config).not.toBe(mockConfig); // Should be a copy, not reference
|
|
169
|
+
});
|
|
170
|
+
});
|
|
171
|
+
});
|
|
172
|
+
//# sourceMappingURL=meetbot-client.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meetbot-client.test.js","sourceRoot":"","sources":["../../src/__tests__/meetbot-client.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAGlD,aAAa;AACb,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AACnB,MAAM,SAAS,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;AAEnC,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;IAC7B,IAAI,MAAqB,CAAC;IAC1B,MAAM,UAAU,GAAkB;QAChC,SAAS,EAAE,YAAY;KACxB,CAAC;IAEF,UAAU,CAAC,GAAG,EAAE;QACd,IAAI,CAAC,aAAa,EAAE,CAAC;QACrB,SAAS,CAAC,MAAM,CAAC,eAAe,CAAC;YAC/B,GAAG,EAAE,IAAI,CAAC,EAAE,EAAE;YACd,IAAI,EAAE,IAAI,CAAC,EAAE,EAAE;YACf,YAAY,EAAE;gBACZ,OAAO,EAAE,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,EAAE,EAAE;gBAC3B,QAAQ,EAAE,EAAE,GAAG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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/types.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { BookSlotSchema, PageInfoSchema, GetSlotsParamsSchema, MeetbotConfigSchema, } from '../schemas';
|
|
2
|
+
describe('Meet.bot API Schemas', () => {
|
|
3
|
+
describe('BookSlotSchema', () => {
|
|
4
|
+
it('should validate a valid BookSlot', () => {
|
|
5
|
+
const validBookSlot = {
|
|
6
|
+
success: true,
|
|
7
|
+
page: 'https://meet.bot/user/30min',
|
|
8
|
+
guest_email: 'guest@example.com',
|
|
9
|
+
guest_name: 'Jane Doe',
|
|
10
|
+
notes: 'Meeting notes',
|
|
11
|
+
start: '2025-01-15T14:00:00Z',
|
|
12
|
+
ical_uid: 'abc123',
|
|
13
|
+
};
|
|
14
|
+
const result = BookSlotSchema.safeParse(validBookSlot);
|
|
15
|
+
expect(result.success).toBe(true);
|
|
16
|
+
});
|
|
17
|
+
it('should reject invalid email', () => {
|
|
18
|
+
const invalidBookSlot = {
|
|
19
|
+
success: true,
|
|
20
|
+
page: 'https://meet.bot/user/30min',
|
|
21
|
+
guest_email: 'invalid-email',
|
|
22
|
+
guest_name: 'Jane Doe',
|
|
23
|
+
start: '2025-01-15T14:00:00Z',
|
|
24
|
+
ical_uid: 'abc123',
|
|
25
|
+
};
|
|
26
|
+
const result = BookSlotSchema.safeParse(invalidBookSlot);
|
|
27
|
+
expect(result.success).toBe(false);
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
describe('PageInfoSchema', () => {
|
|
31
|
+
it('should validate a valid PageInfo', () => {
|
|
32
|
+
const validPageInfo = {
|
|
33
|
+
title: '30 Minute Meeting',
|
|
34
|
+
duration: 30,
|
|
35
|
+
url: 'https://meet.bot/user/30min',
|
|
36
|
+
owner_name: 'John Doe',
|
|
37
|
+
max_days_into_the_future: 30,
|
|
38
|
+
};
|
|
39
|
+
const result = PageInfoSchema.safeParse(validPageInfo);
|
|
40
|
+
expect(result.success).toBe(true);
|
|
41
|
+
});
|
|
42
|
+
it('should reject negative duration', () => {
|
|
43
|
+
const invalidPageInfo = {
|
|
44
|
+
title: '30 Minute Meeting',
|
|
45
|
+
duration: -30,
|
|
46
|
+
url: 'https://meet.bot/user/30min',
|
|
47
|
+
owner_name: 'John Doe',
|
|
48
|
+
max_days_into_the_future: 30,
|
|
49
|
+
};
|
|
50
|
+
const result = PageInfoSchema.safeParse(invalidPageInfo);
|
|
51
|
+
expect(result.success).toBe(false);
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
describe('MeetbotConfigSchema', () => {
|
|
55
|
+
it('should validate valid config with baseUrl only', () => {
|
|
56
|
+
const validConfig = {
|
|
57
|
+
baseUrl: 'https://api.meet.bot',
|
|
58
|
+
};
|
|
59
|
+
const result = MeetbotConfigSchema.safeParse(validConfig);
|
|
60
|
+
expect(result.success).toBe(true);
|
|
61
|
+
});
|
|
62
|
+
it('should validate valid config with all fields', () => {
|
|
63
|
+
const validConfig = {
|
|
64
|
+
baseUrl: 'https://api.meet.bot',
|
|
65
|
+
authToken: 'token123',
|
|
66
|
+
sessionId: 'session123',
|
|
67
|
+
};
|
|
68
|
+
const result = MeetbotConfigSchema.safeParse(validConfig);
|
|
69
|
+
expect(result.success).toBe(true);
|
|
70
|
+
});
|
|
71
|
+
it('should accept valid authToken', () => {
|
|
72
|
+
const validConfig = {
|
|
73
|
+
authToken: 'valid-token-123',
|
|
74
|
+
};
|
|
75
|
+
const result = MeetbotConfigSchema.safeParse(validConfig);
|
|
76
|
+
expect(result.success).toBe(true);
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
describe('GetSlotsParamsSchema', () => {
|
|
80
|
+
it('should validate valid params', () => {
|
|
81
|
+
const validParams = {
|
|
82
|
+
page: 'https://meet.bot/user/30min',
|
|
83
|
+
count: 10,
|
|
84
|
+
start: '2025-01-01',
|
|
85
|
+
end: '2025-01-31',
|
|
86
|
+
timezone: 'America/New_York',
|
|
87
|
+
booking_link: true,
|
|
88
|
+
};
|
|
89
|
+
const result = GetSlotsParamsSchema.safeParse(validParams);
|
|
90
|
+
expect(result.success).toBe(true);
|
|
91
|
+
});
|
|
92
|
+
it('should validate minimal params', () => {
|
|
93
|
+
const minimalParams = {
|
|
94
|
+
page: 'https://meet.bot/user/30min',
|
|
95
|
+
};
|
|
96
|
+
const result = GetSlotsParamsSchema.safeParse(minimalParams);
|
|
97
|
+
expect(result.success).toBe(true);
|
|
98
|
+
});
|
|
99
|
+
it('should reject invalid date format', () => {
|
|
100
|
+
const invalidParams = {
|
|
101
|
+
page: 'https://meet.bot/user/30min',
|
|
102
|
+
start: '2025/01/01',
|
|
103
|
+
};
|
|
104
|
+
const result = GetSlotsParamsSchema.safeParse(invalidParams);
|
|
105
|
+
expect(result.success).toBe(false);
|
|
106
|
+
});
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
//# sourceMappingURL=types.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.test.js","sourceRoot":"","sources":["../../src/__tests__/types.test.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,cAAc,EACd,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,YAAY,CAAC;AAEpB,QAAQ,CAAC,sBAAsB,EAAE,GAAG,EAAE;IACpC,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;QAC9B,EAAE,CAAC,kCAAkC,EAAE,GAAG,EAAE;YAC1C,MAAM,aAAa,GAAG;gBACpB,OAAO,EAAE,IAAI;gBACb,IAAI,EAAE,6BAA6B;gBACnC,WAAW,EAAE,mBAAmB;gBAChC,UAAU,EAAE,UAAU;gBACtB,KAAK,EAAE,eAAe;gBACtB,KAAK,EAAE,sBAAsB;gBAC7B,QAAQ,EAAE,QAAQ;aACnB,CAAC;YAEF,MAAM,MAAM,GAAG,cAAc,CAAC,SAAS,CAAC,a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WAAW,GAAG;gBAClB,IAAI,EAAE,6BAA6B;gBACnC,KAAK,EAAE,EAAE;gBACT,KAAK,EAAE,YAAY;gBACnB,GAAG,EAAE,YAAY;gBACjB,QAAQ,EAAE,kBAAkB;gBAC5B,YAAY,EAAE,IAAI;aACnB,CAAC;YAEF,MAAM,MAAM,GAAG,oBAAoB,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;YAC3D,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACpC,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,gCAAgC,EAAE,GAAG,EAAE;YACxC,MAAM,aAAa,GAAG;gBACpB,IAAI,EAAE,6BAA6B;aACpC,CAAC;YAEF,MAAM,MAAM,GAAG,oBAAoB,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC;YAC7D,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACpC,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,mCAAmC,EAAE,GAAG,EAAE;YAC3C,MAAM,aAAa,GAAG;gBACpB,IAAI,EAAE,6BAA6B;gBACnC,KAAK,EAAE,YAAY;aACpB,CAAC;YAEF,MAAM,MAAM,GAAG,oBAAoB,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC;YAC7D,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACrC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-http.d.ts","sourceRoot":"","sources":["../src/cli-http.ts"],"names":[],"mappings":""}
|
package/dist/cli-http.js
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createServer } from 'http';
|
|
3
|
+
import { MeetbotMCPServerHTTP } from './mcp-server-http.js';
|
|
4
|
+
const PORT = parseInt(process.env['PORT'] || '3000', 10);
|
|
5
|
+
async function main() {
|
|
6
|
+
const mcpServer = new MeetbotMCPServerHTTP();
|
|
7
|
+
const httpServer = createServer(async (req, res) => {
|
|
8
|
+
try {
|
|
9
|
+
await mcpServer.handleRequest(req, res);
|
|
10
|
+
}
|
|
11
|
+
catch (error) {
|
|
12
|
+
console.error('Request handling error:', error);
|
|
13
|
+
if (!res.headersSent) {
|
|
14
|
+
res.writeHead(500, { 'Content-Type': 'application/json' });
|
|
15
|
+
res.end(JSON.stringify({
|
|
16
|
+
error: 'Internal server error',
|
|
17
|
+
message: error instanceof Error ? error.message : 'Unknown error',
|
|
18
|
+
}));
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
httpServer.listen(PORT, () => {
|
|
23
|
+
console.log(`Meet.bot MCP HTTP server listening on port ${PORT}`);
|
|
24
|
+
console.log(`SSE endpoint: http://localhost:${PORT}/sse`);
|
|
25
|
+
console.log(`Health check: http://localhost:${PORT}/health`);
|
|
26
|
+
console.log('\nAuthentication required: Authorization: Bearer <your-token>');
|
|
27
|
+
});
|
|
28
|
+
// Graceful shutdown
|
|
29
|
+
process.on('SIGINT', () => {
|
|
30
|
+
console.log('\nShutting down MCP server...');
|
|
31
|
+
httpServer.close(() => {
|
|
32
|
+
console.log('Server closed');
|
|
33
|
+
process.exit(0);
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
process.on('SIGTERM', () => {
|
|
37
|
+
console.log('\nShutting down MCP server...');
|
|
38
|
+
httpServer.close(() => {
|
|
39
|
+
console.log('Server closed');
|
|
40
|
+
process.exit(0);
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
main().catch((error) => {
|
|
45
|
+
console.error('Failed to start MCP server:', error);
|
|
46
|
+
process.exit(1);
|
|
47
|
+
});
|
|
48
|
+
//# sourceMappingURL=cli-http.js.map
|
|
@@ -0,0 +1 @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,kCAAkC,IAAI,SAAS,CAAC,CAAC;QAC7D,OAAO,CAAC,GAAG,CAAC,+DAA+D,CAAC,CAAC;IAC/E,CAAC,CAAC,CAAC;IAEH,oBAAoB;IACpB,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE;QACxB,OAAO,CAAC,GAAG,CAAC,+BAA+B,CAAC,CAAC;QAC7C,UAAU,CAAC,KAAK,CAAC,GAAG,EAAE;YACpB,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;YAC7B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,GAAG,EAAE;QACzB,OAAO,CAAC,GAAG,CAAC,+BAA+B,CAAC,CAAC;QAC7C,UAAU,CAAC,KAAK,CAAC,GAAG,EAAE;YACpB,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;YAC7B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,6BAA6B,EAAE,KAAK,CAAC,CAAC;IACpD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
package/dist/cli.js
CHANGED
|
@@ -1,27 +1,25 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
const mcp_server_js_1 = require("./mcp-server.js");
|
|
2
|
+
import { MeetbotMCPServer } from './mcp-server.js';
|
|
5
3
|
/**
|
|
6
|
-
* CLI entry point for the
|
|
4
|
+
* CLI entry point for the Meet.bot MCP server
|
|
7
5
|
*/
|
|
8
6
|
async function main() {
|
|
9
7
|
try {
|
|
10
|
-
const server = new
|
|
8
|
+
const server = new MeetbotMCPServer();
|
|
11
9
|
await server.run();
|
|
12
10
|
}
|
|
13
11
|
catch (error) {
|
|
14
|
-
console.error('Failed to start
|
|
12
|
+
console.error('Failed to start Meet.bot MCP server:', error);
|
|
15
13
|
process.exit(1);
|
|
16
14
|
}
|
|
17
15
|
}
|
|
18
16
|
// Handle process termination gracefully
|
|
19
17
|
process.on('SIGINT', () => {
|
|
20
|
-
console.error('
|
|
18
|
+
console.error('Meet.bot MCP server shutting down...');
|
|
21
19
|
process.exit(0);
|
|
22
20
|
});
|
|
23
21
|
process.on('SIGTERM', () => {
|
|
24
|
-
console.error('
|
|
22
|
+
console.error('Meet.bot MCP server shutting down...');
|
|
25
23
|
process.exit(0);
|
|
26
24
|
});
|
|
27
25
|
// Start the server
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEnD;;GAEG;AACH,KAAK,UAAU,IAAI;IACjB,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,IAAI,gBAAgB,EAAE,CAAC;QACtC,MAAM,MAAM,CAAC,GAAG,EAAE,CAAC;IACrB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,sCAAsC,EAAE,KAAK,CAAC,CAAC;QAC7D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC;AAED,wCAAwC;AACxC,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE;IACxB,OAAO,CAAC,KAAK,CAAC,sCAAsC,CAAC,CAAC;IACtD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC;AAEH,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,GAAG,EAAE;IACzB,OAAO,CAAC,KAAK,CAAC,sCAAsC,CAAC,CAAC;IACtD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC;AAEH,mBAAmB;AACnB,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,kBAAkB,EAAE,KAAK,CAAC,CAAC;IACzC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* Model Context Protocol server for
|
|
2
|
+
* Meet.bot MCP Package
|
|
3
|
+
* Model Context Protocol server for Meet.bot Booking Page API
|
|
4
4
|
*/
|
|
5
5
|
export { MeetbotMCPServer } from './mcp-server.js';
|
|
6
|
+
export { MeetbotMCPServerHTTP } from './mcp-server-http.js';
|
|
6
7
|
export { MeetbotClient } from './meetbot-client.js';
|
|
7
8
|
export type { BookSlot, BookSlotRequest, GetSlotsParams, GetInfoParams, PageInfo, Pages, SchedulingPage, Slots, SlotDetails, MeetbotConfig, ApiError, ApiResponse, } from './types.js';
|
|
8
9
|
export { BookSlotSchema, BookSlotRequestSchema, GetSlotsParamsSchema, GetInfoParamsSchema, PageInfoSchema, PagesSchema, SchedulingPageSchema, SlotsSchema, SlotDetailsSchema, MeetbotConfigSchema, ApiErrorSchema, } from './schemas.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGpD,YAAY,EACV,QAAQ,EACR,eAAe,EACf,cAAc,EACd,aAAa,EACb,QAAQ,EACR,KAAK,EACL,cAAc,EACd,KAAK,EACL,WAAW,EACX,aAAa,EACb,QAAQ,EACR,WAAW,GACZ,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,cAAc,EACd,qBAAqB,EACrB,oBAAoB,EACpB,mBAAmB,EACnB,cAAc,EACd,WAAW,EACX,oBAAoB,EACpB,WAAW,EACX,iBAAiB,EACjB,mBAAmB,EACnB,cAAc,GACf,MAAM,cAAc,CAAC;AAGtB,YAAY,EACV,iBAAiB,EACjB,iBAAiB,EACjB,uBAAuB,EACvB,cAAc,EACd,cAAc,EACd,wBAAwB,EACxB,uBAAuB,EACvB,sBAAsB,EACtB,sBAAsB,GACvB,MAAM,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGpD,YAAY,EACV,QAAQ,EACR,eAAe,EACf,cAAc,EACd,aAAa,EACb,QAAQ,EACR,KAAK,EACL,cAAc,EACd,KAAK,EACL,WAAW,EACX,aAAa,EACb,QAAQ,EACR,WAAW,GACZ,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,cAAc,EACd,qBAAqB,EACrB,oBAAoB,EACpB,mBAAmB,EACnB,cAAc,EACd,WAAW,EACX,oBAAoB,EACpB,WAAW,EACX,iBAAiB,EACjB,mBAAmB,EACnB,cAAc,GACf,MAAM,cAAc,CAAC;AAGtB,YAAY,EACV,iBAAiB,EACjB,iBAAiB,EACjB,uBAAuB,EACvB,cAAc,EACd,cAAc,EACd,wBAAwB,EACxB,uBAAuB,EACvB,sBAAsB,EACtB,sBAAsB,GACvB,MAAM,cAAc,CAAC"}
|