kibana/x-pack/platform/plugins/shared/onechat/tsconfig.json
Jedr Blaszyk 8c6fc9e21c
[1chat] MCP Server that can expose 1chat tools (#222231)
## 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>
2025-06-11 15:16:08 +02:00

41 lines
944 B
JSON

{
"extends": "../../../../../tsconfig.base.json",
"compilerOptions": {
"outDir": "target/types"
},
"include": [
"../../../../../typings/**/*",
"common/**/*",
"public/**/*",
"server/**/*",
],
"exclude": [
"target/**/*",
".storybook/**/*.js"
],
"kbn_references": [
"@kbn/core",
"@kbn/logging",
"@kbn/actions-plugin",
"@kbn/config-schema",
"@kbn/inference-plugin",
"@kbn/onechat-server",
"@kbn/core-http-server",
"@kbn/core-http-server-mocks",
"@kbn/onechat-common",
"@kbn/core-elasticsearch-server",
"@kbn/core-security-server",
"@kbn/inference-common",
"@kbn/logging-mocks",
"@kbn/zod",
"@kbn/inference-langchain",
"@kbn/storage-adapter",
"@kbn/sse-utils",
"@kbn/sse-utils-client",
"@kbn/sse-utils-server",
"@kbn/core-http-browser",
"@kbn/features-plugin",
"@kbn/core-logging-server-mocks",
"@kbn/i18n"
]
}