lemura 1.4.0 → 1.4.1

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/CHANGELOG.md CHANGED
@@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [1.4.1] - 2026-05-07
9
+
10
+ ### Added
11
+
12
+ - **MCP Custom Headers**: `MCPServerConfig` now supports a `headers` field for `http` and `sse` transports. This allows passing custom headers (e.g., `Authorization: Bearer <token>`) to remote MCP servers.
13
+
14
+ ### Fixed
15
+
16
+ - **MCP HTTP Authentication**: `MCPClient` now correctly includes custom headers from the server configuration in all JSON-RPC calls and initialization notifications, fixing issues where authenticated MCP servers would return 401 Unauthorized.
17
+
8
18
  ## [1.4.0] - 2026-03-14
9
19
 
10
20
  ### Added
package/README.md CHANGED
@@ -14,11 +14,11 @@
14
14
 
15
15
  `lemura` is a robust, provider-agnostic npm package designed to encapsulate a full agentic AI runtime. It simplifies the complex orchestration of LLMs, tools, and context management into a single, cohesive interface.
16
16
 
17
- ### ✨ Key Features in v1.4.0
17
+ ### ✨ Key Features in v1.4.1
18
18
  - **🧠 Dynamic Skill Market**: Switch skills on/off at runtime via tags, names, or tool dependencies.
19
19
  - **🗺️ Continuation Planning**: Multi-step tool chains with parallel execution and conditional logic.
20
20
  - **🎯 Intelligent Goal Maintenance**: LLM-powered sub-goal decomposition and status tracking.
21
- - **🔌 MCP Support**: Native Model Context Protocol integration for connecting to external tool servers.
21
+ - **🔌 MCP Support**: Native Model Context Protocol integration with **custom header support** (auth).
22
22
  - **🛡️ Tool Firewall**: Fully integrated ask/accept/deny policy layer for security.
23
23
  - **⚡ Parallel Tool Calls**: Execute independent tools concurrently for reduced latency.
24
24
  - **🧹 Summary Injection**: ensures the model never "forgets" what was compressed away.
