Skip to content

release: 12.4.1 #601

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "12.4.0"
".": "12.4.1"
}
6 changes: 3 additions & 3 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 107
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mux%2Fmux-ba7ebfd893a1c5d082d55cddaec2ff9219072c9abd96442357aad1748e421483.yml
openapi_spec_hash: 94fd98fcb8414d6c70a6ad7593ffcfa4
config_hash: 06e26125693367671f74a6d70d1f3333
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mux%2Fmux-36cec1d12b890d6845ad299d5b91c7932665735cb23c07b66d88c0ca69f748fa.yml
openapi_spec_hash: ff994517cde080d3ec0a675d37364b6d
config_hash: 1e983ab8fc1f0ef27575b3a39f114bdc
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,33 @@
# Changelog

## 12.4.1 (2025-08-15)

Full Changelog: [v12.4.0...v12.4.1](https://github.com/muxinc/mux-node-sdk/compare/v12.4.0...v12.4.1)

### Features

* add support for CDN trace and trace dimension-specific API methods ([#365](https://github.com/muxinc/mux-node-sdk/issues/365)) ([1ba1635](https://github.com/muxinc/mux-node-sdk/commit/1ba1635bfdefce6f1900fa7d7b7407a19ed560e6))
* **mcp:** add unix socket option for remote MCP ([839d999](https://github.com/muxinc/mux-node-sdk/commit/839d999865094e8ddce0e56d1257d518b26bc858))


### Bug Fixes

* **mcp:** fix bug in header handling ([01d65d1](https://github.com/muxinc/mux-node-sdk/commit/01d65d1f88f722a71f674ffe95a65dcb9afdb2b0))
* **mcp:** fix jq type bug ([6b46735](https://github.com/muxinc/mux-node-sdk/commit/6b46735b637051fb54809fa606ab132c08843965))


### Chores

* **deps:** update dependency node-fetch to v2.6.13 ([5f509de](https://github.com/muxinc/mux-node-sdk/commit/5f509def4f289910ebaeb692c1b4b56b117ba055))
* **internal:** move publish config ([870995a](https://github.com/muxinc/mux-node-sdk/commit/870995abf7002274a9e8a7e7f3d9cf1e4c384b4c))
* **internal:** update comment in script ([8f6a4a0](https://github.com/muxinc/mux-node-sdk/commit/8f6a4a0906ac902beb21d5bb46451939f064b9d7))
* **mcp:** bump JQ version ([e5b6779](https://github.com/muxinc/mux-node-sdk/commit/e5b67797968191ab425f0fa6e52e5f2ee50242ba))
* **mcp:** document remote server in README.md ([3344229](https://github.com/muxinc/mux-node-sdk/commit/334422990ac35284a439e084953820542a23ef89))
* **mcp:** minor cleanup of types and package.json ([24097ba](https://github.com/muxinc/mux-node-sdk/commit/24097ba76b69b98d4fcea804c74524eef8f0bf77))
* **mcp:** refactor streamable http transport ([8b40da7](https://github.com/muxinc/mux-node-sdk/commit/8b40da7f2f93e110794664c1811c8412ce3534f3))
* **mcp:** update README ([2bdad30](https://github.com/muxinc/mux-node-sdk/commit/2bdad3016326d9e04b108839ffe2030ae9f4c1c0))
* update @stainless-api/prism-cli to v5.15.0 ([6d47536](https://github.com/muxinc/mux-node-sdk/commit/6d47536322556ca25805c16dff4e5ccb3bba41c6))

## 12.4.0 (2025-08-05)

Full Changelog: [v12.3.0...v12.4.0](https://github.com/muxinc/mux-node-sdk/compare/v12.3.0...v12.4.0)
Expand Down
2 changes: 1 addition & 1 deletion bin/publish-npm
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ else
fi

# Publish with the appropriate tag
yarn publish --access public --tag "$TAG"
yarn publish --tag "$TAG"
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mux/mux-node",
"version": "12.4.0",
"version": "12.4.1",
"description": "The official TypeScript library for the Mux API",
"author": "Mux <[email protected]>",
"types": "dist/index.d.ts",
Expand All @@ -13,6 +13,9 @@
"**/*"
],
"private": false,
"publishConfig": {
"access": "public"
},
"scripts": {
"test": "./scripts/test",
"build": "./scripts/build",
Expand Down
28 changes: 28 additions & 0 deletions packages/mcp-server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,34 @@ over time, you can manually enable or disable certain capabilities:
--resource=cards,accounts --operation=read --tag=kyc --no-tool=create_cards
```

## Running remotely

Launching the client with `--transport=http` launches the server as a remote server using Streamable HTTP transport. The `--port` setting can choose the port it will run on, and the `--socket` setting allows it to run on a Unix socket.

Authorization can be provided via the `Authorization` header using the Basic or Bearer scheme.

Additionally, authorization can be provided via the following headers:
| Header | Equivalent client option | Security scheme |
| --------------------------- | ------------------------ | ------------------ |
| `x-mux-token-id` | `tokenId` | accessToken |
| `x-mux-token-secret` | `tokenSecret` | accessToken |
| `x-mux-authorization-token` | `authorizationToken` | authorizationToken |

A configuration JSON for this server might look like this, assuming the server is hosted at `http://localhost:3000`:

```json
{
"mcpServers": {
"mux_mux_node_api": {
"url": "http://localhost:3000",
"headers": {
"Authorization": "Basic <auth value>"
}
}
}
}
```

## Importing the tools and server individually

```js
Expand Down
5 changes: 3 additions & 2 deletions packages/mcp-server/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mux/mcp",
"version": "12.4.0",
"version": "12.4.1",
"description": "The official MCP Server for the Mux API",
"author": "Mux <[email protected]>",
"types": "dist/index.d.ts",
Expand Down Expand Up @@ -30,7 +30,7 @@
"@mux/mux-node": "file:../../dist/",
"@modelcontextprotocol/sdk": "^1.11.5",
"express": "^5.1.0",
"jq-web": "https://github.com/stainless-api/jq-web/releases/download/v0.8.2/jq-web.tar.gz",
"jq-web": "https://github.com/stainless-api/jq-web/releases/download/v0.8.6/jq-web.tar.gz",
"yargs": "^17.7.2",
"@cloudflare/cabidela": "^0.2.4",
"zod": "^3.25.20",
Expand All @@ -43,6 +43,7 @@
"@anthropic-ai/dxt": "^0.2.0",
"@types/jest": "^29.4.0",
"@types/express": "^5.0.3",
"@types/yargs": "^17.0.8",
"@typescript-eslint/eslint-plugin": "8.31.1",
"@typescript-eslint/parser": "8.31.1",
"eslint": "^8.49.0",
Expand Down
3 changes: 1 addition & 2 deletions packages/mcp-server/src/filtering.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
// @ts-nocheck
import initJq from 'jq-web';

export async function maybeFilter(args: Record<string, unknown> | undefined, response: any): Promise<any> {
const jqFilter = args?.['jq_filter'];
export async function maybeFilter(jqFilter: unknown | undefined, response: any): Promise<any> {
if (jqFilter && typeof jqFilter === 'string') {
return await jq(response, jqFilter);
} else {
Expand Down
4 changes: 2 additions & 2 deletions packages/mcp-server/src/headers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import { IncomingMessage } from 'node:http';

export const parseAuthHeaders = (req: IncomingMessage): Partial<ClientOptions> => {
if (req.headers.authorization) {
const scheme = req.headers.authorization.slice(req.headers.authorization.search(' '));
const scheme = req.headers.authorization.split(' ')[0]!;
const value = req.headers.authorization.slice(scheme.length + 1);
switch (scheme) {
case 'Basic':
const rawValue = Buffer.from(value).toString('base64');
const rawValue = Buffer.from(value, 'base64').toString();
return {
tokenId: rawValue.slice(0, rawValue.search(':')),
tokenSecret: rawValue.slice(rawValue.search(':') + 1),
Expand Down
28 changes: 21 additions & 7 deletions packages/mcp-server/src/http.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

import { McpServer } from '@modelcontextprotocol/sdk/server/mcp';
import { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/streamableHttp.js';

Expand Down Expand Up @@ -67,19 +69,31 @@ const del = async (req: express.Request, res: express.Response) => {
});
};

export const launchStreamableHTTPServer = async (
options: McpOptions,
endpoints: Endpoint[],
port: number | undefined,
) => {
export const streamableHTTPApp = (options: McpOptions): express.Express => {
const app = express();
app.use(express.json());

app.get('/', get);
app.post('/', post(options));
app.delete('/', del);

console.error(`MCP Server running on streamable HTTP on port ${port}`);
return app;
};

export const launchStreamableHTTPServer = async (
options: McpOptions,
endpoints: Endpoint[],
port: number | string | undefined,
) => {
const app = streamableHTTPApp(options);
const server = app.listen(port);
const address = server.address();

app.listen(port);
if (typeof address === 'string') {
console.error(`MCP Server running on streamable HTTP at ${address}`);
} else if (address !== null) {
console.error(`MCP Server running on streamable HTTP on port ${address.port}`);
} else {
console.error(`MCP Server running on streamable HTTP on port ${port}`);
}
};
2 changes: 1 addition & 1 deletion packages/mcp-server/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ async function main() {
await launchStdioServer(options, selectedTools);
break;
case 'http':
await launchStreamableHTTPServer(options, selectedTools, options.port);
await launchStreamableHTTPServer(options, selectedTools, options.port ?? options.socket);
break;
}
}
Expand Down
6 changes: 6 additions & 0 deletions packages/mcp-server/src/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export type CLIOptions = McpOptions & {
list: boolean;
transport: 'stdio' | 'http';
port: number | undefined;
socket: string | undefined;
};

export type McpOptions = {
Expand Down Expand Up @@ -141,6 +142,10 @@ export function parseOptions(): CLIOptions {
type: 'number',
description: 'Port to serve on if using http transport',
})
.option('socket', {
type: 'string',
description: 'Unix socket to serve on if using http transport',
})
.help();

for (const [command, desc] of examples()) {
Expand Down Expand Up @@ -262,6 +267,7 @@ export function parseOptions(): CLIOptions {
list: argv.list || false,
transport,
port: argv.port,
socket: argv.socket,
};
}

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 @@ -26,7 +26,7 @@ export const newMcpServer = () =>
new McpServer(
{
name: 'mux',
version: '12.4.0',
version: '12.4.1',
},
{ capabilities: { tools: {}, logging: {} } },
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const tool: Tool = {
filters: {
type: 'array',
description:
'Limit the results to rows that match conditions from provided key:value pairs. Must be provided as an array query string parameter.\n\nTo exclude rows that match a certain condition, prepend a `!` character to the dimension.\n\nPossible filter names are the same as returned by the List Filters endpoint.\n\nExample:\n\n * `filters[]=operating_system:windows&filters[]=!country:US`\n',
'Filter results using key:value pairs. Must be provided as an array query string parameter.\n\n**Basic filtering:**\n* `filters[]=dimension:value` - Include rows where dimension equals value\n* `filters[]=!dimension:value` - Exclude rows where dimension equals value\n\n**For trace dimensions (like video_cdn_trace):**\n* `filters[]=+dimension:value` - Include rows where trace contains value\n* `filters[]=-dimension:value` - Exclude rows where trace contains value\n* `filters[]=dimension:[value1,value2]` - Exact trace match\n\n**Examples:**\n* `filters[]=country:US` - US views only\n* `filters[]=+video_cdn_trace:fastly` - Views using Fastly CDN\n',
items: {
type: 'string',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const tool: Tool = {
filters: {
type: 'array',
description:
'Limit the results to rows that match conditions from provided key:value pairs. Must be provided as an array query string parameter.\n\nTo exclude rows that match a certain condition, prepend a `!` character to the dimension.\n\nPossible filter names are the same as returned by the List Filters endpoint.\n\nExample:\n\n * `filters[]=operating_system:windows&filters[]=!country:US`\n',
'Filter results using key:value pairs. Must be provided as an array query string parameter.\n\n**Basic filtering:**\n* `filters[]=dimension:value` - Include rows where dimension equals value\n* `filters[]=!dimension:value` - Exclude rows where dimension equals value\n\n**For trace dimensions (like video_cdn_trace):**\n* `filters[]=+dimension:value` - Include rows where trace contains value\n* `filters[]=-dimension:value` - Exclude rows where trace contains value\n* `filters[]=dimension:[value1,value2]` - Exact trace match\n\n**Examples:**\n* `filters[]=country:US` - US views only\n* `filters[]=+video_cdn_trace:fastly` - Views using Fastly CDN\n',
items: {
type: 'string',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const tool: Tool = {
filters: {
type: 'array',
description:
'Limit the results to rows that match conditions from provided key:value pairs. Must be provided as an array query string parameter.\n\nTo exclude rows that match a certain condition, prepend a `!` character to the dimension.\n\nPossible filter names are the same as returned by the List Filters endpoint.\n\nExample:\n\n * `filters[]=operating_system:windows&filters[]=!country:US`\n',
'Filter results using key:value pairs. Must be provided as an array query string parameter.\n\n**Basic filtering:**\n* `filters[]=dimension:value` - Include rows where dimension equals value\n* `filters[]=!dimension:value` - Exclude rows where dimension equals value\n\n**For trace dimensions (like video_cdn_trace):**\n* `filters[]=+dimension:value` - Include rows where trace contains value\n* `filters[]=-dimension:value` - Exclude rows where trace contains value\n* `filters[]=dimension:[value1,value2]` - Exact trace match\n\n**Examples:**\n* `filters[]=country:US` - US views only\n* `filters[]=+video_cdn_trace:fastly` - Views using Fastly CDN\n',
items: {
type: 'string',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export const tool: Tool = {
filters: {
type: 'array',
description:
'Limit the results to rows that match conditions from provided key:value pairs. Must be provided as an array query string parameter.\n\nTo exclude rows that match a certain condition, prepend a `!` character to the dimension.\n\nPossible filter names are the same as returned by the List Filters endpoint.\n\nExample:\n\n * `filters[]=operating_system:windows&filters[]=!country:US`\n',
'Filter results using key:value pairs. Must be provided as an array query string parameter.\n\n**Basic filtering:**\n* `filters[]=dimension:value` - Include rows where dimension equals value\n* `filters[]=!dimension:value` - Exclude rows where dimension equals value\n\n**For trace dimensions (like video_cdn_trace):**\n* `filters[]=+dimension:value` - Include rows where trace contains value\n* `filters[]=-dimension:value` - Exclude rows where trace contains value\n* `filters[]=dimension:[value1,value2]` - Exact trace match\n\n**Examples:**\n* `filters[]=country:US` - US views only\n* `filters[]=+video_cdn_trace:fastly` - Views using Fastly CDN\n',
items: {
type: 'string',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export const tool: Tool = {
filters: {
type: 'array',
description:
'Limit the results to rows that match conditions from provided key:value pairs. Must be provided as an array query string parameter.\n\nTo exclude rows that match a certain condition, prepend a `!` character to the dimension.\n\nPossible filter names are the same as returned by the List Filters endpoint.\n\nExample:\n\n * `filters[]=operating_system:windows&filters[]=!country:US`\n',
'Filter results using key:value pairs. Must be provided as an array query string parameter.\n\n**Basic filtering:**\n* `filters[]=dimension:value` - Include rows where dimension equals value\n* `filters[]=!dimension:value` - Exclude rows where dimension equals value\n\n**For trace dimensions (like video_cdn_trace):**\n* `filters[]=+dimension:value` - Include rows where trace contains value\n* `filters[]=-dimension:value` - Exclude rows where trace contains value\n* `filters[]=dimension:[value1,value2]` - Exact trace match\n\n**Examples:**\n* `filters[]=country:US` - US views only\n* `filters[]=+video_cdn_trace:fastly` - Views using Fastly CDN\n',
items: {
type: 'string',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export const tool: Tool = {
filters: {
type: 'array',
description:
'Limit the results to rows that match conditions from provided key:value pairs. Must be provided as an array query string parameter.\n\nTo exclude rows that match a certain condition, prepend a `!` character to the dimension.\n\nPossible filter names are the same as returned by the List Filters endpoint.\n\nExample:\n\n * `filters[]=operating_system:windows&filters[]=!country:US`\n',
'Filter results using key:value pairs. Must be provided as an array query string parameter.\n\n**Basic filtering:**\n* `filters[]=dimension:value` - Include rows where dimension equals value\n* `filters[]=!dimension:value` - Exclude rows where dimension equals value\n\n**For trace dimensions (like video_cdn_trace):**\n* `filters[]=+dimension:value` - Include rows where trace contains value\n* `filters[]=-dimension:value` - Exclude rows where trace contains value\n* `filters[]=dimension:[value1,value2]` - Exact trace match\n\n**Examples:**\n* `filters[]=country:US` - US views only\n* `filters[]=+video_cdn_trace:fastly` - Views using Fastly CDN\n',
items: {
type: 'string',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export const tool: Tool = {
filters: {
type: 'array',
description:
'Limit the results to rows that match conditions from provided key:value pairs. Must be provided as an array query string parameter.\n\nTo exclude rows that match a certain condition, prepend a `!` character to the dimension.\n\nPossible filter names are the same as returned by the List Filters endpoint.\n\nExample:\n\n * `filters[]=operating_system:windows&filters[]=!country:US`\n',
'Filter results using key:value pairs. Must be provided as an array query string parameter.\n\n**Basic filtering:**\n* `filters[]=dimension:value` - Include rows where dimension equals value\n* `filters[]=!dimension:value` - Exclude rows where dimension equals value\n\n**For trace dimensions (like video_cdn_trace):**\n* `filters[]=+dimension:value` - Include rows where trace contains value\n* `filters[]=-dimension:value` - Exclude rows where trace contains value\n* `filters[]=dimension:[value1,value2]` - Exact trace match\n\n**Examples:**\n* `filters[]=country:US` - US views only\n* `filters[]=+video_cdn_trace:fastly` - Views using Fastly CDN\n',
items: {
type: 'string',
},
Expand Down Expand Up @@ -168,6 +168,7 @@ export const tool: Tool = {
'view_cdn_edge_pop',
'view_cdn_origin',
'video_creator_id',
'video_cdn_trace',
],
},
limit: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,13 @@ export const tool: Tool = {
'view_cdn_edge_pop',
'view_cdn_origin',
'video_creator_id',
'video_cdn_trace',
],
},
filters: {
type: 'array',
description:
'Limit the results to rows that match conditions from provided key:value pairs. Must be provided as an array query string parameter.\n\nTo exclude rows that match a certain condition, prepend a `!` character to the dimension.\n\nPossible filter names are the same as returned by the List Filters endpoint.\n\nExample:\n\n * `filters[]=operating_system:windows&filters[]=!country:US`\n',
'Filter results using key:value pairs. Must be provided as an array query string parameter.\n\n**Basic filtering:**\n* `filters[]=dimension:value` - Include rows where dimension equals value\n* `filters[]=!dimension:value` - Exclude rows where dimension equals value\n\n**For trace dimensions (like video_cdn_trace):**\n* `filters[]=+dimension:value` - Include rows where trace contains value\n* `filters[]=-dimension:value` - Exclude rows where trace contains value\n* `filters[]=dimension:[value1,value2]` - Exact trace match\n\n**Examples:**\n* `filters[]=country:US` - US views only\n* `filters[]=+video_cdn_trace:fastly` - Views using Fastly CDN\n',
items: {
type: 'string',
},
Expand Down
Loading