@elastic.io/mcp 1.0.0 → 1.0.1-beta
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/README.md +128 -126
- package/README.npm.md +173 -0
- package/dist/api/client.d.ts.map +1 -1
- package/dist/api/client.js +8 -3
- package/dist/api/client.js.map +1 -1
- package/dist/api/jsonapi.d.ts +2 -9
- package/dist/api/jsonapi.d.ts.map +1 -1
- package/dist/api/jsonapi.js +1 -14
- package/dist/api/jsonapi.js.map +1 -1
- package/dist/api/logger.d.ts +0 -1
- package/dist/api/logger.d.ts.map +1 -1
- package/dist/api/logger.js +2 -5
- package/dist/api/logger.js.map +1 -1
- package/dist/api/samples.d.ts +0 -6
- package/dist/api/samples.d.ts.map +1 -1
- package/dist/api/samples.js +8 -8
- package/dist/api/samples.js.map +1 -1
- package/dist/api/verification.d.ts +6 -0
- package/dist/api/verification.d.ts.map +1 -0
- package/dist/api/verification.js +71 -0
- package/dist/api/verification.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +9 -0
- package/dist/cli.js.map +1 -0
- package/dist/config.d.ts +0 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +0 -5
- package/dist/config.js.map +1 -1
- package/dist/index.js +11 -10
- package/dist/index.js.map +1 -1
- package/dist/paths.d.ts +0 -1
- package/dist/paths.d.ts.map +1 -1
- package/dist/paths.js +1 -1
- package/dist/paths.js.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +24 -0
- package/dist/server.js.map +1 -1
- package/dist/setup.d.ts +3 -0
- package/dist/setup.d.ts.map +1 -0
- package/dist/setup.js +338 -0
- package/dist/setup.js.map +1 -0
- package/dist/tools/confirmation.d.ts +0 -4
- package/dist/tools/confirmation.d.ts.map +1 -1
- package/dist/tools/confirmation.js +1 -1
- package/dist/tools/confirmation.js.map +1 -1
- package/dist/tools/constants.d.ts +6 -9
- package/dist/tools/constants.d.ts.map +1 -1
- package/dist/tools/constants.js +48 -41
- package/dist/tools/constants.js.map +1 -1
- package/dist/tools/definitions.d.ts.map +1 -1
- package/dist/tools/definitions.js +37 -5
- package/dist/tools/definitions.js.map +1 -1
- package/dist/tools/flow-build.d.ts +18 -0
- package/dist/tools/flow-build.d.ts.map +1 -0
- package/dist/tools/flow-build.js +295 -0
- package/dist/tools/flow-build.js.map +1 -0
- package/dist/tools/flow-evidence.d.ts +62 -0
- package/dist/tools/flow-evidence.d.ts.map +1 -0
- package/dist/tools/flow-evidence.js +128 -0
- package/dist/tools/flow-evidence.js.map +1 -0
- package/dist/tools/flow-state-machine.d.ts +69 -0
- package/dist/tools/flow-state-machine.d.ts.map +1 -0
- package/dist/tools/flow-state-machine.js +292 -0
- package/dist/tools/flow-state-machine.js.map +1 -0
- package/dist/tools/handlers/auth.d.ts.map +1 -1
- package/dist/tools/handlers/auth.js +18 -148
- package/dist/tools/handlers/auth.js.map +1 -1
- package/dist/tools/handlers/component.d.ts.map +1 -1
- package/dist/tools/handlers/component.js +28 -8
- package/dist/tools/handlers/component.js.map +1 -1
- package/dist/tools/handlers/data-sample.d.ts.map +1 -1
- package/dist/tools/handlers/data-sample.js +37 -5
- package/dist/tools/handlers/data-sample.js.map +1 -1
- package/dist/tools/handlers/dynamic.d.ts.map +1 -1
- package/dist/tools/handlers/dynamic.js +43 -14
- package/dist/tools/handlers/dynamic.js.map +1 -1
- package/dist/tools/handlers/flow.d.ts.map +1 -1
- package/dist/tools/handlers/flow.js +147 -619
- package/dist/tools/handlers/flow.js.map +1 -1
- package/dist/tools/handlers/log.d.ts.map +1 -1
- package/dist/tools/handlers/log.js +31 -0
- package/dist/tools/handlers/log.js.map +1 -1
- package/dist/tools/handlers/raw.d.ts.map +1 -1
- package/dist/tools/handlers/raw.js +5 -2
- package/dist/tools/handlers/raw.js.map +1 -1
- package/dist/tools/handlers/search.d.ts.map +1 -1
- package/dist/tools/handlers/search.js +67 -44
- package/dist/tools/handlers/search.js.map +1 -1
- package/dist/tools/handlers/session.d.ts.map +1 -1
- package/dist/tools/handlers/session.js +8 -1
- package/dist/tools/handlers/session.js.map +1 -1
- package/dist/tools/handlers.d.ts.map +1 -1
- package/dist/tools/handlers.js +7 -2
- package/dist/tools/handlers.js.map +1 -1
- package/dist/tools/helpers.d.ts +0 -1
- package/dist/tools/helpers.d.ts.map +1 -1
- package/dist/tools/helpers.js +2 -2
- package/dist/tools/helpers.js.map +1 -1
- package/dist/tools/types.d.ts +8 -1
- package/dist/tools/types.d.ts.map +1 -1
- package/dist/tools/validation.d.ts +16 -5
- package/dist/tools/validation.d.ts.map +1 -1
- package/dist/tools/validation.js +220 -168
- package/dist/tools/validation.js.map +1 -1
- package/dist/vectorstore/qdrant.js +1 -1
- package/dist/vectorstore/qdrant.js.map +1 -1
- package/package.json +22 -7
- package/resources/docs/flow-building-guide.md +18 -2
- package/resources/docs/rest-api-pagination.md +58 -0
- package/resources/docs/system-instructions.md +35 -5
- package/resources/docs/component-test-scenarios.md +0 -2468
- package/resources/docs/credential-validation-gaps.md +0 -35
- package/resources/docs/debug-issues.md +0 -71
- package/resources/docs/deployment-and-scaling.md +0 -136
- package/resources/docs/packaging-plan.md +0 -84
- package/resources/docs/unique-components.md +0 -60
- package/resources/docs/verified-creds-flow-ids.md +0 -193
package/README.md
CHANGED
|
@@ -1,171 +1,173 @@
|
|
|
1
1
|
# elastic.io Model Context Protocol (MCP) Server
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
An MCP server that connects AI assistants to the **elastic.io** iPaaS platform — letting them discover, build, modify, and debug integration flows directly.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Full documentation: [GitHub](https://github.com/elasticio/mcp)
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## Terms of Use
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
The elastic.io MCP server is optional. By connecting an AI agent to elastic.io through it, you agree to the [elastic.io Terms of Use](https://www.elastic.io/terms-of-use/), in particular section 9 (*MCP Interface and AI agents*).
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
In short:
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
- **Your agent acts as you.** Everything your AI agent does through MCP counts as an action of your elastic.io account.
|
|
14
|
+
- **Limit its permissions.** The agent can read, change and delete data within the permissions of the user account you connect. Use a dedicated user with only the permissions the agent needs, and read-only access wherever possible.
|
|
15
|
+
- **Your data goes to your AI provider.** Data the agent reads is sent to the AI provider you use. You are responsible for your agreement with that provider.
|
|
16
|
+
- **We don't control your agent.** elastic.io does not provide or control your AI agent and is not responsible for its actions or outputs.
|
|
17
|
+
- **We don't use AI on your data.** elastic.io does not use AI to process your data and does not use it to train AI models.
|
|
14
18
|
|
|
15
19
|
---
|
|
16
20
|
|
|
17
|
-
##
|
|
21
|
+
## Quick Start
|
|
22
|
+
|
|
23
|
+
### Prerequisites
|
|
24
|
+
|
|
25
|
+
1. **Node.js 22+** — download from [nodejs.org](https://nodejs.org/)
|
|
26
|
+
2. **A desktop AI client** — install one of the supported clients (see below)
|
|
27
|
+
3. **elastic.io credentials** — log in to your elastic.io account, go to your profile page, and copy the `curl` command shown there (it looks like `curl https://api.elastic.io/v2/users/me -u your_email:your_api_key`). The setup wizard accepts this command directly — just paste it when prompted.
|
|
18
28
|
|
|
19
|
-
|
|
29
|
+
### One-Command Setup
|
|
20
30
|
|
|
31
|
+
Run this in your terminal — it will detect your installed AI clients and configure them automatically:
|
|
32
|
+
|
|
33
|
+
**macOS / Linux:**
|
|
34
|
+
```
|
|
35
|
+
npx -y @elastic.io/mcp setup
|
|
21
36
|
```
|
|
22
|
-
[Stdio Mode (Local)]
|
|
23
|
-
LLM Client (Cursor) <--> [stdin / stdout] <--> MCP Server (uses static env keys)
|
|
24
37
|
|
|
25
|
-
|
|
26
|
-
|
|
38
|
+
**Windows (PowerShell):**
|
|
39
|
+
```powershell
|
|
40
|
+
npx -y "@elastic.io/mcp" setup
|
|
27
41
|
```
|
|
28
42
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
43
|
+
> **Windows notes:**
|
|
44
|
+
> - Always wrap the package name in quotes (`"@elastic.io/mcp"`) — PowerShell misinterprets the `@` symbol without them.
|
|
45
|
+
> - If you get a `PSSecurityException` error, allow script execution for your user first:
|
|
46
|
+
> ```powershell
|
|
47
|
+
> Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned
|
|
48
|
+
> ```
|
|
32
49
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
50
|
+
Works on macOS, Linux, and Windows. The setup wizard will:
|
|
51
|
+
1. Check your Node.js version (22+ required)
|
|
52
|
+
2. Accept the `curl` command from your profile page (or ask for email and API key manually)
|
|
53
|
+
3. Detect which AI clients are installed on your machine
|
|
54
|
+
4. Resolve the full path to `node`/`npx` (handles NVM, fnm, Homebrew, etc.)
|
|
55
|
+
5. Write the MCP config files with correct paths for each client
|
|
39
56
|
|
|
40
|
-
|
|
41
|
-
* **State-Machine Verification:** To prevent the LLM from configuring flows using cached or hallucinated IDs, the validation engine enforces that components and credentials must be fetched/discovered in the current session before they can be configured in a graph.
|
|
42
|
-
* **JSONata Safety Checks:** The server reviews generated mappings, warning the LLM if it wraps JSONata mappers in outer quotes (making them strings) or references variables directly instead of using `$getPassthrough().step_id.body.field`.
|
|
43
|
-
* **Token Optimization:** Component details are retrieved in two steps to prevent token bloat. Large metadata objects and enums are dynamically pruned when they exceed limits.
|
|
57
|
+
After setup, **restart your AI client** — the elastic.io tools will appear in the chat.
|
|
44
58
|
|
|
45
|
-
|
|
59
|
+
### Supported Clients
|
|
60
|
+
|
|
61
|
+
Claude Desktop, Claude Code, ChatGPT / Codex, Cursor, VS Code (Copilot), Windsurf, Gemini CLI / Gemini IDE, Zed, Cline, Trae, Qwen Code, Kimi Code, DeepSeek.
|
|
62
|
+
|
|
63
|
+
See the [full client table with config paths](https://github.com/elasticio/mcp#supported-clients) on GitHub.
|
|
64
|
+
|
|
65
|
+
### Manual Configuration
|
|
66
|
+
|
|
67
|
+
If you prefer to configure manually, add the following to your client's MCP config file:
|
|
46
68
|
|
|
47
|
-
## Execution Process & Requirements
|
|
48
|
-
|
|
49
|
-
### Requirements
|
|
50
|
-
* **Node.js** (version 18 or higher)
|
|
51
|
-
* **npm** or yarn
|
|
52
|
-
* **Embedding Provider API Key** (required for creating documentation and flow sample embeddings, e.g. Gemini).
|
|
53
|
-
* **Vector Store URL and API Key** (for semantic search capabilities, e.g. Qdrant).
|
|
54
|
-
|
|
55
|
-
### Local Setup
|
|
56
|
-
1. Clone this repository and install dependencies:
|
|
57
|
-
```bash
|
|
58
|
-
npm install
|
|
59
|
-
```
|
|
60
|
-
2. Copy `.env.example` to `.env` and fill out your variables:
|
|
61
|
-
```bash
|
|
62
|
-
cp .env.example .env
|
|
63
|
-
```
|
|
64
|
-
3. Build the project:
|
|
65
|
-
```bash
|
|
66
|
-
npm run build
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
### Running Locally (Stdio Mode)
|
|
70
|
-
To run the server locally inside your IDE (e.g. Cursor or Claude Desktop):
|
|
71
|
-
```bash
|
|
72
|
-
node dist/index.js
|
|
73
|
-
```
|
|
74
|
-
Configure your client configuration file (e.g., `mcp_config.json`) to invoke this command, providing the required environment variables:
|
|
75
69
|
```json
|
|
76
70
|
{
|
|
77
71
|
"mcpServers": {
|
|
78
|
-
"elasticio
|
|
79
|
-
"command": "
|
|
80
|
-
"args": ["/
|
|
81
|
-
"cwd": "/path/to/project",
|
|
72
|
+
"elasticio": {
|
|
73
|
+
"command": "npx",
|
|
74
|
+
"args": ["-y", "@elastic.io/mcp"],
|
|
82
75
|
"env": {
|
|
83
76
|
"ELASTICIO_API_EMAIL": "your_email@example.com",
|
|
84
77
|
"ELASTICIO_API_KEY": "your_api_key",
|
|
85
|
-
"
|
|
86
|
-
"VECTOR_STORE_URL": "your_vector_store_url",
|
|
87
|
-
"VECTOR_STORE_API_KEY": "your_vector_store_api_key"
|
|
78
|
+
"ELASTICIO_API_BASE_URL": "https://api.elastic.io/v2"
|
|
88
79
|
}
|
|
89
80
|
}
|
|
90
81
|
}
|
|
91
82
|
}
|
|
92
83
|
```
|
|
93
84
|
|
|
94
|
-
|
|
95
|
-
|
|
85
|
+
> **Note:** ChatGPT / Codex uses TOML format — use `npx -y @elastic.io/mcp setup` for automatic configuration.
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## Environment Variables
|
|
90
|
+
|
|
91
|
+
| Variable | Required | Default | Description |
|
|
92
|
+
|---|---|---|---|
|
|
93
|
+
| `ELASTICIO_API_EMAIL` | yes | — | Your elastic.io account email |
|
|
94
|
+
| `ELASTICIO_API_KEY` | yes | — | Your elastic.io API key |
|
|
95
|
+
| `ELASTICIO_API_BASE_URL` | no | `https://api.elastic.io/v2` | Base URL for the elastic.io REST API |
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## Update
|
|
100
|
+
|
|
101
|
+
To update to the latest version, clear the npx cache first, then run setup again:
|
|
102
|
+
|
|
96
103
|
```bash
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
* The server will run on the port defined by the `PORT` environment variable (defaults to `3000`).
|
|
100
|
-
* Connect via the SSE endpoint `http://localhost:3000/sse` (or your cloud hosting URL) supplying your elastic.io credentials via basic auth.
|
|
104
|
+
# macOS / Linux
|
|
105
|
+
npx -y clear-npx-cache && npx -y @elastic.io/mcp setup
|
|
101
106
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
```json
|
|
105
|
-
{
|
|
106
|
-
"mcpServers": {
|
|
107
|
-
"elasticio-mcp-cloud": {
|
|
108
|
-
"url": "https://your-mcp-server.yourdomain.com/sse",
|
|
109
|
-
"headers": {
|
|
110
|
-
"x-elasticio-email": "your_email@example.com",
|
|
111
|
-
"x-elasticio-api-key": "your_api_key"
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
}
|
|
107
|
+
# Windows (PowerShell)
|
|
108
|
+
npx -y clear-npx-cache; npx -y "@elastic.io/mcp" setup
|
|
116
109
|
```
|
|
117
|
-
|
|
110
|
+
|
|
111
|
+
This ensures npx fetches the latest version from npm. Your credentials will be re-prompted. Restart your AI clients after the update.
|
|
118
112
|
|
|
119
113
|
---
|
|
120
114
|
|
|
121
|
-
##
|
|
122
|
-
|
|
123
|
-
The server uses semantic search to locate documentation and similar flow configuration examples for the LLM. You must populate the vector database using one of two methods:
|
|
124
|
-
|
|
125
|
-
### 1. Ingesting Local Files
|
|
126
|
-
The project includes command-line scripts to parse, embed, and index local resources:
|
|
127
|
-
* **Ingest Documentation:** Parses the markdown files located in `resources/elasticio.github.io/content/` and uploads them to the Qdrant `documentation` collection:
|
|
128
|
-
```bash
|
|
129
|
-
node dist/scripts/ingest_docs.js
|
|
130
|
-
```
|
|
131
|
-
* **Ingest Flow Templates:** Parses the local JSON templates located in `resources/flow-examples/` and uploads them to the Qdrant `flow_samples` collection:
|
|
132
|
-
```bash
|
|
133
|
-
node dist/scripts/ingest_flow_examples.js
|
|
134
|
-
```
|
|
135
|
-
* **Verify Search:** Runs test search queries against Qdrant to confirm embeddings were correctly indexed:
|
|
136
|
-
```bash
|
|
137
|
-
node dist/scripts/test_search.js --query "your query string" --collection "flow_samples"
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
### 2. Live Webhook Ingestion (SSE Mode)
|
|
141
|
-
When running in cloud/SSE mode, the server exposes an endpoint to ingest real-time flows directly from platform databases or sync scripts:
|
|
142
|
-
* **Endpoint:** `POST /api/samples` (accepts a JSON array of processed flows).
|
|
143
|
-
* **Execution Workflow:**
|
|
144
|
-
1. The server accepts the payload immediately with a `202 Accepted` response to prevent blocking network execution, then queues the tasks.
|
|
145
|
-
2. The background queue processing cleans and formats the flow structure, step settings, and JSONata mapper edges into a markdown document.
|
|
146
|
-
3. The structured text chunks are batched (up to 100 items per batch) and sent to the embedding API provider.
|
|
147
|
-
4. A 5-second delay is introduced between batches to respect API provider rate limits.
|
|
148
|
-
5. The resulting vectors are saved under the `flow_samples` collection in the vector database.
|
|
115
|
+
## Uninstall
|
|
149
116
|
|
|
150
|
-
|
|
117
|
+
To completely remove the elastic.io MCP server and its credentials from your machine:
|
|
118
|
+
|
|
119
|
+
### 1. Remove the `elasticio` entry from your AI client configs
|
|
120
|
+
|
|
121
|
+
Open the config file for each client you configured and delete the `elasticio` section. Config file locations:
|
|
122
|
+
|
|
123
|
+
| Client | macOS | Windows | Linux |
|
|
124
|
+
|---|---|---|---|
|
|
125
|
+
| Claude Desktop | `~/Library/Application Support/Claude/claude_desktop_config.json` | `%APPDATA%\Claude\claude_desktop_config.json` | `~/.config/Claude/claude_desktop_config.json` |
|
|
126
|
+
| Claude Code | `~/.claude.json` | `~/.claude.json` | `~/.claude.json` |
|
|
127
|
+
| ChatGPT / Codex | `~/.codex/config.toml` | `~/.codex/config.toml` | `~/.codex/config.toml` |
|
|
128
|
+
| Cursor | `~/.cursor/mcp.json` | `~/.cursor/mcp.json` | `~/.cursor/mcp.json` |
|
|
129
|
+
| VS Code (Copilot) | `~/Library/Application Support/Code/User/mcp.json` | `%APPDATA%\Code\User\mcp.json` | `~/.config/Code/User/mcp.json` |
|
|
130
|
+
| Windsurf | `~/.codeium/windsurf/mcp_config.json` | `~/.codeium/windsurf/mcp_config.json` | `~/.codeium/windsurf/mcp_config.json` |
|
|
131
|
+
| Gemini CLI / Gemini IDE | `~/.gemini/config/mcp_config.json` | `~/.gemini/config/mcp_config.json` | `~/.gemini/config/mcp_config.json` |
|
|
132
|
+
| Zed | `~/.config/zed/settings.json` | `~/.config/zed/settings.json` | `~/.config/zed/settings.json` |
|
|
133
|
+
| Cline (VS Code) | `~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json` | `%APPDATA%\Code\User\globalStorage\saoudrizwan.claude-dev\settings\cline_mcp_settings.json` | `~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json` |
|
|
134
|
+
| Trae | `~/.trae/mcp.json` | `~/.trae/mcp.json` | `~/.trae/mcp.json` |
|
|
135
|
+
| Qwen Code | `~/.qwen/settings.json` | `~/.qwen/settings.json` | `~/.qwen/settings.json` |
|
|
136
|
+
| Kimi Code | `~/.kimi-code/mcp.json` | `~/.kimi-code/mcp.json` | `~/.kimi-code/mcp.json` |
|
|
137
|
+
| DeepSeek | `~/.deepseek/mcp.json` | `~/.deepseek/mcp.json` | `~/.deepseek/mcp.json` |
|
|
151
138
|
|
|
152
|
-
|
|
139
|
+
### 2. Clear the npx cache
|
|
153
140
|
|
|
154
|
-
|
|
141
|
+
The MCP server binary is cached by npx. To remove it:
|
|
155
142
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
143
|
+
```bash
|
|
144
|
+
# macOS / Linux
|
|
145
|
+
npx -y clear-npx-cache
|
|
146
|
+
# or manually:
|
|
147
|
+
rm -rf ~/.npm/_npx
|
|
148
|
+
|
|
149
|
+
# Windows (PowerShell)
|
|
150
|
+
Remove-Item -Recurse -Force "$env:USERPROFILE\.npm\_npx"
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
### 3. Revoke your API key
|
|
154
|
+
|
|
155
|
+
Your elastic.io API key is stored in plain text in each config file listed above. After removing the config entries:
|
|
156
|
+
|
|
157
|
+
1. Log in to your elastic.io account
|
|
158
|
+
2. Go to your profile page
|
|
159
|
+
3. Regenerate your API key
|
|
160
160
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
161
|
+
This invalidates the old key even if a copy remains on disk.
|
|
162
|
+
|
|
163
|
+
> **Security note:** Keep your MCP credentials secret and revoke them without delay if you suspect they may have been compromised.
|
|
164
|
+
|
|
165
|
+
### 4. Restart your AI clients
|
|
166
|
+
|
|
167
|
+
Restart any AI clients that were configured to pick up the changes.
|
|
168
|
+
|
|
169
|
+
---
|
|
165
170
|
|
|
166
|
-
|
|
167
|
-
The custom `SessionManager` manages stateful, multi-tenant mappings between SSE connection scopes and in-memory class instances. If the server process restarts, all active sessions are lost, causing `404` errors for connected clients until they re-establish connections.
|
|
168
|
-
* **Recommendation (Shifting to Mature Solutions):** For enterprise deployment, you should consider transitioning from in-memory session multiplexing to one of two mature architectural patterns:
|
|
169
|
-
* **3rd-Party Gateway/Proxy**: Run the MCP server in standard local `stdio` mode and wrap it using an off-the-shelf gateway (such as ContextForge Gateway, Apache APISIX with `mcp-bridge` plugin, or Supergateway). These gateways manage routing, SSL, authentication, and SSE session tracking out-of-the-box.
|
|
170
|
-
* **Infrastructure Isolation**: Deploy the server purely in `stdio` mode inside isolated, single-tenant container tasks (e.g. AWS ECS, GCP Cloud Run, or Fly.io micro-VMs) scheduled on-demand by a cloud orchestrator. This provides strict process-level security isolation and delegates lifecycles to your cloud provider, eliminating the need to write custom reapers or session hydration logic.
|
|
171
|
+
## Licence
|
|
171
172
|
|
|
173
|
+
This package is open-source under the [Apache 2.0](./LICENSE) licence. Connecting it to the elastic.io platform is subject to the Terms of Use above.
|
package/README.npm.md
ADDED
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
# elastic.io Model Context Protocol (MCP) Server
|
|
2
|
+
|
|
3
|
+
An MCP server that connects AI assistants to the **elastic.io** iPaaS platform — letting them discover, build, modify, and debug integration flows directly.
|
|
4
|
+
|
|
5
|
+
Full documentation: [GitHub](https://github.com/elasticio/mcp)
|
|
6
|
+
|
|
7
|
+
## Terms of Use
|
|
8
|
+
|
|
9
|
+
The elastic.io MCP server is optional. By connecting an AI agent to elastic.io through it, you agree to the [elastic.io Terms of Use](https://www.elastic.io/terms-of-use/), in particular section 9 (*MCP Interface and AI agents*).
|
|
10
|
+
|
|
11
|
+
In short:
|
|
12
|
+
|
|
13
|
+
- **Your agent acts as you.** Everything your AI agent does through MCP counts as an action of your elastic.io account.
|
|
14
|
+
- **Limit its permissions.** The agent can read, change and delete data within the permissions of the user account you connect. Use a dedicated user with only the permissions the agent needs, and read-only access wherever possible.
|
|
15
|
+
- **Your data goes to your AI provider.** Data the agent reads is sent to the AI provider you use. You are responsible for your agreement with that provider.
|
|
16
|
+
- **We don't control your agent.** elastic.io does not provide or control your AI agent and is not responsible for its actions or outputs.
|
|
17
|
+
- **We don't use AI on your data.** elastic.io does not use AI to process your data and does not use it to train AI models.
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Quick Start
|
|
22
|
+
|
|
23
|
+
### Prerequisites
|
|
24
|
+
|
|
25
|
+
1. **Node.js 22+** — download from [nodejs.org](https://nodejs.org/)
|
|
26
|
+
2. **A desktop AI client** — install one of the supported clients (see below)
|
|
27
|
+
3. **elastic.io credentials** — log in to your elastic.io account, go to your profile page, and copy the `curl` command shown there (it looks like `curl https://api.elastic.io/v2/users/me -u your_email:your_api_key`). The setup wizard accepts this command directly — just paste it when prompted.
|
|
28
|
+
|
|
29
|
+
### One-Command Setup
|
|
30
|
+
|
|
31
|
+
Run this in your terminal — it will detect your installed AI clients and configure them automatically:
|
|
32
|
+
|
|
33
|
+
**macOS / Linux:**
|
|
34
|
+
```
|
|
35
|
+
npx -y @elastic.io/mcp setup
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
**Windows (PowerShell):**
|
|
39
|
+
```powershell
|
|
40
|
+
npx -y "@elastic.io/mcp" setup
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
> **Windows notes:**
|
|
44
|
+
> - Always wrap the package name in quotes (`"@elastic.io/mcp"`) — PowerShell misinterprets the `@` symbol without them.
|
|
45
|
+
> - If you get a `PSSecurityException` error, allow script execution for your user first:
|
|
46
|
+
> ```powershell
|
|
47
|
+
> Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned
|
|
48
|
+
> ```
|
|
49
|
+
|
|
50
|
+
Works on macOS, Linux, and Windows. The setup wizard will:
|
|
51
|
+
1. Check your Node.js version (22+ required)
|
|
52
|
+
2. Accept the `curl` command from your profile page (or ask for email and API key manually)
|
|
53
|
+
3. Detect which AI clients are installed on your machine
|
|
54
|
+
4. Resolve the full path to `node`/`npx` (handles NVM, fnm, Homebrew, etc.)
|
|
55
|
+
5. Write the MCP config files with correct paths for each client
|
|
56
|
+
|
|
57
|
+
After setup, **restart your AI client** — the elastic.io tools will appear in the chat.
|
|
58
|
+
|
|
59
|
+
### Supported Clients
|
|
60
|
+
|
|
61
|
+
Claude Desktop, Claude Code, ChatGPT / Codex, Cursor, VS Code (Copilot), Windsurf, Gemini CLI / Gemini IDE, Zed, Cline, Trae, Qwen Code, Kimi Code, DeepSeek.
|
|
62
|
+
|
|
63
|
+
See the [full client table with config paths](https://github.com/elasticio/mcp#supported-clients) on GitHub.
|
|
64
|
+
|
|
65
|
+
### Manual Configuration
|
|
66
|
+
|
|
67
|
+
If you prefer to configure manually, add the following to your client's MCP config file:
|
|
68
|
+
|
|
69
|
+
```json
|
|
70
|
+
{
|
|
71
|
+
"mcpServers": {
|
|
72
|
+
"elasticio": {
|
|
73
|
+
"command": "npx",
|
|
74
|
+
"args": ["-y", "@elastic.io/mcp"],
|
|
75
|
+
"env": {
|
|
76
|
+
"ELASTICIO_API_EMAIL": "your_email@example.com",
|
|
77
|
+
"ELASTICIO_API_KEY": "your_api_key",
|
|
78
|
+
"ELASTICIO_API_BASE_URL": "https://api.elastic.io/v2"
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
> **Note:** ChatGPT / Codex uses TOML format — use `npx -y @elastic.io/mcp setup` for automatic configuration.
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## Environment Variables
|
|
90
|
+
|
|
91
|
+
| Variable | Required | Default | Description |
|
|
92
|
+
|---|---|---|---|
|
|
93
|
+
| `ELASTICIO_API_EMAIL` | yes | — | Your elastic.io account email |
|
|
94
|
+
| `ELASTICIO_API_KEY` | yes | — | Your elastic.io API key |
|
|
95
|
+
| `ELASTICIO_API_BASE_URL` | no | `https://api.elastic.io/v2` | Base URL for the elastic.io REST API |
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## Update
|
|
100
|
+
|
|
101
|
+
To update to the latest version, clear the npx cache first, then run setup again:
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
# macOS / Linux
|
|
105
|
+
npx -y clear-npx-cache && npx -y @elastic.io/mcp setup
|
|
106
|
+
|
|
107
|
+
# Windows (PowerShell)
|
|
108
|
+
npx -y clear-npx-cache; npx -y "@elastic.io/mcp" setup
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
This ensures npx fetches the latest version from npm. Your credentials will be re-prompted. Restart your AI clients after the update.
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
## Uninstall
|
|
116
|
+
|
|
117
|
+
To completely remove the elastic.io MCP server and its credentials from your machine:
|
|
118
|
+
|
|
119
|
+
### 1. Remove the `elasticio` entry from your AI client configs
|
|
120
|
+
|
|
121
|
+
Open the config file for each client you configured and delete the `elasticio` section. Config file locations:
|
|
122
|
+
|
|
123
|
+
| Client | macOS | Windows | Linux |
|
|
124
|
+
|---|---|---|---|
|
|
125
|
+
| Claude Desktop | `~/Library/Application Support/Claude/claude_desktop_config.json` | `%APPDATA%\Claude\claude_desktop_config.json` | `~/.config/Claude/claude_desktop_config.json` |
|
|
126
|
+
| Claude Code | `~/.claude.json` | `~/.claude.json` | `~/.claude.json` |
|
|
127
|
+
| ChatGPT / Codex | `~/.codex/config.toml` | `~/.codex/config.toml` | `~/.codex/config.toml` |
|
|
128
|
+
| Cursor | `~/.cursor/mcp.json` | `~/.cursor/mcp.json` | `~/.cursor/mcp.json` |
|
|
129
|
+
| VS Code (Copilot) | `~/Library/Application Support/Code/User/mcp.json` | `%APPDATA%\Code\User\mcp.json` | `~/.config/Code/User/mcp.json` |
|
|
130
|
+
| Windsurf | `~/.codeium/windsurf/mcp_config.json` | `~/.codeium/windsurf/mcp_config.json` | `~/.codeium/windsurf/mcp_config.json` |
|
|
131
|
+
| Gemini CLI / Gemini IDE | `~/.gemini/config/mcp_config.json` | `~/.gemini/config/mcp_config.json` | `~/.gemini/config/mcp_config.json` |
|
|
132
|
+
| Zed | `~/.config/zed/settings.json` | `~/.config/zed/settings.json` | `~/.config/zed/settings.json` |
|
|
133
|
+
| Cline (VS Code) | `~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json` | `%APPDATA%\Code\User\globalStorage\saoudrizwan.claude-dev\settings\cline_mcp_settings.json` | `~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json` |
|
|
134
|
+
| Trae | `~/.trae/mcp.json` | `~/.trae/mcp.json` | `~/.trae/mcp.json` |
|
|
135
|
+
| Qwen Code | `~/.qwen/settings.json` | `~/.qwen/settings.json` | `~/.qwen/settings.json` |
|
|
136
|
+
| Kimi Code | `~/.kimi-code/mcp.json` | `~/.kimi-code/mcp.json` | `~/.kimi-code/mcp.json` |
|
|
137
|
+
| DeepSeek | `~/.deepseek/mcp.json` | `~/.deepseek/mcp.json` | `~/.deepseek/mcp.json` |
|
|
138
|
+
|
|
139
|
+
### 2. Clear the npx cache
|
|
140
|
+
|
|
141
|
+
The MCP server binary is cached by npx. To remove it:
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
# macOS / Linux
|
|
145
|
+
npx -y clear-npx-cache
|
|
146
|
+
# or manually:
|
|
147
|
+
rm -rf ~/.npm/_npx
|
|
148
|
+
|
|
149
|
+
# Windows (PowerShell)
|
|
150
|
+
Remove-Item -Recurse -Force "$env:USERPROFILE\.npm\_npx"
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
### 3. Revoke your API key
|
|
154
|
+
|
|
155
|
+
Your elastic.io API key is stored in plain text in each config file listed above. After removing the config entries:
|
|
156
|
+
|
|
157
|
+
1. Log in to your elastic.io account
|
|
158
|
+
2. Go to your profile page
|
|
159
|
+
3. Regenerate your API key
|
|
160
|
+
|
|
161
|
+
This invalidates the old key even if a copy remains on disk.
|
|
162
|
+
|
|
163
|
+
> **Security note:** Keep your MCP credentials secret and revoke them without delay if you suspect they may have been compromised.
|
|
164
|
+
|
|
165
|
+
### 4. Restart your AI clients
|
|
166
|
+
|
|
167
|
+
Restart any AI clients that were configured to pick up the changes.
|
|
168
|
+
|
|
169
|
+
---
|
|
170
|
+
|
|
171
|
+
## Licence
|
|
172
|
+
|
|
173
|
+
This package is open-source under the [Apache 2.0](./LICENSE) licence. Connecting it to the elastic.io platform is subject to the Terms of Use above.
|
package/dist/api/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/api/client.ts"],"names":[],"mappings":"AAAA,OAAc,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AA+B7C,qBAAa,iBAAkB,SAAQ,KAAK;IACnC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,GAAG,EAAE,CAAC;gBAET,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE,OAAO,EAAE,MAAM;CAQnF;AAED,qBAAa,qBAAsB,SAAQ,KAAK;gBAClC,OAAO,EAAE,MAAM;CAK5B;
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/api/client.ts"],"names":[],"mappings":"AAAA,OAAc,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AA+B7C,qBAAa,iBAAkB,SAAQ,KAAK;IACnC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,GAAG,EAAE,CAAC;gBAET,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE,OAAO,EAAE,MAAM;CAQnF;AAED,qBAAa,qBAAsB,SAAQ,KAAK;gBAClC,OAAO,EAAE,MAAM;CAK5B;AAMD,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,aAAa,CAyF5F"}
|
package/dist/api/client.js
CHANGED
|
@@ -24,7 +24,7 @@ function formatPayloadForLog(data) {
|
|
|
24
24
|
}
|
|
25
25
|
return ` - Payload: ${str}`;
|
|
26
26
|
}
|
|
27
|
-
catch
|
|
27
|
+
catch {
|
|
28
28
|
return ' - Payload: [Error formatting payload]';
|
|
29
29
|
}
|
|
30
30
|
}
|
|
@@ -48,8 +48,11 @@ export class ElasticioNetworkError extends Error {
|
|
|
48
48
|
Object.setPrototypeOf(this, ElasticioNetworkError.prototype);
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
|
+
function ensureV2Suffix(url) {
|
|
52
|
+
return url.endsWith('/v2') ? url : `${url.replace(/\/+$/, '')}/v2`;
|
|
53
|
+
}
|
|
51
54
|
export function createElasticioClient(authHeader, apiBaseUrl) {
|
|
52
|
-
const baseURL = apiBaseUrl || process.env.ELASTICIO_API_BASE_URL || DEFAULT_BASE_URL;
|
|
55
|
+
const baseURL = ensureV2Suffix(apiBaseUrl || process.env.ELASTICIO_API_BASE_URL || DEFAULT_BASE_URL);
|
|
53
56
|
const client = axios.create({
|
|
54
57
|
baseURL,
|
|
55
58
|
timeout: 30000,
|
|
@@ -79,7 +82,9 @@ export function createElasticioClient(authHeader, apiBaseUrl) {
|
|
|
79
82
|
const configWithRetry = config;
|
|
80
83
|
configWithRetry.__retryCount = configWithRetry.__retryCount || 0;
|
|
81
84
|
const maxRetries = 3;
|
|
82
|
-
|
|
85
|
+
// A timeout on a write is ambiguous: replaying POST/PATCH can duplicate effects.
|
|
86
|
+
const safeToRetry = ['get', 'head', 'options'].includes(String(config.method || 'get').toLowerCase());
|
|
87
|
+
if (safeToRetry && (isRateLimit || isTransientError || isNetworkOrTimeout) && configWithRetry.__retryCount < maxRetries) {
|
|
83
88
|
configWithRetry.__retryCount += 1;
|
|
84
89
|
const delay = Math.pow(2, configWithRetry.__retryCount) * 1000;
|
|
85
90
|
logger.warn(`[HTTP Retry] ${isNetworkOrTimeout ? 'Network/Timeout Error' : `Status ${status}`} on ${config.method?.toUpperCase()} ${config.url}. Retrying in ${delay / 1000}s (Attempt ${configWithRetry.__retryCount}/${maxRetries})...`);
|
package/dist/api/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/api/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,MAAM,gBAAgB,GAAG,2BAA2B,CAAC;AAGrD,SAAS,mBAAmB,CAAC,IAAS;IACpC,IAAI,CAAC,IAAI;QAAE,OAAO,EAAE,CAAC;IACrB,IAAI,CAAC;QACH,IAAI,UAAU,GAAG,IAAI,CAAC;QACtB,IAAI,SAAS,GAAG,KAAK,CAAC;QACtB,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;YAC7B,IAAI,CAAC;gBACH,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;gBAC9B,SAAS,GAAG,IAAI,CAAC;YACnB,CAAC;YAAC,MAAM,CAAC;gBACP,aAAa;YACf,CAAC;QACH,CAAC;QACD,MAAM,MAAM,GAAG,iBAAiB,CAAC,UAAU,CAAC,CAAC;QAC7C,MAAM,GAAG,GAAG,SAAS,IAAI,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAA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AAC,CAAC;QACjG,CAAC;QAED,MAAM,CAAC,KAAK,CAAC,mBAAmB,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;QACjD,MAAM,IAAI,qBAAqB,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACjD,CAAC,CACF,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/dist/api/jsonapi.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
interface PaginationMeta {
|
|
2
2
|
page: number;
|
|
3
3
|
perPage: number;
|
|
4
4
|
totalPages: number;
|
|
@@ -17,12 +17,5 @@ export declare function deserializeJsonApi<T = any>(payload: any): T;
|
|
|
17
17
|
* Deserializes a JSON API response and preserves pagination metadata.
|
|
18
18
|
*/
|
|
19
19
|
export declare function deserializeWithMeta<T = any>(payload: any): DeserializedResult<T>;
|
|
20
|
-
|
|
21
|
-
* Serializes a clean JavaScript object into a JSON API compliant request payload.
|
|
22
|
-
*
|
|
23
|
-
* @param model The resource type (e.g., 'flows', 'workspaces')
|
|
24
|
-
* @param data The payload data to serialize
|
|
25
|
-
* @param method The HTTP method of the request ('POST', 'PATCH', etc.)
|
|
26
|
-
*/
|
|
27
|
-
export declare function serializeJsonApi(model: string, data: any, method?: 'POST' | 'PATCH' | 'PUT' | 'GET'): any;
|
|
20
|
+
export {};
|
|
28
21
|
//# sourceMappingURL=jsonapi.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jsonapi.d.ts","sourceRoot":"","sources":["../../src/api/jsonapi.ts"],"names":[],"mappings":"AAEA,
|
|
1
|
+
{"version":3,"file":"jsonapi.d.ts","sourceRoot":"","sources":["../../src/api/jsonapi.ts"],"names":[],"mappings":"AAEA,UAAU,cAAc;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,kBAAkB,CAAC,CAAC,GAAG,GAAG;IACzC,IAAI,EAAE,CAAC,CAAC;IACR,IAAI,CAAC,EAAE,cAAc,CAAC;CACvB;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,GAAG,GAAG,EAAE,OAAO,EAAE,GAAG,GAAG,CAAC,CAM3D;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,GAAG,GAAG,EAAE,OAAO,EAAE,GAAG,GAAG,kBAAkB,CAAC,CAAC,CAAC,CAehF"}
|
package/dist/api/jsonapi.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { deserialise
|
|
1
|
+
import { deserialise } from 'kitsu-core';
|
|
2
2
|
/**
|
|
3
3
|
* Deserializes a JSON API response payload (with data, attributes, relationships, etc.)
|
|
4
4
|
* into a clean JavaScript object or array of objects.
|
|
@@ -29,17 +29,4 @@ export function deserializeWithMeta(payload) {
|
|
|
29
29
|
} : undefined
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
|
-
/**
|
|
33
|
-
* Serializes a clean JavaScript object into a JSON API compliant request payload.
|
|
34
|
-
*
|
|
35
|
-
* @param model The resource type (e.g., 'flows', 'workspaces')
|
|
36
|
-
* @param data The payload data to serialize
|
|
37
|
-
* @param method The HTTP method of the request ('POST', 'PATCH', etc.)
|
|
38
|
-
*/
|
|
39
|
-
export function serializeJsonApi(model, data, method = 'POST') {
|
|
40
|
-
return serialise(model, data, method, {
|
|
41
|
-
camelCaseTypes: (s) => s,
|
|
42
|
-
pluralTypes: (s) => s
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
32
|
//# sourceMappingURL=jsonapi.js.map
|
package/dist/api/jsonapi.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jsonapi.js","sourceRoot":"","sources":["../../src/api/jsonapi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"j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":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/api/logger.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/api/logger.ts"],"names":[],"mappings":"AAMA,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AA2C3D,eAAO,MAAM,MAAM;qBACA,MAAM,WAAW,GAAG,EAAE;oBACvB,MAAM,WAAW,GAAG,EAAE;oBACtB,MAAM,WAAW,GAAG,EAAE;qBACrB,MAAM,WAAW,GAAG,EAAE;CACxC,CAAC"}
|
package/dist/api/logger.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import fs from 'fs';
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import process from 'node:process';
|
|
2
3
|
// Write to file only when LOG_FILE env var is set (for local development)
|
|
3
4
|
const LOG_FILE = process.env.LOG_FILE;
|
|
4
5
|
const LogLevels = {
|
|
@@ -39,8 +40,4 @@ export const logger = {
|
|
|
39
40
|
warn: (message, ...args) => writeLog('WARN', message, ...args),
|
|
40
41
|
error: (message, ...args) => writeLog('ERROR', message, ...args),
|
|
41
42
|
};
|
|
42
|
-
// Maintain compatibility with existing code calling logMcp
|
|
43
|
-
export function logMcp(message) {
|
|
44
|
-
logger.info(message);
|
|
45
|
-
}
|
|
46
43
|
//# sourceMappingURL=logger.js.map
|