@qikdev/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.
- package/LICENSE +21 -0
- package/README.md +237 -0
- package/build/bin/cli.d.ts +3 -0
- package/build/bin/cli.d.ts.map +1 -0
- package/build/bin/cli.js +265 -0
- package/build/bin/cli.js.map +1 -0
- package/build/src/config.d.ts +43 -0
- package/build/src/config.d.ts.map +1 -0
- package/build/src/config.js +152 -0
- package/build/src/config.js.map +1 -0
- package/build/src/index.d.ts +44 -0
- package/build/src/index.d.ts.map +1 -0
- package/build/src/index.js +731 -0
- package/build/src/index.js.map +1 -0
- package/package.json +53 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Qik Developers
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
# Qik MCP Server
|
|
2
|
+
|
|
3
|
+
A plug-and-play Model Context Protocol (MCP) server that connects Claude and other AI assistants to the Qik platform. Enable your AI assistant to interact with your Qik content management system, user profiles, forms, files, and more.
|
|
4
|
+
|
|
5
|
+
## 🚀 Quick Start
|
|
6
|
+
|
|
7
|
+
Get up and running in 3 simple steps:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
# 1. Run the setup (will prompt for your access token)
|
|
11
|
+
npx qik-mcp-server
|
|
12
|
+
|
|
13
|
+
# 2. That's it! The server is now configured and ready to use in Claude
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## 📋 What You'll Need
|
|
17
|
+
|
|
18
|
+
- **Qik Access Token**: Get yours from your Qik application settings
|
|
19
|
+
- Should start with `at-` (Application Access Token)
|
|
20
|
+
- Must have appropriate permissions for the operations you want to perform
|
|
21
|
+
- **Node.js**: Version 18 or higher
|
|
22
|
+
|
|
23
|
+
## 🛠️ Installation Options
|
|
24
|
+
|
|
25
|
+
### Option 1: One-time Setup (Recommended)
|
|
26
|
+
```bash
|
|
27
|
+
npx qik-mcp-server
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### Option 2: Global Installation
|
|
31
|
+
```bash
|
|
32
|
+
npm install -g qik-mcp-server
|
|
33
|
+
qik-mcp-server setup
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Option 3: Local Installation
|
|
37
|
+
```bash
|
|
38
|
+
npm install qik-mcp-server
|
|
39
|
+
npx qik-mcp-server setup
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## 🔧 Commands
|
|
43
|
+
|
|
44
|
+
| Command | Description |
|
|
45
|
+
|---------|-------------|
|
|
46
|
+
| `qik-mcp-server` | Interactive setup (default) |
|
|
47
|
+
| `qik-mcp-server setup` | Run the setup wizard |
|
|
48
|
+
| `qik-mcp-server status` | Check configuration status |
|
|
49
|
+
| `qik-mcp-server update-token` | Update your access token |
|
|
50
|
+
| `qik-mcp-server run` | Run the MCP server directly |
|
|
51
|
+
|
|
52
|
+
## 🎯 Available Tools
|
|
53
|
+
|
|
54
|
+
Once configured, you'll have access to these tools in Claude:
|
|
55
|
+
|
|
56
|
+
### Content Management
|
|
57
|
+
- **`qik_get_content`** - Get content by ID or slug
|
|
58
|
+
- **`qik_list_content`** - List and search content with filters
|
|
59
|
+
- **`qik_create_content`** - Create new content items
|
|
60
|
+
- **`qik_update_content`** - Update existing content
|
|
61
|
+
- **`qik_delete_content`** - Delete content items
|
|
62
|
+
|
|
63
|
+
### Content Discovery
|
|
64
|
+
- **`qik_get_glossary`** - Get all available content types and definitions
|
|
65
|
+
- **`qik_get_content_definition`** - Get definition for specific content types
|
|
66
|
+
- **`qik_search_content`** - Global search across all content types
|
|
67
|
+
|
|
68
|
+
### Profile Management
|
|
69
|
+
- **`qik_list_profiles`** - Search and list people/profiles
|
|
70
|
+
- **`qik_create_profile`** - Create new profiles
|
|
71
|
+
|
|
72
|
+
### Forms & Submissions
|
|
73
|
+
- **`qik_get_form`** - Get form definitions
|
|
74
|
+
- **`qik_submit_form`** - Submit form data
|
|
75
|
+
|
|
76
|
+
### File Management
|
|
77
|
+
- **`qik_upload_file`** - Upload files to Qik
|
|
78
|
+
|
|
79
|
+
### System & Permissions
|
|
80
|
+
- **`qik_get_user_session`** - Get current user session info
|
|
81
|
+
- **`qik_get_scopes`** - Get available scopes/permissions
|
|
82
|
+
- **`qik_get_smartlist`** - Execute smartlist queries
|
|
83
|
+
|
|
84
|
+
## 💡 Usage Examples
|
|
85
|
+
|
|
86
|
+
### Ask Claude to help with content:
|
|
87
|
+
> "List all articles created this month"
|
|
88
|
+
|
|
89
|
+
> "Create a new profile for John Smith with email john@example.com"
|
|
90
|
+
|
|
91
|
+
> "Search for all content containing 'project update'"
|
|
92
|
+
|
|
93
|
+
### Get system information:
|
|
94
|
+
> "Show me my current user session and permissions"
|
|
95
|
+
|
|
96
|
+
> "What content types are available in my Qik instance?"
|
|
97
|
+
|
|
98
|
+
## 🔐 Configuration
|
|
99
|
+
|
|
100
|
+
The server stores your configuration securely in `~/.qik-mcp/config.json` and automatically configures Claude's MCP settings.
|
|
101
|
+
|
|
102
|
+
### Manual Configuration
|
|
103
|
+
|
|
104
|
+
If automatic MCP configuration fails, you can manually add this to your Claude MCP settings:
|
|
105
|
+
|
|
106
|
+
```json
|
|
107
|
+
{
|
|
108
|
+
"mcpServers": {
|
|
109
|
+
"qik": {
|
|
110
|
+
"command": "npx",
|
|
111
|
+
"args": ["qik-mcp-server", "run"]
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### Environment Variables
|
|
118
|
+
|
|
119
|
+
For advanced users, you can also configure via environment variables:
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
export QIK_ACCESS_TOKEN="at-your-token-here"
|
|
123
|
+
export QIK_API_URL="https://api.qik.dev" # Optional, defaults to https://api.qik.dev
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## 🔍 Troubleshooting
|
|
127
|
+
|
|
128
|
+
### "Authentication failed"
|
|
129
|
+
- Check that your access token is correct and starts with `at-`
|
|
130
|
+
- Verify the token has the required permissions
|
|
131
|
+
- Try running `qik-mcp-server update-token`
|
|
132
|
+
|
|
133
|
+
### "Server not configured"
|
|
134
|
+
- Run `qik-mcp-server setup` to configure
|
|
135
|
+
- Check `qik-mcp-server status` for current configuration
|
|
136
|
+
|
|
137
|
+
### "Tools not appearing in Claude"
|
|
138
|
+
- Verify MCP configuration with `qik-mcp-server status`
|
|
139
|
+
- Restart Claude/Cline
|
|
140
|
+
- Check that the server name doesn't conflict with existing MCP servers
|
|
141
|
+
|
|
142
|
+
### Connection Issues
|
|
143
|
+
- Verify internet connection
|
|
144
|
+
- Check if your organization has firewall restrictions
|
|
145
|
+
- Try with a different API URL if using a custom Qik instance
|
|
146
|
+
|
|
147
|
+
## 🏗️ Development
|
|
148
|
+
|
|
149
|
+
### Building from Source
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
git clone https://gitlab.com/qikdevelopers/qik-mcp-server.git
|
|
153
|
+
cd qik-mcp-server
|
|
154
|
+
npm install
|
|
155
|
+
npm run build
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
### Running in Development
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
npm run dev
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
### Testing the Server
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
# Test the MCP server directly
|
|
168
|
+
npm run test
|
|
169
|
+
|
|
170
|
+
# Use the MCP inspector
|
|
171
|
+
npm run inspector
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
## 📚 API Reference
|
|
175
|
+
|
|
176
|
+
### Content Types
|
|
177
|
+
|
|
178
|
+
The server automatically discovers your organization's content types via the `/glossary` endpoint. Common types include:
|
|
179
|
+
|
|
180
|
+
- `article` - Articles and blog posts
|
|
181
|
+
- `profile` - People and contacts
|
|
182
|
+
- `event` - Events and meetings
|
|
183
|
+
- `file` - Uploaded files
|
|
184
|
+
- `image` - Images and media
|
|
185
|
+
- Custom types defined by your organization
|
|
186
|
+
|
|
187
|
+
### Filtering and Search
|
|
188
|
+
|
|
189
|
+
Most list operations support advanced filtering using Qik's filter syntax:
|
|
190
|
+
|
|
191
|
+
```javascript
|
|
192
|
+
// Example filter for articles created this month
|
|
193
|
+
{
|
|
194
|
+
"operator": "and",
|
|
195
|
+
"filters": [{
|
|
196
|
+
"key": "meta.created",
|
|
197
|
+
"comparator": "datesamemonth",
|
|
198
|
+
"value": "2024-01-01"
|
|
199
|
+
}]
|
|
200
|
+
}
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
### Pagination
|
|
204
|
+
|
|
205
|
+
List operations support pagination:
|
|
206
|
+
|
|
207
|
+
```javascript
|
|
208
|
+
{
|
|
209
|
+
"page": {
|
|
210
|
+
"size": 20, // Items per page (1-100)
|
|
211
|
+
"index": 1 // Page number (1-based)
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
## 🤝 Contributing
|
|
217
|
+
|
|
218
|
+
We welcome contributions! Please see our [GitLab repository](https://gitlab.com/qikdevelopers/qik-mcp-server) for:
|
|
219
|
+
|
|
220
|
+
- Issue reporting
|
|
221
|
+
- Feature requests
|
|
222
|
+
- Pull requests
|
|
223
|
+
- Development guidelines
|
|
224
|
+
|
|
225
|
+
## 📄 License
|
|
226
|
+
|
|
227
|
+
MIT License - see LICENSE file for details.
|
|
228
|
+
|
|
229
|
+
## 🆘 Support
|
|
230
|
+
|
|
231
|
+
- **Documentation**: [Qik Developer Docs](https://qikdevelopers.gitlab.io/sdk/docs/)
|
|
232
|
+
- **Issues**: [GitLab Issues](https://gitlab.com/qikdevelopers/qik-mcp-server/-/issues)
|
|
233
|
+
- **Email**: developers@qik.dev
|
|
234
|
+
|
|
235
|
+
---
|
|
236
|
+
|
|
237
|
+
Made with ❤️ by the Qik team
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../bin/cli.ts"],"names":[],"mappings":""}
|
package/build/bin/cli.js
ADDED
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { program } from 'commander';
|
|
3
|
+
import inquirer from 'inquirer';
|
|
4
|
+
import chalk from 'chalk';
|
|
5
|
+
import ora from 'ora';
|
|
6
|
+
import { ConfigManager } from '../src/config.js';
|
|
7
|
+
const configManager = new ConfigManager();
|
|
8
|
+
async function setupCommand() {
|
|
9
|
+
console.log(chalk.blue.bold('🚀 Welcome to Qik MCP Server Setup!\n'));
|
|
10
|
+
try {
|
|
11
|
+
// Check if already configured
|
|
12
|
+
const status = await configManager.getStatus();
|
|
13
|
+
if (status.configured && status.tokenValid) {
|
|
14
|
+
console.log(chalk.green('✅ Qik MCP Server is already configured and working!'));
|
|
15
|
+
console.log(chalk.gray(` Token: ${status.config?.accessToken?.substring(0, 10)}...`));
|
|
16
|
+
console.log(chalk.gray(` API URL: ${status.config?.apiUrl || 'https://api.qik.dev'}`));
|
|
17
|
+
console.log(chalk.gray(` MCP Configured: ${status.mcpConfigured ? 'Yes' : 'No'}`));
|
|
18
|
+
const { reconfigure } = await inquirer.prompt([{
|
|
19
|
+
type: 'confirm',
|
|
20
|
+
name: 'reconfigure',
|
|
21
|
+
message: 'Would you like to reconfigure?',
|
|
22
|
+
default: false,
|
|
23
|
+
}]);
|
|
24
|
+
if (!reconfigure) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
// Get access token
|
|
29
|
+
const { accessToken } = await inquirer.prompt([{
|
|
30
|
+
type: 'password',
|
|
31
|
+
name: 'accessToken',
|
|
32
|
+
message: 'Please enter your Qik access token:',
|
|
33
|
+
validate: (input) => {
|
|
34
|
+
if (!input.trim()) {
|
|
35
|
+
return 'Access token is required';
|
|
36
|
+
}
|
|
37
|
+
if (!input.startsWith('at-')) {
|
|
38
|
+
return 'Access token should start with "at-"';
|
|
39
|
+
}
|
|
40
|
+
return true;
|
|
41
|
+
},
|
|
42
|
+
}]);
|
|
43
|
+
// Get API URL (optional)
|
|
44
|
+
const { useCustomUrl } = await inquirer.prompt([{
|
|
45
|
+
type: 'confirm',
|
|
46
|
+
name: 'useCustomUrl',
|
|
47
|
+
message: 'Do you want to use a custom API URL? (default: https://api.qik.dev)',
|
|
48
|
+
default: false,
|
|
49
|
+
}]);
|
|
50
|
+
let apiUrl = 'https://api.qik.dev';
|
|
51
|
+
if (useCustomUrl) {
|
|
52
|
+
const response = await inquirer.prompt([{
|
|
53
|
+
type: 'input',
|
|
54
|
+
name: 'apiUrl',
|
|
55
|
+
message: 'Enter your custom API URL:',
|
|
56
|
+
default: 'https://api.qik.dev',
|
|
57
|
+
validate: (input) => {
|
|
58
|
+
try {
|
|
59
|
+
new URL(input);
|
|
60
|
+
return true;
|
|
61
|
+
}
|
|
62
|
+
catch {
|
|
63
|
+
return 'Please enter a valid URL';
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
}]);
|
|
67
|
+
apiUrl = response.apiUrl;
|
|
68
|
+
}
|
|
69
|
+
// Validate token
|
|
70
|
+
const spinner = ora('Validating access token...').start();
|
|
71
|
+
const validation = await configManager.validateToken(accessToken, apiUrl);
|
|
72
|
+
if (!validation.valid) {
|
|
73
|
+
spinner.fail(chalk.red('Token validation failed'));
|
|
74
|
+
console.log(chalk.red(`Error: ${validation.error}`));
|
|
75
|
+
process.exit(1);
|
|
76
|
+
}
|
|
77
|
+
spinner.succeed(chalk.green('Token validated successfully!'));
|
|
78
|
+
// Show session info
|
|
79
|
+
if (validation.session) {
|
|
80
|
+
console.log(chalk.gray(` Organisation: ${validation.session.organisation?.title || 'Unknown'}`));
|
|
81
|
+
console.log(chalk.gray(` User: ${validation.session.firstName || ''} ${validation.session.lastName || ''}`));
|
|
82
|
+
}
|
|
83
|
+
// Get server name
|
|
84
|
+
const { serverName } = await inquirer.prompt([{
|
|
85
|
+
type: 'input',
|
|
86
|
+
name: 'serverName',
|
|
87
|
+
message: 'Enter a name for this MCP server:',
|
|
88
|
+
default: 'qik',
|
|
89
|
+
validate: (input) => {
|
|
90
|
+
if (!input.trim()) {
|
|
91
|
+
return 'Server name is required';
|
|
92
|
+
}
|
|
93
|
+
if (!/^[a-zA-Z0-9_-]+$/.test(input)) {
|
|
94
|
+
return 'Server name can only contain letters, numbers, hyphens, and underscores';
|
|
95
|
+
}
|
|
96
|
+
return true;
|
|
97
|
+
},
|
|
98
|
+
}]);
|
|
99
|
+
// Save configuration
|
|
100
|
+
const config = {
|
|
101
|
+
accessToken,
|
|
102
|
+
apiUrl,
|
|
103
|
+
serverName,
|
|
104
|
+
};
|
|
105
|
+
const saveSpinner = ora('Saving configuration...').start();
|
|
106
|
+
await configManager.saveConfig(config);
|
|
107
|
+
saveSpinner.succeed(chalk.green('Configuration saved!'));
|
|
108
|
+
// Configure MCP
|
|
109
|
+
const mcpSpinner = ora('Configuring MCP server...').start();
|
|
110
|
+
const mcpResult = await configManager.addToMcpConfig(serverName);
|
|
111
|
+
if (!mcpResult.success) {
|
|
112
|
+
mcpSpinner.warn(chalk.yellow('MCP configuration failed'));
|
|
113
|
+
console.log(chalk.yellow(`Warning: ${mcpResult.error}`));
|
|
114
|
+
console.log(chalk.gray('You may need to manually add the server to your MCP configuration.'));
|
|
115
|
+
}
|
|
116
|
+
else {
|
|
117
|
+
mcpSpinner.succeed(chalk.green('MCP server configured!'));
|
|
118
|
+
}
|
|
119
|
+
// Success message
|
|
120
|
+
console.log(chalk.green.bold('\n🎉 Setup complete!'));
|
|
121
|
+
console.log(chalk.gray('You can now use Qik tools in Claude.'));
|
|
122
|
+
console.log(chalk.gray('\nAvailable tools:'));
|
|
123
|
+
console.log(chalk.gray(' • qik_get_content - Get content by ID or slug'));
|
|
124
|
+
console.log(chalk.gray(' • qik_list_content - List and search content'));
|
|
125
|
+
console.log(chalk.gray(' • qik_create_content - Create new content'));
|
|
126
|
+
console.log(chalk.gray(' • qik_update_content - Update existing content'));
|
|
127
|
+
console.log(chalk.gray(' • qik_delete_content - Delete content'));
|
|
128
|
+
console.log(chalk.gray(' • qik_list_profiles - Search profiles/people'));
|
|
129
|
+
console.log(chalk.gray(' • qik_create_profile - Create new profiles'));
|
|
130
|
+
console.log(chalk.gray(' • qik_upload_file - Upload files'));
|
|
131
|
+
console.log(chalk.gray(' • qik_search_content - Global content search'));
|
|
132
|
+
console.log(chalk.gray(' • qik_get_glossary - Get content type definitions'));
|
|
133
|
+
console.log(chalk.gray(' • And more...'));
|
|
134
|
+
}
|
|
135
|
+
catch (error) {
|
|
136
|
+
console.error(chalk.red('Setup failed:'), error.message);
|
|
137
|
+
process.exit(1);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
async function statusCommand() {
|
|
141
|
+
try {
|
|
142
|
+
const status = await configManager.getStatus();
|
|
143
|
+
console.log(chalk.blue.bold('📊 Qik MCP Server Status\n'));
|
|
144
|
+
if (!status.configured) {
|
|
145
|
+
console.log(chalk.red('❌ Not configured'));
|
|
146
|
+
console.log(chalk.gray('Run "qik-mcp-server setup" to get started.'));
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
console.log(chalk.green('✅ Configured'));
|
|
150
|
+
console.log(chalk.gray(` Token: ${status.config?.accessToken?.substring(0, 10)}...`));
|
|
151
|
+
console.log(chalk.gray(` API URL: ${status.config?.apiUrl || 'https://api.qik.dev'}`));
|
|
152
|
+
console.log(chalk.gray(` Server Name: ${status.config?.serverName || 'qik'}`));
|
|
153
|
+
if (status.tokenValid === false) {
|
|
154
|
+
console.log(chalk.red('❌ Token invalid'));
|
|
155
|
+
if (status.error) {
|
|
156
|
+
console.log(chalk.red(` Error: ${status.error}`));
|
|
157
|
+
}
|
|
158
|
+
console.log(chalk.gray('Run "qik-mcp-server setup" to reconfigure.'));
|
|
159
|
+
}
|
|
160
|
+
else {
|
|
161
|
+
console.log(chalk.green('✅ Token valid'));
|
|
162
|
+
}
|
|
163
|
+
if (status.mcpConfigured) {
|
|
164
|
+
console.log(chalk.green('✅ MCP configured'));
|
|
165
|
+
}
|
|
166
|
+
else {
|
|
167
|
+
console.log(chalk.yellow('⚠️ MCP not configured'));
|
|
168
|
+
console.log(chalk.gray('The server may not be available in Claude.'));
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
catch (error) {
|
|
172
|
+
console.error(chalk.red('Status check failed:'), error.message);
|
|
173
|
+
process.exit(1);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
async function runCommand() {
|
|
177
|
+
try {
|
|
178
|
+
const status = await configManager.getStatus();
|
|
179
|
+
if (!status.configured || !status.tokenValid) {
|
|
180
|
+
console.error(chalk.red('❌ Server not properly configured.'));
|
|
181
|
+
console.log(chalk.gray('Run "qik-mcp-server setup" first.'));
|
|
182
|
+
process.exit(1);
|
|
183
|
+
}
|
|
184
|
+
// Set environment variables and run the server
|
|
185
|
+
const config = status.config;
|
|
186
|
+
process.env.QIK_ACCESS_TOKEN = config.accessToken;
|
|
187
|
+
process.env.QIK_API_URL = config.apiUrl || 'https://api.qik.dev';
|
|
188
|
+
// Import and run the server
|
|
189
|
+
const { QikMCPServer } = await import('../src/index.js');
|
|
190
|
+
const server = new QikMCPServer();
|
|
191
|
+
await server.run();
|
|
192
|
+
}
|
|
193
|
+
catch (error) {
|
|
194
|
+
console.error(chalk.red('Failed to start server:'), error.message);
|
|
195
|
+
process.exit(1);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
async function updateTokenCommand() {
|
|
199
|
+
try {
|
|
200
|
+
console.log(chalk.blue.bold('🔑 Update Access Token\n'));
|
|
201
|
+
const { accessToken } = await inquirer.prompt([{
|
|
202
|
+
type: 'password',
|
|
203
|
+
name: 'accessToken',
|
|
204
|
+
message: 'Please enter your new Qik access token:',
|
|
205
|
+
validate: (input) => {
|
|
206
|
+
if (!input.trim()) {
|
|
207
|
+
return 'Access token is required';
|
|
208
|
+
}
|
|
209
|
+
if (!input.startsWith('at-')) {
|
|
210
|
+
return 'Access token should start with "at-"';
|
|
211
|
+
}
|
|
212
|
+
return true;
|
|
213
|
+
},
|
|
214
|
+
}]);
|
|
215
|
+
// Load existing config
|
|
216
|
+
const existingConfig = await configManager.loadConfig();
|
|
217
|
+
const apiUrl = existingConfig?.apiUrl || 'https://api.qik.dev';
|
|
218
|
+
// Validate new token
|
|
219
|
+
const spinner = ora('Validating new access token...').start();
|
|
220
|
+
const validation = await configManager.validateToken(accessToken, apiUrl);
|
|
221
|
+
if (!validation.valid) {
|
|
222
|
+
spinner.fail(chalk.red('Token validation failed'));
|
|
223
|
+
console.log(chalk.red(`Error: ${validation.error}`));
|
|
224
|
+
process.exit(1);
|
|
225
|
+
}
|
|
226
|
+
spinner.succeed(chalk.green('Token validated successfully!'));
|
|
227
|
+
// Update config
|
|
228
|
+
const newConfig = {
|
|
229
|
+
...existingConfig,
|
|
230
|
+
accessToken,
|
|
231
|
+
};
|
|
232
|
+
await configManager.saveConfig(newConfig);
|
|
233
|
+
console.log(chalk.green('✅ Access token updated successfully!'));
|
|
234
|
+
}
|
|
235
|
+
catch (error) {
|
|
236
|
+
console.error(chalk.red('Failed to update token:'), error.message);
|
|
237
|
+
process.exit(1);
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
// Set up CLI commands
|
|
241
|
+
program
|
|
242
|
+
.name('qik-mcp-server')
|
|
243
|
+
.description('Qik MCP Server - Connect Claude to your Qik platform')
|
|
244
|
+
.version('1.0.0');
|
|
245
|
+
program
|
|
246
|
+
.command('setup')
|
|
247
|
+
.description('Interactive setup for Qik MCP Server')
|
|
248
|
+
.action(setupCommand);
|
|
249
|
+
program
|
|
250
|
+
.command('status')
|
|
251
|
+
.description('Check server configuration status')
|
|
252
|
+
.action(statusCommand);
|
|
253
|
+
program
|
|
254
|
+
.command('run')
|
|
255
|
+
.description('Run the MCP server')
|
|
256
|
+
.action(runCommand);
|
|
257
|
+
program
|
|
258
|
+
.command('update-token')
|
|
259
|
+
.description('Update your access token')
|
|
260
|
+
.action(updateTokenCommand);
|
|
261
|
+
// Default command (setup)
|
|
262
|
+
program
|
|
263
|
+
.action(setupCommand);
|
|
264
|
+
program.parse();
|
|
265
|
+
//# sourceMappingURL=cli.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../bin/cli.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,EAA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AM,CAAC,aAAa,CAAC,CAAC;AAEzB,OAAO;KACJ,OAAO,CAAC,KAAK,CAAC;KACd,WAAW,CAAC,oBAAoB,CAAC;KACjC,MAAM,CAAC,UAAU,CAAC,CAAC;AAEtB,OAAO;KACJ,OAAO,CAAC,cAAc,CAAC;KACvB,WAAW,CAAC,0BAA0B,CAAC;KACvC,MAAM,CAAC,kBAAkB,CAAC,CAAC;AAE9B,0BAA0B;AAC1B,OAAO;KACJ,MAAM,CAAC,YAAY,CAAC,CAAC;AAExB,OAAO,CAAC,KAAK,EAAE,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export interface QikConfig {
|
|
2
|
+
accessToken: string;
|
|
3
|
+
apiUrl?: string;
|
|
4
|
+
serverName?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface McpServerConfig {
|
|
7
|
+
command: string;
|
|
8
|
+
args?: string[];
|
|
9
|
+
env?: {
|
|
10
|
+
[key: string]: string;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
export declare class ConfigManager {
|
|
14
|
+
private configDir;
|
|
15
|
+
private configFile;
|
|
16
|
+
private mcpConfigFile;
|
|
17
|
+
constructor();
|
|
18
|
+
ensureConfigDir(): Promise<void>;
|
|
19
|
+
saveConfig(config: QikConfig): Promise<void>;
|
|
20
|
+
loadConfig(): Promise<QikConfig | null>;
|
|
21
|
+
validateToken(token: string, apiUrl?: string): Promise<{
|
|
22
|
+
valid: boolean;
|
|
23
|
+
error?: string;
|
|
24
|
+
session?: any;
|
|
25
|
+
}>;
|
|
26
|
+
addToMcpConfig(serverName?: string): Promise<{
|
|
27
|
+
success: boolean;
|
|
28
|
+
error?: string;
|
|
29
|
+
}>;
|
|
30
|
+
removeFromMcpConfig(serverName?: string): Promise<{
|
|
31
|
+
success: boolean;
|
|
32
|
+
error?: string;
|
|
33
|
+
}>;
|
|
34
|
+
isConfigured(): Promise<boolean>;
|
|
35
|
+
getStatus(): Promise<{
|
|
36
|
+
configured: boolean;
|
|
37
|
+
config?: QikConfig;
|
|
38
|
+
tokenValid?: boolean;
|
|
39
|
+
mcpConfigured?: boolean;
|
|
40
|
+
error?: string;
|
|
41
|
+
}>;
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,SAAS;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,GAAG,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;CACjC;AAED,qBAAa,aAAa;IACxB,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,aAAa,CAAS;;IAQxB,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC;IAQhC,UAAU,CAAC,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC;IAK5C,UAAU,IAAI,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC;IASvC,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,GAAE,MAA8B,GAAG,OAAO,CAAC;QAAE,KAAK,EAAE,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,GAAG,CAAA;KAAE,CAAC;IA4BhI,cAAc,CAAC,UAAU,GAAE,MAAc,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAsCzF,mBAAmB,CAAC,UAAU,GAAE,MAAc,GA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