Skip to content

Commit b36d4ba

Browse files
Merge pull request #6 from Scan-Documents/release-please--branches--main--changes--next--components--scan-documents
release: 0.1.0-alpha.6
2 parents 8182eaa + a6cd56d commit b36d4ba

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+2122
-287
lines changed

.github/workflows/ci.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,14 @@ jobs:
1717
timeout-minutes: 10
1818
name: lint
1919
runs-on: ${{ github.repository == 'stainless-sdks/scan-documents-typescript' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
20+
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
2021
steps:
2122
- uses: actions/checkout@v4
2223

2324
- name: Set up Node
2425
uses: actions/setup-node@v4
2526
with:
26-
node-version: '20'
27+
node-version: '22'
2728

2829
- name: Bootstrap
2930
run: ./scripts/bootstrap
@@ -35,6 +36,7 @@ jobs:
3536
timeout-minutes: 5
3637
name: build
3738
runs-on: ${{ github.repository == 'stainless-sdks/scan-documents-typescript' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
39+
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
3840
permissions:
3941
contents: read
4042
id-token: write
@@ -44,7 +46,7 @@ jobs:
4446
- name: Set up Node
4547
uses: actions/setup-node@v4
4648
with:
47-
node-version: '20'
49+
node-version: '22'
4850

4951
- name: Bootstrap
5052
run: ./scripts/bootstrap
@@ -66,10 +68,20 @@ jobs:
6668
AUTH: ${{ steps.github-oidc.outputs.github_token }}
6769
SHA: ${{ github.sha }}
6870
run: ./scripts/utils/upload-artifact.sh
71+
72+
- name: Upload MCP Server tarball
73+
if: github.repository == 'stainless-sdks/scan-documents-typescript'
74+
env:
75+
URL: https://pkg.stainless.com/s?subpackage=mcp-server
76+
AUTH: ${{ steps.github-oidc.outputs.github_token }}
77+
SHA: ${{ github.sha }}
78+
BUILD_PATH: packages/mcp-server/dist
79+
run: ./scripts/utils/upload-artifact.sh
6980
test:
7081
timeout-minutes: 10
7182
name: test
7283
runs-on: ${{ github.repository == 'stainless-sdks/scan-documents-typescript' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
84+
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
7385
steps:
7486
- uses: actions/checkout@v4
7587

.release-please-manifest.json

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

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 17
1+
configured_endpoints: 18
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/scan-documents%2Fscan-documents-42f9aa9c3b2769584f60fa3742f3a004bdf2e3b5ba30a44535b0191654b1a51e.yml
33
openapi_spec_hash: a0bab3e1411b24d8a662df98d227049a
4-
config_hash: 4f1180f734cbc7323ff2ed85a9cd510d
4+
config_hash: c1dd12e2ddf127e74f1b4981eef49e2b

CHANGELOG.md

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

3+
## 0.1.0-alpha.6 (2025-08-24)
4+
5+
Full Changelog: [v0.1.0-alpha.5...v0.1.0-alpha.6](https://github.com/Scan-Documents/node-sdk/compare/v0.1.0-alpha.5...v0.1.0-alpha.6)
6+
7+
### Features
8+
9+
* **api:** update via SDK Studio ([29066c7](https://github.com/Scan-Documents/node-sdk/commit/29066c78a803d4eb260385bdf2a3e7748390b91d))
10+
* **mcp:** add code execution tool ([c36e7ab](https://github.com/Scan-Documents/node-sdk/commit/c36e7ab1ffe8f98f94603aa729b080bd16e034c4))
11+
* **mcp:** add logging when environment variable is set ([57fc795](https://github.com/Scan-Documents/node-sdk/commit/57fc7959d83c30d25152a60aeb8895df38ab15b8))
12+
* **mcp:** add option to infer mcp client ([149e514](https://github.com/Scan-Documents/node-sdk/commit/149e5145317a38b8acb37ec99948fc3aab8a2a2b))
13+
* **mcp:** add unix socket option for remote MCP ([72982bc](https://github.com/Scan-Documents/node-sdk/commit/72982bc112a6a5725956354b361944069cf92faa))
14+
* **mcp:** fallback for void-typed methods ([965b606](https://github.com/Scan-Documents/node-sdk/commit/965b6064ff025b992e21c9fd54edbe6963d27b6b))
15+
* **mcp:** parse query string as mcp client options in mcp server ([a72cd42](https://github.com/Scan-Documents/node-sdk/commit/a72cd4273cb2efc360656de84e17c94d2ba21c25))
16+
* **mcp:** remote server with passthru auth ([05f1022](https://github.com/Scan-Documents/node-sdk/commit/05f1022cf2d8897c5ca52bdac865fea951dabc39))
17+
* **mcp:** support filtering tool results by a jq expression ([436421e](https://github.com/Scan-Documents/node-sdk/commit/436421e66b382295d19149478a5cabb21bce12a6))
18+
19+
20+
### Bug Fixes
21+
22+
* **ci:** release-doctor — report correct token name ([2430747](https://github.com/Scan-Documents/node-sdk/commit/2430747fe786df1a9e237b884c59082cfc21a2bf))
23+
* **client:** get fetchOptions type more reliably ([0a17458](https://github.com/Scan-Documents/node-sdk/commit/0a17458ddfe37d5b3e5c10f7e257fad3e2d08129))
24+
* **mcp:** avoid sending `jq_filter` to base API ([11b40cc](https://github.com/Scan-Documents/node-sdk/commit/11b40cca569792c127c204a6ca9c39e688b182be))
25+
* **mcp:** fix tool description of jq_filter ([33effa6](https://github.com/Scan-Documents/node-sdk/commit/33effa6ccb54e2da65a9aaad00bcbb7070e2bdd0))
26+
* **mcp:** generate additionalProperties=true for map schemas to avoid validation issues ([488ee1c](https://github.com/Scan-Documents/node-sdk/commit/488ee1c68366d5253d75565838c2c3447af525b1))
27+
* **mcp:** include required section for top-level properties and support naming transformations ([f7827a6](https://github.com/Scan-Documents/node-sdk/commit/f7827a6390ec0922cdc039344f47774cf588da14))
28+
* **mcp:** relax input type for asTextContextResult ([7f50ae3](https://github.com/Scan-Documents/node-sdk/commit/7f50ae35b174c4e7863bfc71c71ce70f71893ef7))
29+
* **mcp:** reverse validJson capability option and limit scope ([41bd333](https://github.com/Scan-Documents/node-sdk/commit/41bd333e563e4b23100f1f239928aa8c60fc223c))
30+
* **mcp:** support jq filtering on cloudflare workers ([d2bee12](https://github.com/Scan-Documents/node-sdk/commit/d2bee126b3794e12e7a66fd1df7600a89c7adf7a))
31+
32+
33+
### Chores
34+
35+
* add docs to RequestOptions type ([26a2df1](https://github.com/Scan-Documents/node-sdk/commit/26a2df16f3133c6f3ebfa06a906ccbdb667b763c))
36+
* add package to package.json ([52c2226](https://github.com/Scan-Documents/node-sdk/commit/52c22269924c2992a427ce0136bf1f9effd4da8b))
37+
* **ci:** only run for pushes and fork pull requests ([fedf819](https://github.com/Scan-Documents/node-sdk/commit/fedf819df77819d08582e26bf2d768a0971684d0))
38+
* **client:** improve path param validation ([00bb123](https://github.com/Scan-Documents/node-sdk/commit/00bb1237344ad7b4d3cafb5ee3f8015033f581ad))
39+
* **client:** qualify global Blob ([b110292](https://github.com/Scan-Documents/node-sdk/commit/b110292d90aa445e9d73dd7cfa77d2bd57e46aa9))
40+
* **deps:** update dependency @types/node to v20.17.58 ([b435ab1](https://github.com/Scan-Documents/node-sdk/commit/b435ab1ef8e26e20a35842579846c87cd20ff4be))
41+
* **internal:** codegen related update ([5560f78](https://github.com/Scan-Documents/node-sdk/commit/5560f78a373d434a2b1a86f57fd14da284581bc0))
42+
* **internal:** codegen related update ([3554f3c](https://github.com/Scan-Documents/node-sdk/commit/3554f3cab5ce7969889c889bb833e8aa45740159))
43+
* **internal:** codegen related update ([4d9ab35](https://github.com/Scan-Documents/node-sdk/commit/4d9ab3563cfe93b7a61097a484e9f37f7604c5b7))
44+
* **internal:** codegen related update ([b47458d](https://github.com/Scan-Documents/node-sdk/commit/b47458d7c6269e4acbfc6fb4b469597581633e49))
45+
* **internal:** formatting change ([5a0343c](https://github.com/Scan-Documents/node-sdk/commit/5a0343c3751c96f3637abfd0ea84df271abf70a2))
46+
* **internal:** make mcp-server publishing public by defaut ([cb532ff](https://github.com/Scan-Documents/node-sdk/commit/cb532ff281e968d46b3d5dd5710d36ac9bdd530e))
47+
* **internal:** move publish config ([1947212](https://github.com/Scan-Documents/node-sdk/commit/1947212b285dd090527c98fb607308003036e1e3))
48+
* **internal:** refactor array check ([39a25bf](https://github.com/Scan-Documents/node-sdk/commit/39a25bf20d4cafdca951e6aa0fa0bf74a00b378f))
49+
* **internal:** remove redundant imports config ([cfe049c](https://github.com/Scan-Documents/node-sdk/commit/cfe049c407230ed71a4216f893cedb1c85ba856e))
50+
* **internal:** update comment in script ([3be780c](https://github.com/Scan-Documents/node-sdk/commit/3be780cb1d9bc7136a79a2f130617a42bd38b081))
51+
* make some internal functions async ([064caed](https://github.com/Scan-Documents/node-sdk/commit/064caed6799b56c06d441e02319f31ca79f0549f))
52+
* **mcp:** add cors to oauth metadata route ([e47261c](https://github.com/Scan-Documents/node-sdk/commit/e47261c644a962bc76c7ad5afb92ded38034098d))
53+
* **mcp:** document remote server in README.md ([64f8b3a](https://github.com/Scan-Documents/node-sdk/commit/64f8b3a076b881b43878aa2e78c2942a6b53d98d))
54+
* **mcp:** formatting ([32923a2](https://github.com/Scan-Documents/node-sdk/commit/32923a200bbe8c6ba2658428be044bd14e5f09cb))
55+
* **mcp:** minor cleanup of types and package.json ([938a40b](https://github.com/Scan-Documents/node-sdk/commit/938a40bc3dc1b8f4cacdea781c23dea0680ac1eb))
56+
* **mcp:** refactor streamable http transport ([8a955ea](https://github.com/Scan-Documents/node-sdk/commit/8a955eaa7bb01a0a85817567cd0000a15cdca487))
57+
* **mcp:** rework imports in tools ([df24a2f](https://github.com/Scan-Documents/node-sdk/commit/df24a2f821d16e2ef006bf6715be5d87b1179a83))
58+
* **mcp:** update package.json ([261f3f5](https://github.com/Scan-Documents/node-sdk/commit/261f3f5cef6e12b4d435264bc11ce5cc52f6ec6b))
59+
* **mcp:** update README ([b821690](https://github.com/Scan-Documents/node-sdk/commit/b821690f1b0a2494dcb6b2ab0643a212b4a040dc))
60+
* **mcp:** update types ([079839c](https://github.com/Scan-Documents/node-sdk/commit/079839c4089e8cf828d49a36339dc8764e1b6e71))
61+
* **ts:** reorder package.json imports ([596fc4f](https://github.com/Scan-Documents/node-sdk/commit/596fc4f6d1323ceeecf8eef62cc165d5430f9069))
62+
* update @stainless-api/prism-cli to v5.15.0 ([b609b33](https://github.com/Scan-Documents/node-sdk/commit/b609b338d3f8db485a3ede5f4fe920db21c79149))
63+
* update CI script ([2ace297](https://github.com/Scan-Documents/node-sdk/commit/2ace29730fa8c3b74531c0945e955b1339fafc6c))
64+
365
## 0.1.0-alpha.5 (2025-06-24)
466

567
Full Changelog: [v0.1.0-alpha.4...v0.1.0-alpha.5](https://github.com/Scan-Documents/node-sdk/compare/v0.1.0-alpha.4...v0.1.0-alpha.5)

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ await client.files.upload({ file: await toFile(Buffer.from('my bytes'), 'file'),
7979
await client.files.upload({ file: await toFile(new Uint8Array([0, 1, 2]), 'file'), name: 'File Name' });
8080
```
8181

82-
8382
## Task operations
8483

8584
Operations can be found under the `imageOperations` and `pdfOperations` resources.

api.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ Types:
5454
- <code><a href="./src/resources/image-operations.ts">ExtractTextRequest</a></code>
5555
- <code><a href="./src/resources/image-operations.ts">ExtractTextResponse</a></code>
5656
- <code><a href="./src/resources/image-operations.ts">ImageFromTaskResponse</a></code>
57+
- <code><a href="./src/resources/image-operations.ts">ScanResponse</a></code>
5758
- <code><a href="./src/resources/image-operations.ts">WarpRequest</a></code>
5859
- <code><a href="./src/resources/image-operations.ts">WarpResponse</a></code>
5960

@@ -63,6 +64,7 @@ Methods:
6364
- <code title="post /v1/image-operations/convert">client.imageOperations.<a href="./src/resources/image-operations.ts">convert</a>({ ...params }) -> ConvertResponse</code>
6465
- <code title="post /v1/image-operations/detect-documents">client.imageOperations.<a href="./src/resources/image-operations.ts">detectDocuments</a>({ ...params }) -> DetectDocumentsResponse</code>
6566
- <code title="post /v1/image-operations/extract-text">client.imageOperations.<a href="./src/resources/image-operations.ts">extractText</a>({ ...params }) -> ExtractTextResponse</code>
67+
- <code title="post /v1/image-operations/scan">client.imageOperations.<a href="./src/resources/image-operations.ts">scan</a>({ ...params }) -> ScanResponse</code>
6668
- <code title="post /v1/image-operations/warp">client.imageOperations.<a href="./src/resources/image-operations.ts">warp</a>({ ...params }) -> WarpResponse</code>
6769

6870
# PdfOperations

bin/check-release-environment

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
errors=()
44

55
if [ -z "${NPM_TOKEN}" ]; then
6-
errors+=("The SCAN_DOCUMENTS_NPM_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets")
6+
errors+=("The NPM_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets")
77
fi
88

99
lenErrors=${#errors[@]}

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: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "scan-documents",
3-
"version": "0.1.0-alpha.5",
3+
"version": "0.1.0-alpha.6",
44
"description": "The official TypeScript library for the Scan Documents API",
55
"author": "Scan Documents <support@scan-documents.com>",
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",
@@ -30,7 +33,6 @@
3033
"@swc/jest": "^0.2.29",
3134
"@types/jest": "^29.4.0",
3235
"@types/node": "^20.17.6",
33-
"typescript-eslint": "8.31.1",
3436
"@typescript-eslint/eslint-plugin": "8.31.1",
3537
"@typescript-eslint/parser": "8.31.1",
3638
"eslint": "^9.20.1",
@@ -42,13 +44,11 @@
4244
"publint": "^0.2.12",
4345
"ts-jest": "^29.1.0",
4446
"ts-node": "^10.5.0",
45-
"tsc-multi": "https://github.com/stainless-api/tsc-multi/releases/download/v1.1.8/tsc-multi.tgz",
47+
"tsc-multi": "https://github.com/stainless-api/tsc-multi/releases/download/v1.1.9/tsc-multi.tgz",
4648
"tsconfig-paths": "^4.0.0",
47-
"typescript": "5.8.3"
48-
},
49-
"imports": {
50-
"scan-documents": ".",
51-
"scan-documents/*": "./src/*"
49+
"tslib": "^2.8.1",
50+
"typescript": "5.8.3",
51+
"typescript-eslint": "8.31.1"
5252
},
5353
"exports": {
5454
".": {

packages/mcp-server/README.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,43 @@ over time, you can manually enable or disable certain capabilities:
126126
--resource=cards,accounts --operation=read --tag=kyc --no-tool=create_cards
127127
```
128128

129+
## Running remotely
130+
131+
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.
132+
133+
Authorization can be provided via the following headers:
134+
| Header | Equivalent client option | Security scheme |
135+
| ----------- | ------------------------ | --------------- |
136+
| `x-api-key` | `apiKey` | ApiKeyAuth |
137+
138+
A configuration JSON for this server might look like this, assuming the server is hosted at `http://localhost:3000`:
139+
140+
```json
141+
{
142+
"mcpServers": {
143+
"scan_documents_api": {
144+
"url": "http://localhost:3000",
145+
"headers": {
146+
"x-api-key": "My API Key"
147+
}
148+
}
149+
}
150+
}
151+
```
152+
153+
The command-line arguments for filtering tools and specifying clients can also be used as query parameters in the URL.
154+
For example, to exclude specific tools while including others, use the URL:
155+
156+
```
157+
http://localhost:3000?resource=cards&resource=accounts&no_tool=create_cards
158+
```
159+
160+
Or, to configure for the Cursor client, with a custom max tool name length, use the URL:
161+
162+
```
163+
http://localhost:3000?client=cursor&capability=tool-name-length%3D40
164+
```
165+
129166
## Importing the tools and server individually
130167

131168
```js
@@ -188,6 +225,8 @@ The following tools are available in this MCP server.
188225
- `convert_image_operations` (`write`): Creates a task to convert an image file to a different format.
189226
- `detect_documents_image_operations` (`write`): Creates a task to detect document boundaries within an image.
190227
- `extract_text_image_operations` (`write`): Creates a task to extract text from a specified image file.
228+
- `scan_image_operations` (`write`): Creates a task to scan an image file.
229+
This is an equivalent operation for `detect-documents` and `warp` combined, additionally it can apply effects to the scanned image.
191230
- `warp_image_operations` (`write`): Creates a task to apply perspective correction (warp) to an image based on detected document boundaries.
192231

193232
### Resource `pdf_operations`:

0 commit comments

Comments
 (0)