diff --git a/docs/reference/other-technologies/mcp.mdx b/docs/reference/other-technologies/mcp.mdx index 7729b078f..5bfd64d8d 100644 --- a/docs/reference/other-technologies/mcp.mdx +++ b/docs/reference/other-technologies/mcp.mdx @@ -234,12 +234,31 @@ Supports both single flag and bulk evaluation. To use OFREP flag evaluation features, configure authentication and endpoint details. The server checks configuration in this priority order: -1. **Environment Variables** - - `OPENFEATURE_OFREP_BASE_URL` or `OFREP_BASE_URL` +1. **Tool Arguments** + - `base_url` + - `auth.bearer_token` / `auth.api_key` + +2. **Environment Variables** + - `OFREP_ENDPOINT` (preferred) or `OPENFEATURE_OFREP_BASE_URL` / `OFREP_BASE_URL` + - `OFREP_HEADERS` (comma-separated `key=value` pairs, URL-decoded before parsing) + - `OFREP_TIMEOUT_MS` (positive integer milliseconds) - `OPENFEATURE_OFREP_BEARER_TOKEN` or `OFREP_BEARER_TOKEN` - `OPENFEATURE_OFREP_API_KEY` or `OFREP_API_KEY` -2. **Configuration File**: `~/.openfeature-mcp.json` +3. **Configuration File**: `~/.openfeature-mcp.json` + +`OFREP_HEADERS` parsing follows the OFREP protocol convention: + +- URL-decode the full value first +- Split by comma into header pairs +- Split each pair by the first equals sign (`=`) +- Trim whitespace around keys/values +- Skip malformed entries + +Examples: + +- `OFREP_HEADERS=Authorization=Bearer%20token,X-Custom=value` +- `OFREP_TIMEOUT_MS=5000` Example `~/.openfeature-mcp.json`: @@ -248,7 +267,11 @@ Example `~/.openfeature-mcp.json`: "OFREP": { "baseUrl": "https://flags.example.com", "bearerToken": "", - "apiKey": "" + "apiKey": "", + "headers": { + "X-Custom-Header": "value" + }, + "timeoutMs": 5000 } } ``` diff --git a/docs/reference/sdks/client/kotlin.mdx b/docs/reference/sdks/client/kotlin.mdx index ea0395c1f..b0eb515fb 100644 --- a/docs/reference/sdks/client/kotlin.mdx +++ b/docs/reference/sdks/client/kotlin.mdx @@ -10,7 +10,7 @@ This content has been automatically generated from kotlin-sdk. Edits should be made here: https://github.com/open-feature/kotlin-sdk Once a repo has been updated, docs can be generated by running: yarn update:sdk-docs -Last updated at Fri Mar 27 2026 08:23:35 GMT+0000 (Coordinated Universal Time) +Last updated at Fri Apr 03 2026 08:25:30 GMT+0000 (Coordinated Universal Time) --> import MCPInstall from '@site/src/partials/mcp-install'; diff --git a/docs/reference/sdks/client/swift.mdx b/docs/reference/sdks/client/swift.mdx index 9a3f98def..0cc5b40f4 100644 --- a/docs/reference/sdks/client/swift.mdx +++ b/docs/reference/sdks/client/swift.mdx @@ -10,7 +10,7 @@ This content has been automatically generated from swift-sdk. Edits should be made here: https://github.com/open-feature/swift-sdk Once a repo has been updated, docs can be generated by running: yarn update:sdk-docs -Last updated at Fri Mar 27 2026 08:23:36 GMT+0000 (Coordinated Universal Time) +Last updated at Fri Apr 03 2026 08:25:30 GMT+0000 (Coordinated Universal Time) --> import MCPInstall from '@site/src/partials/mcp-install'; diff --git a/docs/reference/sdks/client/web/angular.mdx b/docs/reference/sdks/client/web/angular.mdx index d6721f977..32c8acf2c 100644 --- a/docs/reference/sdks/client/web/angular.mdx +++ b/docs/reference/sdks/client/web/angular.mdx @@ -10,7 +10,7 @@ This content has been automatically generated from js-sdk. Edits should be made here: https://github.com/open-feature/js-sdk Once a repo has been updated, docs can be generated by running: yarn update:sdk-docs -Last updated at Fri Mar 27 2026 08:23:36 GMT+0000 (Coordinated Universal Time) +Last updated at Fri Apr 03 2026 08:25:30 GMT+0000 (Coordinated Universal Time) -->

@@ -418,6 +418,10 @@ The [OpenFeature debounce hook](https://github.com/open-feature/js-sdk-contrib/t to reduce the amount of redundant evaluations reported to your observability platform by limiting the frequency at which evaluation metrics are reported. +#### Type-Safe Flag Keys + +For enhanced type safety and autocompletion, you can override flag key types using TypeScript module augmentation. See the [`@openfeature/core` README](https://github.com/open-feature/js-sdk/blob/main/packages/shared/README.md#type-safe-flag-keys) for details. + ## FAQ and troubleshooting > I can import things form the `@openfeature/angular-sdk`, `@openfeature/web-sdk`, and `@openfeature/core`; which should I use? diff --git a/docs/reference/sdks/client/web/index.mdx b/docs/reference/sdks/client/web/index.mdx index 7349f2b3e..fd3442b17 100644 --- a/docs/reference/sdks/client/web/index.mdx +++ b/docs/reference/sdks/client/web/index.mdx @@ -10,7 +10,7 @@ This content has been automatically generated from js-sdk. Edits should be made here: https://github.com/open-feature/js-sdk Once a repo has been updated, docs can be generated by running: yarn update:sdk-docs -Last updated at Fri Mar 27 2026 08:23:35 GMT+0000 (Coordinated Universal Time) +Last updated at Fri Apr 03 2026 08:25:29 GMT+0000 (Coordinated Universal Time) --> import MCPInstall from '@site/src/partials/mcp-install'; @@ -370,6 +370,10 @@ import { OpenFeature } from '@openfeature/web-sdk'; await OpenFeature.close(); ``` +### Type-Safe Flag Keys + +For enhanced type safety and autocompletion, you can override flag key types using TypeScript module augmentation. See the [`@openfeature/core` README](https://github.com/open-feature/js-sdk/blob/main/packages/shared/README.md#type-safe-flag-keys) for details. + ## Extending ### Develop a provider diff --git a/docs/reference/sdks/client/web/react.mdx b/docs/reference/sdks/client/web/react.mdx index c5837dc95..41ecd58bf 100644 --- a/docs/reference/sdks/client/web/react.mdx +++ b/docs/reference/sdks/client/web/react.mdx @@ -10,7 +10,7 @@ This content has been automatically generated from js-sdk. Edits should be made here: https://github.com/open-feature/js-sdk Once a repo has been updated, docs can be generated by running: yarn update:sdk-docs -Last updated at Fri Mar 27 2026 08:23:35 GMT+0000 (Coordinated Universal Time) +Last updated at Fri Apr 03 2026 08:25:30 GMT+0000 (Coordinated Universal Time) --> import MCPInstall from '@site/src/partials/mcp-install'; @@ -371,6 +371,10 @@ React's lifecycle can result in flags being evaluated multiple times as a user i If you are using an OpenFeature hook for telemetry, this can result in inflated evaluation metrics. The [OpenFeature debounce hook](https://github.com/open-feature/js-sdk-contrib/tree/main/libs/hooks/debounce) can help to reduce the amount of redundant evaluations reported to your observability platform by limiting the frequency at which evaluation metrics are reported. +#### Type-Safe Flag Keys + +For enhanced type safety and autocompletion, you can override flag key types using TypeScript module augmentation. See the [`@openfeature/core` README](https://github.com/open-feature/js-sdk/blob/main/packages/shared/README.md#type-safe-flag-keys) for details. + ### Testing The React SDK includes a built-in context provider for testing. diff --git a/docs/reference/sdks/server/dart.mdx b/docs/reference/sdks/server/dart.mdx index e64bde553..d235d4da8 100644 --- a/docs/reference/sdks/server/dart.mdx +++ b/docs/reference/sdks/server/dart.mdx @@ -9,7 +9,7 @@ This content has been automatically generated from dart-server-sdk. Edits should be made here: https://github.com/open-feature/dart-server-sdk Once a repo has been updated, docs can be generated by running: yarn update:sdk-docs -Last updated at Fri Mar 27 2026 08:23:36 GMT+0000 (Coordinated Universal Time) +Last updated at Fri Apr 03 2026 08:25:30 GMT+0000 (Coordinated Universal Time) -->

