Skip to content
Merged
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
14 changes: 8 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
name: CI
on:
push:
branches-ignore:
- 'generated'
- 'codegen/**'
- 'integrated/**'
- 'stl-preview-head/**'
- 'stl-preview-base/**'
branches:
- '**'
- '!integrated/**'
- '!stl-preview-head/**'
- '!stl-preview-base/**'
- '!generated'
- '!codegen/**'
- 'codegen/stl/**'
pull_request:
branches-ignore:
- 'stl-preview-head/**'
Expand Down
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.1.0"
".": "0.2.0"
}
6 changes: 3 additions & 3 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 20
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev%2Fcontext.dev-a69e6793d72c7f91069972b64ff2e35b4ddfa62cd35d6451b7d63f95d5957951.yml
openapi_spec_hash: 8a77eef26c37dc2b63110169f0eef1f6
config_hash: 3c8ae3c713b0f5151a9be9b0cdeefb92
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev%2Fcontext.dev-c5d5abb4b31f6e352e3e02b47120e3f444377c1c564f141ebe0988b86ba5932e.yml
openapi_spec_hash: 8ef4803fbe33ae6472a4b8f660be7921
config_hash: a144af00e5e74176674d0ea954cc02c5
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Changelog

## 0.2.0 (2026-03-18)

Full Changelog: [v0.1.0...v0.2.0](https://github.com/brand-dot-dev/context-typescript-sdk/compare/v0.1.0...v0.2.0)

### Features

* **api:** api update ([50c0ae4](https://github.com/brand-dot-dev/context-typescript-sdk/commit/50c0ae45d4f06facdbb47a61500eb64784eec547))


### Chores

* **internal:** support x-stainless-mcp-client-permissions headers in MCP servers ([4676c22](https://github.com/brand-dot-dev/context-typescript-sdk/commit/4676c2225c175647bcaaa336c45f770b5973dc52))
* **internal:** tweak CI branches ([f9c3d86](https://github.com/brand-dot-dev/context-typescript-sdk/commit/f9c3d8651c90cbbb454cd8d8c22de1fcc1830704))

## 0.1.0 (2026-03-14)

Full Changelog: [v0.0.1...v0.1.0](https://github.com/brand-dot-dev/context-typescript-sdk/compare/v0.0.1...v0.1.0)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "context.dev",
"version": "0.1.0",
"version": "0.2.0",
"description": "The official TypeScript library for the Context Dev API",
"author": "Context Dev <hello@context.dev>",
"types": "dist/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/mcp-server/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"dxt_version": "0.2",
"name": "context.dev-mcp",
"version": "0.1.0",
"version": "0.2.0",
"description": "The official MCP Server for the Context Dev API",
"author": {
"name": "Context Dev",
Expand Down
2 changes: 1 addition & 1 deletion packages/mcp-server/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "context.dev-mcp",
"version": "0.1.0",
"version": "0.2.0",
"description": "The official MCP Server for the Context Dev API",
"author": "Context Dev <hello@context.dev>",
"types": "dist/index.d.ts",
Expand Down
30 changes: 29 additions & 1 deletion packages/mcp-server/src/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,37 @@ const newServer = async ({
}
}

// Parse x-stainless-mcp-client-permissions header to override permission options
//
// Note: Permissions are best-effort and intended to prevent clients from doing unexpected things;
// they're not a hard security boundary, so we allow arbitrary, client-driven overrides.
//
// See the Stainless MCP documentation for more details.
let effectiveMcpOptions = mcpOptions;
const clientPermissionsHeader = req.headers['x-stainless-mcp-client-permissions'];
if (typeof clientPermissionsHeader === 'string') {
try {
const parsed = JSON.parse(clientPermissionsHeader);
if (parsed && typeof parsed === 'object' && !Array.isArray(parsed)) {
effectiveMcpOptions = {
...mcpOptions,
...(typeof parsed.allow_http_gets === 'boolean' && { codeAllowHttpGets: parsed.allow_http_gets }),
...(Array.isArray(parsed.allowed_methods) && { codeAllowedMethods: parsed.allowed_methods }),
...(Array.isArray(parsed.blocked_methods) && { codeBlockedMethods: parsed.blocked_methods }),
};
getLogger().info(
{ clientPermissions: parsed },
'Overriding code execution permissions from x-stainless-mcp-client-permissions header',
);
}
} catch (error) {
getLogger().warn({ error }, 'Failed to parse x-stainless-mcp-client-permissions header');
}
}

await initMcpServer({
server: server,
mcpOptions: mcpOptions,
mcpOptions: effectiveMcpOptions,
clientOptions: {
...clientOptions,
...authOptions,
Expand Down
2 changes: 1 addition & 1 deletion packages/mcp-server/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const newMcpServer = async (stainlessApiKey: string | undefined) =>
new McpServer(
{
name: 'context_dev_api',
version: '0.1.0',
version: '0.2.0',
},
{
instructions: await getInstructions(stainlessApiKey),
Expand Down
245 changes: 245 additions & 0 deletions src/resources/brand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5660,6 +5660,251 @@ export interface BrandRetrieveByNameParams {
*/
name: string;

/**
* Optional country code (GL parameter) to specify the country. This affects the
* geographic location used for search queries.
*/
country_gl?:
| 'ad'
| 'ae'
| 'af'
| 'ag'
| 'ai'
| 'al'
| 'am'
| 'an'
| 'ao'
| 'aq'
| 'ar'
| 'as'
| 'at'
| 'au'
| 'aw'
| 'az'
| 'ba'
| 'bb'
| 'bd'
| 'be'
| 'bf'
| 'bg'
| 'bh'
| 'bi'
| 'bj'
| 'bm'
| 'bn'
| 'bo'
| 'br'
| 'bs'
| 'bt'
| 'bv'
| 'bw'
| 'by'
| 'bz'
| 'ca'
| 'cc'
| 'cd'
| 'cf'
| 'cg'
| 'ch'
| 'ci'
| 'ck'
| 'cl'
| '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sl'
| 'sm'
| 'sn'
| 'so'
| 'sr'
| 'st'
| 'sv'
| 'sy'
| 'sz'
| 'tc'
| 'td'
| 'tf'
| 'tg'
| 'th'
| 'tj'
| 'tk'
| 'tl'
| 'tm'
| 'tn'
| 'to'
| 'tr'
| 'tt'
| 'tv'
| 'tw'
| 'tz'
| 'ua'
| 'ug'
| 'um'
| 'us'
| 'uy'
| 'uz'
| 'va'
| 'vc'
| 've'
| 'vg'
| 'vi'
| 'vn'
| 'vu'
| 'wf'
| 'ws'
| 'ye'
| 'yt'
| 'za'
| 'zm'
| 'zw';

/**
* Optional parameter to force the language of the retrieved brand data.
*/
Expand Down
2 changes: 1 addition & 1 deletion src/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const VERSION = '0.1.0'; // x-release-please-version
export const VERSION = '0.2.0'; // x-release-please-version
1 change: 1 addition & 0 deletions tests/api-resources/brand.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ describe('resource brand', () => {
test.skip('retrieveByName: required and optional params', async () => {
const response = await client.brand.retrieveByName({
name: 'xxx',
country_gl: 'ad',
force_language: 'albanian',
maxSpeed: true,
timeoutMS: 1000,
Expand Down
Loading