Skip to content
Open
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
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
runs-on: ${{ github.repository == 'stainless-sdks/scan-documents-typescript' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- name: Set up Node
uses: actions/setup-node@v4
Expand All @@ -41,7 +41,7 @@ jobs:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- name: Set up Node
uses: actions/setup-node@v4
Expand Down Expand Up @@ -83,7 +83,7 @@ jobs:
runs-on: ${{ github.repository == 'stainless-sdks/scan-documents-typescript' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- name: Set up Node
uses: actions/setup-node@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
contents: write

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- name: Set up Node
uses: actions/setup-node@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-doctor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
if: github.repository == 'Scan-Documents/node-sdk' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next')

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- name: Check release environment
run: |
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-alpha.20"
".": "0.1.0-alpha.21"
}
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# Changelog

## 0.1.0-alpha.21 (2026-01-17)

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

### Chores

* **internal:** codegen related update ([135b7ac](https://github.com/Scan-Documents/node-sdk/commit/135b7ac138ba6af646acd821b6099ce35d586405))
* **internal:** codegen related update ([3d1bcfe](https://github.com/Scan-Documents/node-sdk/commit/3d1bcfea16b294cca973e0106497edd055a7ccde))
* **internal:** codegen related update ([f14af8b](https://github.com/Scan-Documents/node-sdk/commit/f14af8b7adc486b0c190eaa26b94a3dd9eb768d7))
* **internal:** codegen related update ([37aa64d](https://github.com/Scan-Documents/node-sdk/commit/37aa64d77c5596809ed2b0f6fd08e6b28c84ed9a))
* **internal:** update `actions/checkout` version ([34bd64b](https://github.com/Scan-Documents/node-sdk/commit/34bd64b80c7bede712ffbebbcb200618c3ea2f9b))
* **internal:** upgrade babel, qs, js-yaml ([82aebc4](https://github.com/Scan-Documents/node-sdk/commit/82aebc49211d3b3e62d5f914af34b4555b674fc9))
* **mcp:** add intent param to execute tool ([f6f24a3](https://github.com/Scan-Documents/node-sdk/commit/f6f24a35d524ad1c4ce1c36e84ba12bb981ac0f0))
* **mcp:** pass intent param to execute handler ([acb4a88](https://github.com/Scan-Documents/node-sdk/commit/acb4a883840651babdff9765b18b167cc16c91e0))
* **mcp:** upgrade dependencies ([3a8fad6](https://github.com/Scan-Documents/node-sdk/commit/3a8fad686828d8956ed1d943854db9afd17d5095))

## 0.1.0-alpha.20 (2026-01-09)

Full Changelog: [v0.1.0-alpha.19...v0.1.0-alpha.20](https://github.com/Scan-Documents/node-sdk/compare/v0.1.0-alpha.19...v0.1.0-alpha.20)
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": "scan-documents",
"version": "0.1.0-alpha.20",
"version": "0.1.0-alpha.21",
"description": "The official TypeScript library for the Scan Documents API",
"author": "Scan Documents <support@scan-documents.com>",
"types": "dist/index.d.ts",
Expand Down
8 changes: 4 additions & 4 deletions packages/mcp-server/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "scan-documents-mcp",
"version": "0.1.0-alpha.20",
"version": "0.1.0-alpha.21",
"description": "The official MCP Server for the Scan Documents API",
"author": "Scan Documents <support@scan-documents.com>",
"types": "dist/index.d.ts",
Expand Down Expand Up @@ -32,13 +32,13 @@
"dependencies": {
"scan-documents": "file:../../dist/",
"@cloudflare/cabidela": "^0.2.4",
"@modelcontextprotocol/sdk": "^1.24.0",
"@modelcontextprotocol/sdk": "^1.25.2",
"@valtown/deno-http-worker": "^0.0.21",
"cors": "^2.8.5",
"express": "^5.1.0",
"fuse.js": "^7.1.0",
"jq-web": "https://github.com/stainless-api/jq-web/releases/download/v0.8.8/jq-web.tar.gz",
"qs": "^6.14.0",
"qs": "^6.14.1",
"typescript": "5.8.3",
"yargs": "^17.7.2",
"zod": "^3.25.20",
Expand All @@ -49,7 +49,7 @@
"mcp-server": "dist/index.js"
},
"devDependencies": {
"@anthropic-ai/mcpb": "1.1.0",
"@anthropic-ai/mcpb": "^2.1.2",
"@types/cors": "^2.8.19",
"@types/express": "^5.0.3",
"@types/jest": "^29.4.0",
Expand Down
1 change: 1 addition & 0 deletions packages/mcp-server/src/code-tool-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export type WorkerInput = {
project_name: string;
code: string;
client_opts: ClientOptions;
intent?: string | undefined;
};
export type WorkerOutput = {
is_error: boolean;
Expand Down
17 changes: 16 additions & 1 deletion packages/mcp-server/src/code-tool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,24 @@ export function codeTool(): McpTool {
const tool: Tool = {
name: 'execute',
description: prompt,
inputSchema: { type: 'object', properties: { code: { type: 'string' } } },
inputSchema: {
type: 'object',
properties: {
code: {
type: 'string',
description: 'Code to execute.',
},
intent: {
type: 'string',
description: 'Task you are trying to perform. Used for improving the service.',
},
},
required: ['code'],
},
};
const handler = async (_: unknown, args: any): Promise<ToolCallResult> => {
const code = args.code as string;
const intent = args.intent as string | undefined;

// this is not required, but passing a Stainless API key for the matching project_name
// will allow you to run code-mode queries against non-published versions of your SDK.
Expand All @@ -61,6 +75,7 @@ export function codeTool(): McpTool {
body: JSON.stringify({
project_name: 'scan-documents',
code,
intent,
client_opts: {},
} satisfies WorkerInput),
});
Expand Down
7 changes: 2 additions & 5 deletions packages/mcp-server/src/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,8 @@ const post =
const server = newServer({ ...options, req, res });
// If we return null, we already set the authorization error.
if (server === null) return;
const transport = new StreamableHTTPServerTransport({
// Stateless server
sessionIdGenerator: undefined,
});
await server.connect(transport);
const transport = new StreamableHTTPServerTransport();
await server.connect(transport as any);
await transport.handleRequest(req, res, req.body);
};

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 @@ -21,7 +21,7 @@ export const newMcpServer = () =>
new McpServer(
{
name: 'scan_documents_api',
version: '0.1.0-alpha.20',
version: '0.1.0-alpha.21',
},
{ capabilities: { tools: {}, logging: {} } },
);
Expand Down
Loading