@@ -55,6 +55,11 @@ interface MCPServerConfig {
55
55
  * `{ GITHUB_TOKEN: process.env.GITHUB_TOKEN! }`
56
56
  */
57
57
  env?: Record<string, string>;
58
+ /**
59
+ * For `http`/`sse`: custom headers to include in requests.
60
+ * @example { Authorization: 'Bearer <token>' }
61
+ */
62
+ headers?: Record<string, string>;
58
63
  /**
59
64
  * Per-call timeout in milliseconds. Defaults to `30_000`.
60
65
  */
@@ -55,6 +55,11 @@ interface MCPServerConfig {
55
55
  * `{ GITHUB_TOKEN: process.env.GITHUB_TOKEN! }`
56
56
  */
57
57
  env?: Record<string, string>;
58
+ /**
59
+ * For `http`/`sse`: custom headers to include in requests.
60
+ * @example { Authorization: 'Bearer <token>' }
61
+ */
62
+ headers?: Record<string, string>;
58
63
  /**
59
64
  * Per-call timeout in milliseconds. Defaults to `30_000`.
60
65
  */
package/dist/index.d.mts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { a as IProviderAdapter, T as TranscriptionRequest, d as TranscriptionResponse, e as SynthesisRequest, A as AudioChunk, V as VisionRequest, f as VisionResponse, g as ImageGenRequest, h as ImageGenResponse, M as ModelInfo, C as ContextWindow, i as Turn, j as ContentBlock, I as IToolDefinition } from './adapters-BhTAnrOM.mjs';
2
2
  export { k as CompletionChunk, l as CompletionRequest, m as CompletionResponse, b as IContextStrategy, c as IScratchpadAdapter, n as IStorageAdapter, N as NormalizedMessage, o as STMItem, p as STMRegistryConfig, S as ShortTermMemoryRegistry, q as TokenUsage, r as ToolCall, s as ToolContext, t as ToolResult } from './adapters-BhTAnrOM.mjs';
3
- import { S as SessionConfig, I as IToolResponseProcessor, T as ToolResponseEvaluation, M as MCPServerConfig, a as MCPToolDefinition } from './agent-CJvmcAbT.mjs';
4
- export { b as MCPJsonRpcRequest, c as MCPJsonRpcResponse, d as MCPTransportType, e as MediaConfig, f as ToolDecision, g as ToolExecutionBudget, h as ToolFirewallConfig, i as ToolFirewallRule, j as TraceEvent } from './agent-CJvmcAbT.mjs';
3
+ import { S as SessionConfig, I as IToolResponseProcessor, T as ToolResponseEvaluation, M as MCPServerConfig, a as MCPToolDefinition } from './agent-DfN5nNXc.mjs';
4
+ export { b as MCPJsonRpcRequest, c as MCPJsonRpcResponse, d as MCPTransportType, e as MediaConfig, f as ToolDecision, g as ToolExecutionBudget, h as ToolFirewallConfig, i as ToolFirewallRule, j as TraceEvent } from './agent-DfN5nNXc.mjs';
5
5
  export { LemuraAdapterError, LemuraContextOverflowError, LemuraError, LemuraMCPConnectionError, LemuraMCPError, LemuraMCPTimeoutError, LemuraMaxIterationsError, LemuraSkillInjectionError, LemuraToolNotFoundError, LemuraToolTimeoutError, LemuraToolValidationError } from './types/index.mjs';
6
6
  import { I as ILogger } from './logger-DxvKliuk.mjs';
7
7
  export { L as LogLevel, a as LogMetadata, S as Severity } from './logger-DxvKliuk.mjs';
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { a as IProviderAdapter, T as TranscriptionRequest, d as TranscriptionResponse, e as SynthesisRequest, A as AudioChunk, V as VisionRequest, f as VisionResponse, g as ImageGenRequest, h as ImageGenResponse, M as ModelInfo, C as ContextWindow, i as Turn, j as ContentBlock, I as IToolDefinition } from './adapters-CVcfWf85.js';
2
2
  export { k as CompletionChunk, l as CompletionRequest, m as CompletionResponse, b as IContextStrategy, c as IScratchpadAdapter, n as IStorageAdapter, N as NormalizedMessage, o as STMItem, p as STMRegistryConfig, S as ShortTermMemoryRegistry, q as TokenUsage, r as ToolCall, s as ToolContext, t as ToolResult } from './adapters-CVcfWf85.js';
3
- import { S as SessionConfig, I as IToolResponseProcessor, T as ToolResponseEvaluation, M as MCPServerConfig, a as MCPToolDefinition } from './agent-38El9_yp.js';
4
- export { b as MCPJsonRpcRequest, c as MCPJsonRpcResponse, d as MCPTransportType, e as MediaConfig, f as ToolDecision, g as ToolExecutionBudget, h as ToolFirewallConfig, i as ToolFirewallRule, j as TraceEvent } from './agent-38El9_yp.js';
3
+ import { S as SessionConfig, I as IToolResponseProcessor, T as ToolResponseEvaluation, M as MCPServerConfig, a as MCPToolDefinition } from './agent-DTcDIKIn.js';
4
+ export { b as MCPJsonRpcRequest, c as MCPJsonRpcResponse, d as MCPTransportType, e as MediaConfig, f as ToolDecision, g as ToolExecutionBudget, h as ToolFirewallConfig, i as ToolFirewallRule, j as TraceEvent } from './agent-DTcDIKIn.js';
5
5
  export { LemuraAdapterError, LemuraContextOverflowError, LemuraError, LemuraMCPConnectionError, LemuraMCPError, LemuraMCPTimeoutError, LemuraMaxIterationsError, LemuraSkillInjectionError, LemuraToolNotFoundError, LemuraToolTimeoutError, LemuraToolValidationError } from './types/index.js';
6
6
  import { I as ILogger } from './logger-DxvKliuk.js';
7
7
  export { L as LogLevel, a as LogMetadata, S as Severity } from './logger-DxvKliuk.js';
package/dist/index.js CHANGED
@@ -2280,7 +2280,11 @@ var MCPClient = class {
2280
2280
  try {
2281
2281
  const res = await fetch(url, {
2282
2282
  method: "POST",
2283
- headers: { "Content-Type": "application/json", "Accept": "application/json" },
2283
+ headers: {
2284
+ "Content-Type": "application/json",
2285
+ "Accept": "application/json",
2286
+ ...this.config.headers
2287
+ },
2284
2288
  body: JSON.stringify(request),
2285
2289
  signal: controller.signal
2286
2290
  });
@@ -2339,7 +2343,10 @@ var MCPClient = class {
2339
2343
  } else if (this.config.transport !== "stdio") {
2340
2344
  fetch(this.config.url, {
2341
2345
  method: "POST",
2342
- headers: { "Content-Type": "application/json" },
2346
+ headers: {
2347
+ "Content-Type": "application/json",
2348
+ ...this.config.headers
2349
+ },
2343
2350
  body: initializedNotif
2344
2351
  }).catch(() => {
2345
2352
  });