豆豆友情提示:这是一个非官方 GitHub 代理镜像,主要用于网络测试或访问加速。请勿在此进行登录、注册或处理任何敏感信息。进行这些操作请务必访问官方网站 github.com。 Raw 内容也通过此代理提供。
Skip to content

Latest commit

 

History

History
71 lines (57 loc) · 1.9 KB

File metadata and controls

71 lines (57 loc) · 1.9 KB

Adding to VS Code

Three options depending on your setup.

Option 1: Via npx (no local setup required)

Requires Node.js 22+. The server is downloaded and run automatically by VS Code.

Add to .vscode/mcp.json:

{
  "servers": {
    "elastic-security": {
      "command": "npx",
      "args": [
        "-y",
        "https://github.com/elastic/example-mcp-app-security/releases/latest/download/elastic-security-mcp-app.tgz",
        "--stdio"
      ],
      "env": {
        "ELASTICSEARCH_URL": "https://your-cluster.es.cloud.example.com",
        "ELASTICSEARCH_API_KEY": "your-api-key",
        "KIBANA_URL": "https://your-cluster.kb.cloud.example.com"
      }
    }
  }
}

Pinning a version: Replace elastic-security-mcp-app.tgz with elastic-security-mcp-app-<version>.tgz (e.g., elastic-security-mcp-app-0.2.0.tgz).

Required credentials: Set ELASTICSEARCH_URL, ELASTICSEARCH_API_KEY, and KIBANA_URL. See Creating an API key for how to generate your credentials.

Option 2: Local server (stdio)

Requires the project to be built locally. VS Code launches the server process directly.

Add to .vscode/mcp.json:

{
  "servers": {
    "elastic-security": {
      "command": "node",
      "args": ["/path/to/example-mcp-app-security/dist/main.js", "--stdio"],
      "env": {
        "ELASTICSEARCH_URL": "https://your-cluster.es.cloud.example.com",
        "ELASTICSEARCH_API_KEY": "your-api-key",
        "KIBANA_URL": "https://your-cluster.kb.cloud.example.com"
      }
    }
  }
}

Option 3: Local server (HTTP)

Requires the server to be running locally at http://localhost:3001/mcp. VS Code connects over HTTP — the server process runs independently.

Add to .vscode/mcp.json:

{
  "servers": {
    "elastic-security": {
      "url": "http://localhost:3001/mcp"
    }
  }
}