diff --git a/docs/reference/sdks/server/dotnet.mdx b/docs/reference/sdks/server/dotnet.mdx index d8b4b1886..871840ce5 100644 --- a/docs/reference/sdks/server/dotnet.mdx +++ b/docs/reference/sdks/server/dotnet.mdx @@ -10,7 +10,7 @@ This content has been automatically generated from dotnet-sdk. Edits should be made here: https://github.com/open-feature/dotnet-sdk Once a repo has been updated, docs can be generated by running: yarn update:sdk-docs -Last updated at Fri Mar 27 2026 08:23:35 GMT+0000 (Coordinated Universal Time) +Last updated at Fri Apr 03 2026 08:25:29 GMT+0000 (Coordinated Universal Time) --> import MCPInstall from '@site/src/partials/mcp-install'; @@ -89,9 +89,10 @@ public async Task Example() The [`samples/`](https://github.com/open-feature/dotnet-sdk/blob/main/samples) folder contains example applications demonstrating how to use OpenFeature in different .NET scenarios. -| Sample Name | Description | -| ------------------------------------------- | ----------------------------------------- | -| [AspNetCore](https://github.com/open-feature/dotnet-sdk/blob/main/samples/AspNetCore/README.md) | Feature flags in an ASP.NET Core Web API. | +| Sample Name | Description | +| ----------------------------------------------------- | ----------------------------------------- | +| [AspNetCore](https://github.com/open-feature/dotnet-sdk/blob/main/samples/AspNetCore/README.md) | Feature flags in an ASP.NET Core Web API. | +| [Console](https://github.com/open-feature/dotnet-sdk/blob/main/samples/Console/README.md) | Feature flags in a .NET console app. | **Getting Started with a Sample:** diff --git a/docs/reference/sdks/server/go.mdx b/docs/reference/sdks/server/go.mdx index e762c3f9c..a4219986e 100644 --- a/docs/reference/sdks/server/go.mdx +++ b/docs/reference/sdks/server/go.mdx @@ -9,7 +9,7 @@ This content has been automatically generated from go-sdk. Edits should be made here: https://github.com/open-feature/go-sdk Once a repo has been updated, docs can be generated by running: yarn update:sdk-docs -Last updated at Fri Mar 27 2026 08:23:35 GMT+0000 (Coordinated Universal Time) +Last updated at Fri Apr 03 2026 08:25:29 GMT+0000 (Coordinated Universal Time) --> import MCPInstall from '@site/src/partials/mcp-install'; @@ -514,6 +514,21 @@ for name, tt := range tests { } ``` +If your test code runs in a different goroutine, `TestProvider.UsingFlags` returns a context that should be used for evaluations. + +You can pass `*testing.T` directly. + +```go +// In your test, 't' is a *testing.T +ctx := testProvider.UsingFlags(t, tt.flags) + +go func() { + // Make sure to use the context returned by UsingFlags in the new goroutine. + // The context carries the necessary information for the TestProvider. + _ = openfeature.NewDefaultClient().Boolean(ctx, "my_flag", false, openfeature.EvaluationContext{}) +}() +``` + ### Mocks Mocks are also available for testing purposes for all interfaces within the OpenFeature SDK. These are primarily diff --git a/docs/reference/sdks/server/java.mdx b/docs/reference/sdks/server/java.mdx index 86b9fdfd6..4e2580f07 100644 --- a/docs/reference/sdks/server/java.mdx +++ b/docs/reference/sdks/server/java.mdx @@ -9,7 +9,7 @@ This content has been automatically generated from java-sdk. Edits should be made here: https://github.com/open-feature/java-sdk Once a repo has been updated, docs can be generated by running: yarn update:sdk-docs -Last updated at Fri Mar 27 2026 08:23:35 GMT+0000 (Coordinated Universal Time) +Last updated at Fri Apr 03 2026 08:25:29 GMT+0000 (Coordinated Universal Time) --> import MCPInstall from '@site/src/partials/mcp-install'; diff --git a/docs/reference/sdks/server/javascript/index.mdx b/docs/reference/sdks/server/javascript/index.mdx index 882e73a1d..e1cce0536 100644 --- a/docs/reference/sdks/server/javascript/index.mdx +++ b/docs/reference/sdks/server/javascript/index.mdx @@ -10,7 +10,7 @@ This content has been automatically generated from js-sdk. Edits should be made here: https://github.com/open-feature/js-sdk Once a repo has been updated, docs can be generated by running: yarn update:sdk-docs -Last updated at Fri Mar 27 2026 08:23:35 GMT+0000 (Coordinated Universal Time) +Last updated at Fri Apr 03 2026 08:25:29 GMT+0000 (Coordinated Universal Time) --> import MCPInstall from '@site/src/partials/mcp-install'; @@ -393,6 +393,10 @@ import { OpenFeature } from '@openfeature/server-sdk'; await OpenFeature.close(); ``` +### Type-Safe Flag Keys + +For enhanced type safety and autocompletion, you can override flag key types using TypeScript module augmentation. See the [`@openfeature/core` README](https://github.com/open-feature/js-sdk/blob/main/packages/shared/README.md#type-safe-flag-keys) for details. + ## Extending ### Develop a provider diff --git a/docs/reference/sdks/server/javascript/nestjs.mdx b/docs/reference/sdks/server/javascript/nestjs.mdx index b94869fcd..bd9619191 100644 --- a/docs/reference/sdks/server/javascript/nestjs.mdx +++ b/docs/reference/sdks/server/javascript/nestjs.mdx @@ -10,7 +10,7 @@ This content has been automatically generated from js-sdk. Edits should be made here: https://github.com/open-feature/js-sdk Once a repo has been updated, docs can be generated by running: yarn update:sdk-docs -Last updated at Fri Mar 27 2026 08:23:35 GMT+0000 (Coordinated Universal Time) +Last updated at Fri Apr 03 2026 08:25:29 GMT+0000 (Coordinated Universal Time) --> import MCPInstall from '@site/src/partials/mcp-install'; @@ -172,6 +172,10 @@ export class OpenFeatureController { } ``` +#### Type-Safe Flag Keys + +For enhanced type safety and autocompletion, you can override flag key types using TypeScript module augmentation. See the [`@openfeature/core` README](https://github.com/open-feature/js-sdk/blob/main/packages/shared/README.md#type-safe-flag-keys) for details. + ## Module additional information ### Flag evaluation context injection diff --git a/docs/reference/sdks/server/php.mdx b/docs/reference/sdks/server/php.mdx index c4fd320bc..646428a65 100644 --- a/docs/reference/sdks/server/php.mdx +++ b/docs/reference/sdks/server/php.mdx @@ -9,7 +9,7 @@ This content has been automatically generated from php-sdk. Edits should be made here: https://github.com/open-feature/php-sdk Once a repo has been updated, docs can be generated by running: yarn update:sdk-docs -Last updated at Fri Mar 27 2026 08:23:35 GMT+0000 (Coordinated Universal Time) +Last updated at Fri Apr 03 2026 08:25:29 GMT+0000 (Coordinated Universal Time) --> import MCPInstall from '@site/src/partials/mcp-install'; diff --git a/docs/reference/sdks/server/python.mdx b/docs/reference/sdks/server/python.mdx index e37acd600..ed1f4baca 100644 --- a/docs/reference/sdks/server/python.mdx +++ b/docs/reference/sdks/server/python.mdx @@ -9,7 +9,7 @@ This content has been automatically generated from python-sdk. Edits should be made here: https://github.com/open-feature/python-sdk Once a repo has been updated, docs can be generated by running: yarn update:sdk-docs -Last updated at Fri Mar 27 2026 08:23:35 GMT+0000 (Coordinated Universal Time) +Last updated at Fri Apr 03 2026 08:25:29 GMT+0000 (Coordinated Universal Time) --> import MCPInstall from '@site/src/partials/mcp-install'; diff --git a/docs/reference/sdks/server/ruby.mdx b/docs/reference/sdks/server/ruby.mdx index a33811d1c..20ca78b57 100644 --- a/docs/reference/sdks/server/ruby.mdx +++ b/docs/reference/sdks/server/ruby.mdx @@ -10,7 +10,7 @@ This content has been automatically generated from ruby-sdk. Edits should be made here: https://github.com/open-feature/ruby-sdk Once a repo has been updated, docs can be generated by running: yarn update:sdk-docs -Last updated at Fri Mar 27 2026 08:23:36 GMT+0000 (Coordinated Universal Time) +Last updated at Fri Apr 03 2026 08:25:30 GMT+0000 (Coordinated Universal Time) --> import MCPInstall from '@site/src/partials/mcp-install'; diff --git a/docs/reference/sdks/server/rust.mdx b/docs/reference/sdks/server/rust.mdx index 3229959e0..16dccaa69 100644 --- a/docs/reference/sdks/server/rust.mdx +++ b/docs/reference/sdks/server/rust.mdx @@ -9,7 +9,7 @@ This content has been automatically generated from rust-sdk. Edits should be made here: https://github.com/open-feature/rust-sdk Once a repo has been updated, docs can be generated by running: yarn update:sdk-docs -Last updated at Fri Mar 27 2026 08:23:36 GMT+0000 (Coordinated Universal Time) +Last updated at Fri Apr 03 2026 08:25:31 GMT+0000 (Coordinated Universal Time) -->