@configcat/mcp-server 0.1.2
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/CONTRIBUTING.md +75 -0
- package/DEPLOY.md +19 -0
- package/LICENSE +21 -0
- package/README.md +230 -0
- package/build/http.d.ts +15 -0
- package/build/http.js +51 -0
- package/build/index.d.ts +3 -0
- package/build/index.js +27 -0
- package/build/tools/configcat-api.d.ts +10 -0
- package/build/tools/configcat-api.js +1965 -0
- package/build/tools/configcat-docs.d.ts +4 -0
- package/build/tools/configcat-docs.js +73 -0
- package/package.json +53 -0
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# Contributing to the ConfigCat MCP Server
|
|
2
|
+
|
|
3
|
+
ConfigCat MCP Server is an open source project. Feedback and contribution are welcome. Contributions are made to this repo via Issues and Pull Requests.
|
|
4
|
+
|
|
5
|
+
## Submitting bug reports and feature requests
|
|
6
|
+
|
|
7
|
+
The ConfigCat team monitors the [issue tracker](https://github.com/configcat/mcp-server/issues) in the ConfigCat MCP Server repository. Bug reports and feature requests specific to this MCP Server should be filed in this issue tracker. The team will respond to all newly filed issues.
|
|
8
|
+
|
|
9
|
+
## Submitting pull requests
|
|
10
|
+
|
|
11
|
+
We encourage pull requests and other contributions from the community.
|
|
12
|
+
- Before submitting pull requests, ensure that all temporary or unintended code is removed.
|
|
13
|
+
- Be accompanied by a complete Pull Request template (loaded automatically when a PR is created).
|
|
14
|
+
- Add unit or integration tests for fixed or changed functionality.
|
|
15
|
+
|
|
16
|
+
When you submit a pull request or otherwise seek to include your change in the repository, you waive all your intellectual property rights, including your copyright and patent claims for the submission. For more details please read the [contribution agreement](https://github.com/configcat/legal/blob/main/contribution-agreement.md).
|
|
17
|
+
|
|
18
|
+
In general, we follow the ["fork-and-pull" Git workflow](https://github.com/susam/gitpr)
|
|
19
|
+
|
|
20
|
+
1. Fork the repository to your own Github account
|
|
21
|
+
2. Clone the project to your machine
|
|
22
|
+
3. Create a branch locally with a succinct but descriptive name
|
|
23
|
+
4. Commit changes to the branch
|
|
24
|
+
5. Following any formatting and testing guidelines specific to this repo
|
|
25
|
+
6. Push changes to your fork
|
|
26
|
+
7. Open a PR in our repository and follow the PR template so that we can efficiently review the changes.
|
|
27
|
+
|
|
28
|
+
## Build instructions
|
|
29
|
+
|
|
30
|
+
The project uses [npm](https://www.npmjs.com) for dependency management.
|
|
31
|
+
|
|
32
|
+
### Install dependencies:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
npm install
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Build the MCP server
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
npm run build
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
This will output the compiled JavaScript files to the `build/` directory (or as configured in `tsconfig.json`).
|
|
45
|
+
|
|
46
|
+
### Add the MCP server to your AI tool
|
|
47
|
+
|
|
48
|
+
When configuring your MCP client (e.g., Cursor, VS Code, Claude Desktop), use the absolute path to your local build. Example JSON config:
|
|
49
|
+
|
|
50
|
+
```json
|
|
51
|
+
{
|
|
52
|
+
"mcpServers": {
|
|
53
|
+
"ConfigCat": {
|
|
54
|
+
"command": "node",
|
|
55
|
+
"args": ["/absolute/path/to/configcat-mcp-server/build/index.js"],
|
|
56
|
+
"env": {
|
|
57
|
+
"CONFIGCAT_API_USER": "YOUR_API_USER",
|
|
58
|
+
"CONFIGCAT_API_PASS": "YOUR_API_PASSWORD",
|
|
59
|
+
"CONFIGCAT_BASE_URL": "YOUR_BASE_URL"
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Replace `/absolute/path/to/configcat-mcp-server/build/index.js` with the actual path on your machine.
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
## MCP Inspector
|
|
70
|
+
|
|
71
|
+
For a better development and debugging experience, try the [MCP Inspector](https://github.com/modelcontextprotocol/inspector) to test tools and more.
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
npx @modelcontextprotocol/inspector -e CONFIGCAT_API_USER=<user> -e CONFIGCAT_API_PASS=<password> -e CONFIGCAT_BASE_URL=https://api.configcat.com node build/index.js
|
|
75
|
+
```
|
package/DEPLOY.md
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Steps to deploy
|
|
2
|
+
## Preparation
|
|
3
|
+
1. Increase the `serverVersion` in [src/index.ts](src/index.ts).
|
|
4
|
+
2. Commit & Push
|
|
5
|
+
## Publish
|
|
6
|
+
Use the **same version** for the git tag as in [src/index.ts](src/index.ts).
|
|
7
|
+
- Via git tag
|
|
8
|
+
1. Create a new version tag.
|
|
9
|
+
```bash
|
|
10
|
+
git tag v[MAJOR].[MINOR].[PATCH]
|
|
11
|
+
```
|
|
12
|
+
> Example: `git tag v2.5.5`
|
|
13
|
+
2. Push the tag.
|
|
14
|
+
```bash
|
|
15
|
+
git push origin --tags
|
|
16
|
+
```
|
|
17
|
+
- Via Github release
|
|
18
|
+
|
|
19
|
+
Create a new [Github release](https://github.com/configcat/mcp-server/releases) with a new version tag and release notes.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 ConfigCat
|
|
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,230 @@
|
|
|
1
|
+
# ConfigCat MCP Server
|
|
2
|
+
|
|
3
|
+
The ConfigCat's Model Context Protocol (MCP) server provides access to [ConfigCat's public management API](https://configcat.com/docs/api/reference/configcat-public-management-api/) for feature flag and configuration management.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Tools**: Complete set of tools for ConfigCat's public management API operations. You can Create, Read, Update and Delete any entities like Feature Flags, Configs, Environments or Products within ConfigCat.
|
|
8
|
+
|
|
9
|
+
## Setup
|
|
10
|
+
|
|
11
|
+
You can use the following environment variables to configure the MCP server.
|
|
12
|
+
|
|
13
|
+
| Environment variable | Required | Default | Description |
|
|
14
|
+
| -------------------- | -------- | ------- | ----------- |
|
|
15
|
+
| CONFIGCAT_API_USER | ☑ | | [ConfigCat Management API basic authentication username](https://app.configcat.com/my-account/public-api-credentials). |
|
|
16
|
+
| CONFIGCAT_API_PASS | ☑ | | [ConfigCat Management API basic authentication password](https://app.configcat.com/my-account/public-api-credentials). |
|
|
17
|
+
| CONFIGCAT_BASE_URL | | https://api.configcat.com | ConfigCat Management API host. |
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
The instructions below shows how to connect a client to the MCP server.
|
|
21
|
+
|
|
22
|
+
### Cursor
|
|
23
|
+
|
|
24
|
+
1. Open `Preferences` -> `Cursor Settings` -> `MCP & Integrations`
|
|
25
|
+
2. Click `Add Custom MCP`
|
|
26
|
+
3. Add the following server definition for the ConfigCat MCP server:
|
|
27
|
+
|
|
28
|
+
```json
|
|
29
|
+
{
|
|
30
|
+
"mcpServers": {
|
|
31
|
+
"ConfigCat": {
|
|
32
|
+
"command": "npx",
|
|
33
|
+
"args": ["-y", "@configcat/mcp-server"],
|
|
34
|
+
"env": {
|
|
35
|
+
"CONFIGCAT_API_USER": "YOUR_API_USER",
|
|
36
|
+
"CONFIGCAT_API_PASS": "YOUR_API_PASSWORD"
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
4. Save the settings.
|
|
44
|
+
|
|
45
|
+
### Visual Studio Code
|
|
46
|
+
|
|
47
|
+
1. Create a `.vscode/mcp.json` file in your project root with the following content:
|
|
48
|
+
|
|
49
|
+
```json
|
|
50
|
+
{
|
|
51
|
+
"servers": {
|
|
52
|
+
"ConfigCat": {
|
|
53
|
+
"command": "npx",
|
|
54
|
+
"args": ["-y", "@configcat/mcp-server"],
|
|
55
|
+
"env": {
|
|
56
|
+
"CONFIGCAT_API_USER": "YOUR_API_USER",
|
|
57
|
+
"CONFIGCAT_API_PASS": "YOUR_API_PASSWORD"
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
2. Save the settings file. The MCP server should now be available in VS Code.
|
|
65
|
+
|
|
66
|
+
### Claude Desktop
|
|
67
|
+
|
|
68
|
+
1. Open **Settings** → **Developer**
|
|
69
|
+
2. Click **Edit Config**
|
|
70
|
+
3. Open `claude_desktop_config.json`
|
|
71
|
+
4. Add the following server definition for the ConfigCat MCP server:
|
|
72
|
+
|
|
73
|
+
```json
|
|
74
|
+
{
|
|
75
|
+
"mcpServers": {
|
|
76
|
+
"ConfigCat": {
|
|
77
|
+
"command": "npx",
|
|
78
|
+
"args": ["-y", "@configcat/mcp-server"],
|
|
79
|
+
"env": {
|
|
80
|
+
"CONFIGCAT_API_USER": "YOUR_API_USER",
|
|
81
|
+
"CONFIGCAT_API_PASS": "YOUR_API_PASSWORD"
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
5. Save and restart Claude.
|
|
89
|
+
|
|
90
|
+
## Available Tools
|
|
91
|
+
|
|
92
|
+
### Membership Management
|
|
93
|
+
|
|
94
|
+
#### Organizations
|
|
95
|
+
|
|
96
|
+
- `list-organizations` - List all organizations
|
|
97
|
+
|
|
98
|
+
#### Members
|
|
99
|
+
|
|
100
|
+
- `list-organization-members` - List organization members
|
|
101
|
+
- `list-pending-invitations` - List pending invitations
|
|
102
|
+
- `list-pending-invitations-org` - List org pending invitations
|
|
103
|
+
- `list-product-members` - List product members
|
|
104
|
+
- `invite-member` - Invite a new member
|
|
105
|
+
- `update-member-permissions` - Update the permissions of a member
|
|
106
|
+
- `delete-organization-member` - Remove organization member
|
|
107
|
+
- `delete-product-member` - Remove product member
|
|
108
|
+
- `delete-invitation` - Cancel invitation
|
|
109
|
+
|
|
110
|
+
#### Permission Groups
|
|
111
|
+
|
|
112
|
+
- `list-permission-groups` - List permission groups
|
|
113
|
+
- `create-permission-group` - Create a new permission group
|
|
114
|
+
- `get-permission-group` - Get permission group details
|
|
115
|
+
- `update-permission-group` - Update permission group
|
|
116
|
+
- `delete-permission-group` - Delete permission group
|
|
117
|
+
|
|
118
|
+
### General
|
|
119
|
+
|
|
120
|
+
#### Products
|
|
121
|
+
|
|
122
|
+
- `list-products` - List all products
|
|
123
|
+
- `get-product` - Get specific product details
|
|
124
|
+
- `update-product` - Update existing product
|
|
125
|
+
- `delete-product` - Delete a product
|
|
126
|
+
- `get-product-preferences` - Get product preferences
|
|
127
|
+
- `update-product-preferences` - Update product preferences
|
|
128
|
+
- `create-product` - Create a new product
|
|
129
|
+
|
|
130
|
+
#### Configs
|
|
131
|
+
|
|
132
|
+
- `list-configs` - List configs for a product
|
|
133
|
+
- `create-config` - Create a new config
|
|
134
|
+
- `get-config` - Get specific config details
|
|
135
|
+
- `update-config` - Update existing config
|
|
136
|
+
- `delete-config` - Delete a config
|
|
137
|
+
|
|
138
|
+
#### Environments
|
|
139
|
+
|
|
140
|
+
- `list-environments` - List environments for a product
|
|
141
|
+
- `create-environment` - Create a new environment
|
|
142
|
+
- `get-environment` - Get specific environment details
|
|
143
|
+
- `update-environment` - Update existing environment
|
|
144
|
+
- `delete-environment` - Delete an environment
|
|
145
|
+
|
|
146
|
+
#### Segments
|
|
147
|
+
|
|
148
|
+
- `list-segments` - List user segments
|
|
149
|
+
- `create-segment` - Create a new segment
|
|
150
|
+
- `get-segment` - Get specific segment details
|
|
151
|
+
- `update-segment` - Update existing segment
|
|
152
|
+
- `delete-segment` - Delete a segment
|
|
153
|
+
|
|
154
|
+
#### SDK Keys
|
|
155
|
+
|
|
156
|
+
- `get-sdk-keys` - Get SDK keys for config/environment
|
|
157
|
+
|
|
158
|
+
#### Webhooks
|
|
159
|
+
|
|
160
|
+
- `list-webhooks` - List webhooks
|
|
161
|
+
- `get-webhook` - Get webhook details
|
|
162
|
+
- `replace-webhook` - Replace webhook configuration
|
|
163
|
+
- `update-webhook` - Update existing webhook
|
|
164
|
+
- `delete-webhook` - Delete a webhook
|
|
165
|
+
- `get-webhook-signing-keys` - List webhook signing keys
|
|
166
|
+
- `create-webhook` - Create a new webhook
|
|
167
|
+
|
|
168
|
+
#### Integrations
|
|
169
|
+
|
|
170
|
+
- `list-integrations` - List integrations
|
|
171
|
+
- `create-integration` - Create a new integration
|
|
172
|
+
- `get-integration` - Get integration details
|
|
173
|
+
- `update-integration` - Update existing integration
|
|
174
|
+
- `delete-integration` - Delete an integration
|
|
175
|
+
|
|
176
|
+
#### Code References
|
|
177
|
+
|
|
178
|
+
- `get-code-references` - Get code references
|
|
179
|
+
|
|
180
|
+
### Diagnostics
|
|
181
|
+
|
|
182
|
+
#### Audit logs
|
|
183
|
+
|
|
184
|
+
- `list-auditlogs` - Get product audit logs
|
|
185
|
+
- `list-organization-auditlogs` - Get organization audit logs
|
|
186
|
+
|
|
187
|
+
#### Zombie (stale) flags
|
|
188
|
+
|
|
189
|
+
- `list-staleflags` - Get stale feature flags report
|
|
190
|
+
|
|
191
|
+
### Feature Flag metadata
|
|
192
|
+
|
|
193
|
+
#### Feature Flags & Settings
|
|
194
|
+
|
|
195
|
+
- `list-settings` - List feature flags for a config
|
|
196
|
+
- `create-setting` - Create a new feature flag
|
|
197
|
+
- `get-setting` - Get specific feature flag details
|
|
198
|
+
- `replace-setting` - Replace feature flag configuration
|
|
199
|
+
- `update-setting` - Update existing feature flag
|
|
200
|
+
- `delete-setting` - Delete a feature flag
|
|
201
|
+
|
|
202
|
+
#### Tags
|
|
203
|
+
|
|
204
|
+
- `list-tags` - List tags for a product
|
|
205
|
+
- `create-tag` - Create a new tag
|
|
206
|
+
- `list-settings-by-tag` - Get feature flags by tag
|
|
207
|
+
- `get-tag` - Get specific tag details
|
|
208
|
+
- `update-tag` - Update existing tag
|
|
209
|
+
- `delete-tag` - Delete a tag
|
|
210
|
+
|
|
211
|
+
### Feature Flag & Setting Values (v1 & v2 APIs)
|
|
212
|
+
|
|
213
|
+
- `get-setting-value` - Get feature flag value
|
|
214
|
+
- `update-setting-value` - Update feature flag value
|
|
215
|
+
- `replace-setting-value` - Replace feature flag value
|
|
216
|
+
- `get-setting-values` - Get multiple setting values
|
|
217
|
+
- `post-setting-values` - Update multiple setting values
|
|
218
|
+
- V2 variants: `*-v2` versions of above tools for Config V2
|
|
219
|
+
|
|
220
|
+
### SDK documentation
|
|
221
|
+
|
|
222
|
+
- `update-sdk-documentation` - Get comprehensive SDK documentation and code examples for seamless feature flag implementation in your project.
|
|
223
|
+
|
|
224
|
+
## API Rate Limits
|
|
225
|
+
|
|
226
|
+
The ConfigCat public API has rate limits. The server will respect these limits and return appropriate error messages if limits are exceeded.
|
|
227
|
+
|
|
228
|
+
## Security Note
|
|
229
|
+
|
|
230
|
+
This server is designed for management operations only. Do not use it for evaluating feature flag values in production applications - use the [ConfigCat SDKs](https://configcat.com/docs/sdk-reference/overview/) or [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead.
|
package/build/http.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type HttpOptions = {
|
|
2
|
+
baseUrl: string;
|
|
3
|
+
username: string;
|
|
4
|
+
password: string;
|
|
5
|
+
userAgent?: string;
|
|
6
|
+
};
|
|
7
|
+
export declare class HttpClient {
|
|
8
|
+
private readonly baseUrl;
|
|
9
|
+
private readonly authHeader;
|
|
10
|
+
private readonly userAgent;
|
|
11
|
+
constructor(opts: HttpOptions);
|
|
12
|
+
request(path: string, init?: RequestInit): Promise<Response>;
|
|
13
|
+
fetch(url: string): Promise<Response>;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=http.d.ts.map
|
package/build/http.js
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { Buffer } from "node:buffer";
|
|
2
|
+
export class HttpClient {
|
|
3
|
+
baseUrl;
|
|
4
|
+
authHeader;
|
|
5
|
+
userAgent;
|
|
6
|
+
constructor(opts) {
|
|
7
|
+
this.baseUrl = opts.baseUrl.replace(/\/$/, "");
|
|
8
|
+
const encoded = Buffer.from(`${opts.username}:${opts.password}`).toString("base64");
|
|
9
|
+
this.authHeader = `Basic ${encoded}`;
|
|
10
|
+
this.userAgent = opts.userAgent ?? "";
|
|
11
|
+
}
|
|
12
|
+
// HTTP request with Basic auth and JSON handling
|
|
13
|
+
async request(path, init = {}) {
|
|
14
|
+
const url = path.startsWith("http") ? path : `${this.baseUrl}${path}`;
|
|
15
|
+
const headers = new Headers();
|
|
16
|
+
headers.set("Authorization", this.authHeader);
|
|
17
|
+
headers.set("Accept", "application/json");
|
|
18
|
+
headers.set("Content-Type", "application/json");
|
|
19
|
+
headers.set("User-Agent", this.userAgent);
|
|
20
|
+
// Add any additional headers from init
|
|
21
|
+
if (init.headers) {
|
|
22
|
+
const additionalHeaders = new Headers(init.headers);
|
|
23
|
+
for (const [key, value] of additionalHeaders.entries()) {
|
|
24
|
+
headers.set(key, value);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
const response = await fetch(url, {
|
|
28
|
+
...init,
|
|
29
|
+
headers,
|
|
30
|
+
});
|
|
31
|
+
if (!response.ok) {
|
|
32
|
+
const text = await response.text().catch(() => "");
|
|
33
|
+
const rate = {
|
|
34
|
+
remaining: response.headers.get("X-Rate-Limit-Remaining"),
|
|
35
|
+
reset: response.headers.get("X-Rate-Limit-Reset"),
|
|
36
|
+
};
|
|
37
|
+
throw new Error(`HTTP ${response.status} ${response.statusText} for ${url} - ${text} - rate: ${JSON.stringify(rate)}`);
|
|
38
|
+
}
|
|
39
|
+
return response;
|
|
40
|
+
}
|
|
41
|
+
// Simple fetch with User-Agent header
|
|
42
|
+
async fetch(url) {
|
|
43
|
+
return await fetch(url, {
|
|
44
|
+
redirect: "follow",
|
|
45
|
+
headers: {
|
|
46
|
+
"User-Agent": this.userAgent,
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=http.js.map
|
package/build/index.d.ts
ADDED
package/build/index.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
3
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
4
|
+
import { HttpClient } from "./http.js";
|
|
5
|
+
import { registerConfigCatAPITools } from "./tools/configcat-api.js";
|
|
6
|
+
import { registerConfigCatDocsTools } from "./tools/configcat-docs.js";
|
|
7
|
+
const baseUrl = process.env.CONFIGCAT_BASE_URL ?? "https://api.configcat.com";
|
|
8
|
+
const username = process.env.CONFIGCAT_API_USER ?? "";
|
|
9
|
+
const password = process.env.CONFIGCAT_API_PASS ?? "";
|
|
10
|
+
const serverName = "ConfigCat MCP";
|
|
11
|
+
const serverVersion = "0.1.2";
|
|
12
|
+
const http = new HttpClient({ baseUrl, username, password, userAgent: `${serverName}/${serverVersion}` });
|
|
13
|
+
const server = new McpServer({ name: serverName, version: serverVersion }, { capabilities: { tools: {} } });
|
|
14
|
+
async function main() {
|
|
15
|
+
if (!username || !password) {
|
|
16
|
+
throw new Error("Please set CONFIGCAT_API_USER and CONFIGCAT_API_PASS environment variables (Public API credentials). You can create your credentials on the Public API credentials management page: https://app.configcat.com/my-account/public-api-credentials.");
|
|
17
|
+
}
|
|
18
|
+
registerConfigCatAPITools(server, http);
|
|
19
|
+
await registerConfigCatDocsTools(server, http);
|
|
20
|
+
const transport = new StdioServerTransport();
|
|
21
|
+
await server.connect(transport);
|
|
22
|
+
}
|
|
23
|
+
main().catch((err) => {
|
|
24
|
+
console.error(err);
|
|
25
|
+
process.exit(1);
|
|
26
|
+
});
|
|
27
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import type { HttpClient } from "../http";
|
|
3
|
+
/**
|
|
4
|
+
* Registers the ConfigCat API tools with the given server and HTTP client.
|
|
5
|
+
*
|
|
6
|
+
* @param server The server instance to register the tools with.
|
|
7
|
+
* @param http The HTTP client instance to use for API requests.
|
|
8
|
+
*/
|
|
9
|
+
export declare function registerConfigCatAPITools(server: McpServer, http: HttpClient): void;
|
|
10
|
+
//# sourceMappingURL=configcat-api.d.ts.map
|