Skip to content

Commit de305b5

Browse files
Merge pull request #6 from CASParser/release-please--branches--main--changes--next--components--cas-parser-node
release: 1.4.0
2 parents 7fc7e22 + f9f7e30 commit de305b5

File tree

18 files changed

+531
-57
lines changed

18 files changed

+531
-57
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ jobs:
7575
URL: https://pkg.stainless.com/s?subpackage=mcp-server
7676
AUTH: ${{ steps.github-oidc.outputs.github_token }}
7777
SHA: ${{ github.sha }}
78-
BUILD_PATH: packages/mcp-server/dist
78+
BASE_PATH: packages/mcp-server
7979
run: ./scripts/utils/upload-artifact.sh
8080
test:
8181
timeout-minutes: 10

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ dist
77
dist-deno
88
/*.tgz
99
.idea/
10-
10+
dist-bundle
11+
*.dxt

.release-please-manifest.json

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

CHANGELOG.md

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

3+
## 1.4.0 (2025-09-06)
4+
5+
Full Changelog: [v1.3.0...v1.4.0](https://github.com/CASParser/cas-parser-node/compare/v1.3.0...v1.4.0)
6+
7+
### Features
8+
9+
* **mcp:** allow setting logging level ([09e1385](https://github.com/CASParser/cas-parser-node/commit/09e1385c6aca980373b2e306a322ededef76a968))
10+
* **mcp:** expose client options in `streamableHTTPApp` ([8b00452](https://github.com/CASParser/cas-parser-node/commit/8b00452cbb7fce7b4d63e240021c2088f3ff1724))
11+
12+
13+
### Bug Fixes
14+
15+
* **mcp:** fix query options parsing ([c0c48c9](https://github.com/CASParser/cas-parser-node/commit/c0c48c931043e8a4ca2154ea128589b19e0c0d24))
16+
17+
18+
### Chores
19+
20+
* ci build action ([52509dd](https://github.com/CASParser/cas-parser-node/commit/52509ddf57d2452be7194a560a77f497668e75ae))
21+
* **internal:** codegen related update ([fbd7b14](https://github.com/CASParser/cas-parser-node/commit/fbd7b14ecce310840c07c198b070b3546178a2ae))
22+
* **internal:** codegen related update ([328471e](https://github.com/CASParser/cas-parser-node/commit/328471eb93f460fbf4e56139ed85c6565e0c3f72))
23+
* **internal:** update global Error reference ([a1c4a4b](https://github.com/CASParser/cas-parser-node/commit/a1c4a4b62f88fe05201137ae92a934f9248dc237))
24+
325
## 1.3.0 (2025-08-24)
426

527
Full Changelog: [v1.2.0...v1.3.0](https://github.com/CASParser/cas-parser-node/compare/v1.2.0...v1.3.0)

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cas-parser-node",
3-
"version": "1.3.0",
3+
"version": "1.4.0",
44
"description": "The official TypeScript library for the Cas Parser API",
55
"author": "Cas Parser <[email protected]>",
66
"types": "dist/index.d.ts",

packages/mcp-server/build

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,27 @@ cp tsconfig.dist-src.json dist/src/tsconfig.json
3030
chmod +x dist/index.js
3131

3232
DIST_PATH=./dist PKG_IMPORT_PATH=cas-parser-node-mcp/ node ../../scripts/utils/postprocess-files.cjs
33+
34+
# mcp bundle
35+
rm -rf dist-bundle cas_parser_node_api.dxt; mkdir dist-bundle
36+
37+
# copy package.json
38+
PKG_JSON_PATH=../../packages/mcp-server/package.json node ../../scripts/utils/make-dist-package-json.cjs > dist-bundle/package.json
39+
40+
# copy files
41+
node scripts/copy-bundle-files.cjs
42+
43+
# install runtime deps
44+
cd dist-bundle
45+
npm install
46+
cd ..
47+
48+
# pack bundle
49+
cp manifest.json dist-bundle
50+
51+
npx dxt pack dist-bundle cas_parser_node_api.dxt
52+
53+
npx dxt sign cas_parser_node_api.dxt --self-signed
54+
55+
# clean up
56+
rm -rf dist-bundle

packages/mcp-server/manifest.json

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"dxt_version": "0.1",
3+
"name": "cas-parser-node-mcp",
4+
"version": "1.3.0",
5+
"description": "The official MCP Server for the Cas Parser API",
6+
"author": {
7+
"name": "Cas Parser",
8+
"email": "[email protected]"
9+
},
10+
"repository": {
11+
"type": "git",
12+
"url": "git+https://github.com/CASParser/cas-parser-node.git"
13+
},
14+
"homepage": "https://github.com/CASParser/cas-parser-node/tree/main/packages/mcp-server#readme",
15+
"documentation": "https://docs.casparser.in/reference",
16+
"server": {
17+
"type": "node",
18+
"entry_point": "${__dirname}/index.js",
19+
"mcp_config": {
20+
"command": "node",
21+
"args": ["${__dirname}/index.js"],
22+
"env": {
23+
"CAS_PARSER_API_KEY": "${user_config.CAS_PARSER_API_KEY}"
24+
}
25+
}
26+
},
27+
"user_config": {
28+
"CAS_PARSER_API_KEY": {
29+
"title": "api_key",
30+
"description": "Your API key for authentication.\nUse `sandbox-with-json-responses` as Sandbox key.\n",
31+
"required": true,
32+
"type": "string"
33+
}
34+
},
35+
"tools_generated": true,
36+
"compatibility": {
37+
"runtimes": {
38+
"node": ">=18.0.0"
39+
}
40+
},
41+
"keywords": ["api"]
42+
}

packages/mcp-server/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cas-parser-node-mcp",
3-
"version": "1.3.0",
3+
"version": "1.4.0",
44
"description": "The official MCP Server for the Cas Parser API",
55
"author": "Cas Parser <[email protected]>",
66
"types": "dist/index.d.ts",
@@ -47,6 +47,7 @@
4747
"mcp-server": "dist/index.js"
4848
},
4949
"devDependencies": {
50+
"@anthropic-ai/dxt": "^0.2.6",
5051
"@types/cors": "^2.8.19",
5152
"@types/express": "^5.0.3",
5253
"@types/jest": "^29.4.0",
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
const fs = require('fs');
2+
const path = require('path');
3+
const pkgJson = require('../dist-bundle/package.json');
4+
5+
const distDir = path.resolve(__dirname, '..', 'dist');
6+
const distBundleDir = path.resolve(__dirname, '..', 'dist-bundle');
7+
const distBundlePkgJson = path.join(distBundleDir, 'package.json');
8+
9+
async function* walk(dir) {
10+
for await (const d of await fs.promises.opendir(dir)) {
11+
const entry = path.join(dir, d.name);
12+
if (d.isDirectory()) yield* walk(entry);
13+
else if (d.isFile()) yield entry;
14+
}
15+
}
16+
17+
async function copyFiles() {
18+
// copy runtime files
19+
for await (const file of walk(distDir)) {
20+
if (!/[cm]?js$/.test(file)) continue;
21+
const dest = path.join(distBundleDir, path.relative(distDir, file));
22+
await fs.promises.mkdir(path.dirname(dest), { recursive: true });
23+
await fs.promises.copyFile(file, dest);
24+
}
25+
26+
// replace package.json reference with local reference
27+
for (const dep in pkgJson.dependencies) {
28+
if (dep === 'cas-parser-node') {
29+
pkgJson.dependencies[dep] = 'file:../../../dist/';
30+
}
31+
}
32+
33+
await fs.promises.writeFile(distBundlePkgJson, JSON.stringify(pkgJson, null, 2));
34+
}
35+
36+
copyFiles();

packages/mcp-server/src/code-tool.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ import { Endpoint, ContentBlock, Metadata } from './tools/types';
77

88
import { Tool } from '@modelcontextprotocol/sdk/types.js';
99

10-
import { newDenoHTTPWorker } from '@valtown/deno-http-worker';
1110
import { WorkerInput, WorkerError, WorkerSuccess } from './code-tool-types';
12-
import { workerPath } from './code-tool-paths.cjs';
1311

1412
/**
1513
* A tool that runs code against a copy of the SDK.
@@ -20,7 +18,7 @@ import { workerPath } from './code-tool-paths.cjs';
2018
*
2119
* @param endpoints - The endpoints to include in the list.
2220
*/
23-
export function codeTool(): Endpoint {
21+
export async function codeTool(): Promise<Endpoint> {
2422
const metadata: Metadata = { resource: 'all', operation: 'write', tags: [] };
2523
const tool: Tool = {
2624
name: 'execute',
@@ -29,6 +27,10 @@ export function codeTool(): Endpoint {
2927
inputSchema: { type: 'object', properties: { code: { type: 'string' } } },
3028
};
3129

30+
// Import dynamically to avoid failing at import time in cases where the environment is not well-supported.
31+
const { newDenoHTTPWorker } = await import('@valtown/deno-http-worker');
32+
const { workerPath } = await import('./code-tool-paths.cjs');
33+
3234
const handler = async (client: CasParser, args: unknown) => {
3335
const baseURLHostname = new URL(client.baseURL).hostname;
3436
const { code } = args as { code: string };

0 commit comments

Comments
 (0)