Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 27 additions & 4 deletions docs/reference/other-technologies/mcp.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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`:

Expand All @@ -248,7 +267,11 @@ Example `~/.openfeature-mcp.json`:
"OFREP": {
"baseUrl": "https://flags.example.com",
"bearerToken": "<your-token>",
"apiKey": "<your-api-key>"
"apiKey": "<your-api-key>",
"headers": {
"X-Custom-Header": "value"
},
"timeoutMs": 5000
}
}
```
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/sdks/client/kotlin.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
2 changes: 1 addition & 1 deletion docs/reference/sdks/client/swift.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
6 changes: 5 additions & 1 deletion docs/reference/sdks/client/web/angular.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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)
-->

<p align="center" class="github-badges">
Expand Down Expand Up @@ -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?
Expand Down
6 changes: 5 additions & 1 deletion docs/reference/sdks/client/web/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion docs/reference/sdks/client/web/react.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/sdks/server/dart.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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)
-->

<p align="center" class="github-badges">
Expand Down
9 changes: 5 additions & 4 deletions docs/reference/sdks/server/dotnet.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -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:**

Expand Down
17 changes: 16 additions & 1 deletion docs/reference/sdks/server/go.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/sdks/server/java.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
6 changes: 5 additions & 1 deletion docs/reference/sdks/server/javascript/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion docs/reference/sdks/server/javascript/nestjs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/sdks/server/php.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
2 changes: 1 addition & 1 deletion docs/reference/sdks/server/python.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
2 changes: 1 addition & 1 deletion docs/reference/sdks/server/ruby.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
2 changes: 1 addition & 1 deletion docs/reference/sdks/server/rust.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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)
-->

<p align="center" class="github-badges">
Expand Down
Loading