Skip to content
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 @@
{
".": "0.1.0-alpha.19"
".": "0.1.0-alpha.20"
}
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 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)

### Bug Fixes

* **mcp:** update code tool prompt ([008c333](https://github.com/Scan-Documents/node-sdk/commit/008c333df360441c300d039d0f8d7c71697d2f4e))

## 0.1.0-alpha.19 (2026-01-08)

Full Changelog: [v0.1.0-alpha.18...v0.1.0-alpha.19](https://github.com/Scan-Documents/node-sdk/compare/v0.1.0-alpha.18...v0.1.0-alpha.19)
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.19",
"version": "0.1.0-alpha.20",
"description": "The official TypeScript library for the Scan Documents API",
"author": "Scan Documents <support@scan-documents.com>",
"types": "dist/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion 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.19",
"version": "0.1.0-alpha.20",
"description": "The official MCP Server for the Scan Documents API",
"author": "Scan Documents <support@scan-documents.com>",
"types": "dist/index.d.ts",
Expand Down
22 changes: 20 additions & 2 deletions packages/mcp-server/src/code-tool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,25 @@ import { McpTool, Metadata, ToolCallResult, asErrorResult, asTextContentResult }
import { Tool } from '@modelcontextprotocol/sdk/types.js';
import { readEnv, readEnvOrError } from './server';
import { WorkerInput, WorkerOutput } from './code-tool-types';

const prompt = `Runs JavaScript code to interact with the Scan Documents API.

You are a skilled programmer writing code to interface with the service.
Define an async function named "run" that takes a single parameter of an initialized SDK client and it will be run.
For example:

\`\`\`
async function run(client) {
const file = await client.files.upload({ file: fs.createReadStream('path/to/file'), name: 'REPLACE_ME' });
}
\`\`\`

You will be returned anything that your function returns, plus the results of any console.log statements.
Do not add try-catch blocks for single API calls. The tool will handle errors for you.
Do not add comments unless necessary for generating better code.
Code will run in a container, and cannot interact with the network outside of the given SDK client.
Variables will not persist between calls, so make sure to return or log any data you might need later.`;

/**
* A tool that runs code against a copy of the SDK.
*
Expand All @@ -17,8 +36,7 @@ export function codeTool(): McpTool {
const metadata: Metadata = { resource: 'all', operation: 'write', tags: [] };
const tool: Tool = {
name: 'execute',
description:
'Runs JavaScript code to interact with the API.\n\nYou are a skilled programmer writing code to interface with the service.\nDefine an async function named "run" that takes a single parameter of an initialized SDK client and it will be run.\nWrite code within this template:\n\n```\nasync function run(client) {\n // Fill this out\n}\n```\n\nYou will be returned anything that your function returns, plus the results of any console.log statements.\nIf any code triggers an error, the tool will return an error response, so you do not need to add error handling unless you want to output something more helpful than the raw error.\nIt is not necessary to add comments to code, unless by adding those comments you believe that you can generate better code.\nThis code will run in a container, and you will not be able to use fetch or otherwise interact with the network calls other than through the client you are given.\nAny variables you define won\'t live between successive uses of this call, so make sure to return or log any data you might need later.',
description: prompt,
inputSchema: { type: 'object', properties: { code: { type: 'string' } } },
};
const handler = async (_: unknown, args: any): Promise<ToolCallResult> => {
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.19',
version: '0.1.0-alpha.20',
},
{ capabilities: { tools: {}, logging: {} } },
);
Expand Down
2 changes: 1 addition & 1 deletion src/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const VERSION = '0.1.0-alpha.19'; // x-release-please-version
export const VERSION = '0.1.0-alpha.20'; // x-release-please-version