mirror of
https://github.com/elastic/kibana.git
synced 2025-06-27 10:40:07 -04:00
## Summary This PR introduces the **1chat MCP server** in Kibana, exposed at the experimental `/api/mcp` endpoint behind a feature flag. It allows external MCP clients (e.g. Claude Desktop, Cursor, OpenAI Agents) to connect and use tools registered in the 1chat registry. ### MCP server - Implements a **stateless** MCP server following the MCP spec (Streamable HTTP transport). - Supports **API key** and **basic auth** for authentication. - Works with clients via: - **Streamable HTTP** with auth header - **STDIO** transport using `mcp-remote` proxy - Endpoint under a feature flag `xpack.onechat.mcpServer.enabled` - 1chat tools are scoped to the caller’s permissions, as determined by the auth header. ### Other changes - Implemented `KibanaMcpHttpTransport` (mcp http transport layer adapted to Kibana Core primitives) + tests ### Local testing Set ui setting: `onechat:mcpServer:enabled` to true E.g. add this to Claude Desktop: ``` { "mcpServers": { "elastic": { "command": "npx", "args": [ "mcp-remote", "https://{kbn}/api/mcp", "--header", "Authorization: ApiKey ${API_KEY}" ], "env": { "API_KEY": "..." } }, } } ``` ### Enable feature via API ``` POST kbn:/internal/kibana/settings/onechat:mcpServer:enabled {"value": true} ``` --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> |
||
---|---|---|
.. | ||
jest.config.js | ||
kibana.jsonc | ||
package.json | ||
README.md | ||
root_refs_config.ts | ||
run_type_check_cli.ts | ||
tsconfig.json |
@kbn/ts-type-check-cli
Empty package generated by @kbn/generate