Skip to content

Commit 3af48bf

Browse files
release: 12.4.1 (#601)
* codegen metadata * fix(mcp): fix bug in header handling * chore(internal): move publish config * chore(mcp): refactor streamable http transport * feat(mcp): add unix socket option for remote MCP * chore: update @stainless-api/prism-cli to v5.15.0 * chore(internal): update comment in script * fix(mcp): fix jq type bug * chore(mcp): bump JQ version * chore(mcp): minor cleanup of types and package.json * feat: add support for CDN trace and trace dimension-specific API methods (#365) * chore(mcp): document remote server in README.md * chore(deps): update dependency node-fetch to v2.6.13 * chore(mcp): update README * release: 12.4.1 --------- Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com>
1 parent f25eb06 commit 3af48bf

31 files changed

+378
-131
lines changed

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "12.4.0"
2+
".": "12.4.1"
33
}

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 107
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mux%2Fmux-ba7ebfd893a1c5d082d55cddaec2ff9219072c9abd96442357aad1748e421483.yml
3-
openapi_spec_hash: 94fd98fcb8414d6c70a6ad7593ffcfa4
4-
config_hash: 06e26125693367671f74a6d70d1f3333
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mux%2Fmux-36cec1d12b890d6845ad299d5b91c7932665735cb23c07b66d88c0ca69f748fa.yml
3+
openapi_spec_hash: ff994517cde080d3ec0a675d37364b6d
4+
config_hash: 1e983ab8fc1f0ef27575b3a39f114bdc

CHANGELOG.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,33 @@
11
# Changelog
22

3+
## 12.4.1 (2025-08-15)
4+
5+
Full Changelog: [v12.4.0...v12.4.1](https://github.com/muxinc/mux-node-sdk/compare/v12.4.0...v12.4.1)
6+
7+
### Features
8+
9+
* 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))
10+
* **mcp:** add unix socket option for remote MCP ([839d999](https://github.com/muxinc/mux-node-sdk/commit/839d999865094e8ddce0e56d1257d518b26bc858))
11+
12+
13+
### Bug Fixes
14+
15+
* **mcp:** fix bug in header handling ([01d65d1](https://github.com/muxinc/mux-node-sdk/commit/01d65d1f88f722a71f674ffe95a65dcb9afdb2b0))
16+
* **mcp:** fix jq type bug ([6b46735](https://github.com/muxinc/mux-node-sdk/commit/6b46735b637051fb54809fa606ab132c08843965))
17+
18+
19+
### Chores
20+
21+
* **deps:** update dependency node-fetch to v2.6.13 ([5f509de](https://github.com/muxinc/mux-node-sdk/commit/5f509def4f289910ebaeb692c1b4b56b117ba055))
22+
* **internal:** move publish config ([870995a](https://github.com/muxinc/mux-node-sdk/commit/870995abf7002274a9e8a7e7f3d9cf1e4c384b4c))
23+
* **internal:** update comment in script ([8f6a4a0](https://github.com/muxinc/mux-node-sdk/commit/8f6a4a0906ac902beb21d5bb46451939f064b9d7))
24+
* **mcp:** bump JQ version ([e5b6779](https://github.com/muxinc/mux-node-sdk/commit/e5b67797968191ab425f0fa6e52e5f2ee50242ba))
25+
* **mcp:** document remote server in README.md ([3344229](https://github.com/muxinc/mux-node-sdk/commit/334422990ac35284a439e084953820542a23ef89))
26+
* **mcp:** minor cleanup of types and package.json ([24097ba](https://github.com/muxinc/mux-node-sdk/commit/24097ba76b69b98d4fcea804c74524eef8f0bf77))
27+
* **mcp:** refactor streamable http transport ([8b40da7](https://github.com/muxinc/mux-node-sdk/commit/8b40da7f2f93e110794664c1811c8412ce3534f3))
28+
* **mcp:** update README ([2bdad30](https://github.com/muxinc/mux-node-sdk/commit/2bdad3016326d9e04b108839ffe2030ae9f4c1c0))
29+
* update @stainless-api/prism-cli to v5.15.0 ([6d47536](https://github.com/muxinc/mux-node-sdk/commit/6d47536322556ca25805c16dff4e5ccb3bba41c6))
30+
331
## 12.4.0 (2025-08-05)
432

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

bin/publish-npm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,4 @@ else
5858
fi
5959

6060
# Publish with the appropriate tag
61-
yarn publish --access public --tag "$TAG"
61+
yarn publish --tag "$TAG"

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@mux/mux-node",
3-
"version": "12.4.0",
3+
"version": "12.4.1",
44
"description": "The official TypeScript library for the Mux API",
55
"author": "Mux <[email protected]>",
66
"types": "dist/index.d.ts",
@@ -13,6 +13,9 @@
1313
"**/*"
1414
],
1515
"private": false,
16+
"publishConfig": {
17+
"access": "public"
18+
},
1619
"scripts": {
1720
"test": "./scripts/test",
1821
"build": "./scripts/build",

packages/mcp-server/README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,34 @@ over time, you can manually enable or disable certain capabilities:
121121
--resource=cards,accounts --operation=read --tag=kyc --no-tool=create_cards
122122
```
123123

124+
## Running remotely
125+
126+
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.
127+
128+
Authorization can be provided via the `Authorization` header using the Basic or Bearer scheme.
129+
130+
Additionally, authorization can be provided via the following headers:
131+
| Header | Equivalent client option | Security scheme |
132+
| --------------------------- | ------------------------ | ------------------ |
133+
| `x-mux-token-id` | `tokenId` | accessToken |
134+
| `x-mux-token-secret` | `tokenSecret` | accessToken |
135+
| `x-mux-authorization-token` | `authorizationToken` | authorizationToken |
136+
137+
A configuration JSON for this server might look like this, assuming the server is hosted at `http://localhost:3000`:
138+
139+
```json
140+
{
141+
"mcpServers": {
142+
"mux_mux_node_api": {
143+
"url": "http://localhost:3000",
144+
"headers": {
145+
"Authorization": "Basic <auth value>"
146+
}
147+
}
148+
}
149+
}
150+
```
151+
124152
## Importing the tools and server individually
125153

126154
```js

packages/mcp-server/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@mux/mcp",
3-
"version": "12.4.0",
3+
"version": "12.4.1",
44
"description": "The official MCP Server for the Mux API",
55
"author": "Mux <[email protected]>",
66
"types": "dist/index.d.ts",
@@ -30,7 +30,7 @@
3030
"@mux/mux-node": "file:../../dist/",
3131
"@modelcontextprotocol/sdk": "^1.11.5",
3232
"express": "^5.1.0",
33-
"jq-web": "https://github.com/stainless-api/jq-web/releases/download/v0.8.2/jq-web.tar.gz",
33+
"jq-web": "https://github.com/stainless-api/jq-web/releases/download/v0.8.6/jq-web.tar.gz",
3434
"yargs": "^17.7.2",
3535
"@cloudflare/cabidela": "^0.2.4",
3636
"zod": "^3.25.20",
@@ -43,6 +43,7 @@
4343
"@anthropic-ai/dxt": "^0.2.0",
4444
"@types/jest": "^29.4.0",
4545
"@types/express": "^5.0.3",
46+
"@types/yargs": "^17.0.8",
4647
"@typescript-eslint/eslint-plugin": "8.31.1",
4748
"@typescript-eslint/parser": "8.31.1",
4849
"eslint": "^8.49.0",

packages/mcp-server/src/filtering.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
// @ts-nocheck
22
import initJq from 'jq-web';
33

4-
export async function maybeFilter(args: Record<string, unknown> | undefined, response: any): Promise<any> {
5-
const jqFilter = args?.['jq_filter'];
4+
export async function maybeFilter(jqFilter: unknown | undefined, response: any): Promise<any> {
65
if (jqFilter && typeof jqFilter === 'string') {
76
return await jq(response, jqFilter);
87
} else {

packages/mcp-server/src/headers.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ import { IncomingMessage } from 'node:http';
66

77
export const parseAuthHeaders = (req: IncomingMessage): Partial<ClientOptions> => {
88
if (req.headers.authorization) {
9-
const scheme = req.headers.authorization.slice(req.headers.authorization.search(' '));
9+
const scheme = req.headers.authorization.split(' ')[0]!;
1010
const value = req.headers.authorization.slice(scheme.length + 1);
1111
switch (scheme) {
1212
case 'Basic':
13-
const rawValue = Buffer.from(value).toString('base64');
13+
const rawValue = Buffer.from(value, 'base64').toString();
1414
return {
1515
tokenId: rawValue.slice(0, rawValue.search(':')),
1616
tokenSecret: rawValue.slice(rawValue.search(':') + 1),

packages/mcp-server/src/http.ts

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
13
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp';
24
import { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/streamableHttp.js';
35

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

70-
export const launchStreamableHTTPServer = async (
71-
options: McpOptions,
72-
endpoints: Endpoint[],
73-
port: number | undefined,
74-
) => {
72+
export const streamableHTTPApp = (options: McpOptions): express.Express => {
7573
const app = express();
7674
app.use(express.json());
7775

7876
app.get('/', get);
7977
app.post('/', post(options));
8078
app.delete('/', del);
8179

82-
console.error(`MCP Server running on streamable HTTP on port ${port}`);
80+
return app;
81+
};
82+
83+
export const launchStreamableHTTPServer = async (
84+
options: McpOptions,
85+
endpoints: Endpoint[],
86+
port: number | string | undefined,
87+
) => {
88+
const app = streamableHTTPApp(options);
89+
const server = app.listen(port);
90+
const address = server.address();
8391

84-
app.listen(port);
92+
if (typeof address === 'string') {
93+
console.error(`MCP Server running on streamable HTTP at ${address}`);
94+
} else if (address !== null) {
95+
console.error(`MCP Server running on streamable HTTP on port ${address.port}`);
96+
} else {
97+
console.error(`MCP Server running on streamable HTTP on port ${port}`);
98+
}
8599
};

0 commit comments

Comments
 (0)