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
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
timeout-minutes: 10
name: lint
runs-on: ${{ github.repository == 'stainless-sdks/conductor-typescript' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata')
steps:
- uses: actions/checkout@v6

Expand All @@ -38,7 +38,7 @@ jobs:
timeout-minutes: 5
name: build
runs-on: ${{ github.repository == 'stainless-sdks/conductor-typescript' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata')
permissions:
contents: read
id-token: write
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/publish-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,14 @@ jobs:

- name: Publish to NPM
run: |
if [ -n "${{ github.event.inputs.path }}" ]; then
PATHS_RELEASED='[\"${{ github.event.inputs.path }}\"]'
if [ -n "$INPUT_PATH" ]; then
PATHS_RELEASED="[\"$INPUT_PATH\"]"
else
PATHS_RELEASED='[\".\", \"packages/mcp-server\"]'
fi
yarn tsn scripts/publish-packages.ts "{ \"paths_released\": \"$PATHS_RELEASED\" }"
env:
INPUT_PATH: ${{ github.event.inputs.path }}

- name: Upload MCP Server DXT GitHub release asset
run: |
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.prism.log
.stdy.log
node_modules
yarn-error.log
codegen.log
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 @@
{
".": "14.7.0"
".": "14.7.1"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 220
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/conductor%2Fconductor-09df225c4fd3265d31ac1bc16ac2774cac8691a201954cfb010e50f06b5ab486.yml
openapi_spec_hash: 75ec4898861584506d099bec5c6f0d2a
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/conductor%2Fconductor-1ec735f7e62a53b7cbeecfc0b383ec25dbe9f51e2f43ba71e42cfb2154be678a.yml
openapi_spec_hash: c287d26ea4eada69d78d90bf0405b307
config_hash: 89303a38c78d93021ba8a584462375bd
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
# Changelog

## 14.7.1 (2026-03-28)

Full Changelog: [v14.7.0...v14.7.1](https://github.com/conductor-is/quickbooks-desktop-node/compare/v14.7.0...v14.7.1)

### Chores

* **ci:** escape input path in publish-npm workflow ([f030968](https://github.com/conductor-is/quickbooks-desktop-node/commit/f0309683c4ec6319301ebd34f69ddd04c54a1841))
* **ci:** skip lint on metadata-only changes ([ec291e5](https://github.com/conductor-is/quickbooks-desktop-node/commit/ec291e5cc4d5b08c06bb4c29bd4cdfb9967c9b7b))
* **internal:** codegen related update ([c90b50d](https://github.com/conductor-is/quickbooks-desktop-node/commit/c90b50d63a7bc2b6c66db7ea7d5c98576eac076d))
* **internal:** fix MCP server TS errors that occur with required client options ([70e7446](https://github.com/conductor-is/quickbooks-desktop-node/commit/70e7446afb5605a1efc80e5d6cb22bd0a7600c76))
* **internal:** support custom-instructions-path flag in MCP servers ([4336070](https://github.com/conductor-is/quickbooks-desktop-node/commit/433607026e44191beabf657191a76955f452fc37))
* **internal:** support local docs search in MCP servers ([8701acf](https://github.com/conductor-is/quickbooks-desktop-node/commit/8701acf01773ac842ad82529a6898d0c2e6e45e5))
* **internal:** update gitignore ([4fb72d4](https://github.com/conductor-is/quickbooks-desktop-node/commit/4fb72d406561523c9ac1bb1a34f05eb8b38bf606))
* **internal:** update multipart form array serialization ([c717678](https://github.com/conductor-is/quickbooks-desktop-node/commit/c7176781ce92eb1badc16a4768b3690b613f3559))
* **tests:** bump steady to v0.19.4 ([a62f8c9](https://github.com/conductor-is/quickbooks-desktop-node/commit/a62f8c93e1a3b07c7c7948171b37e411f3f3a50a))
* **tests:** bump steady to v0.19.5 ([ffeea33](https://github.com/conductor-is/quickbooks-desktop-node/commit/ffeea33589f0cf2c5991b3760949865059d42d13))
* **tests:** bump steady to v0.19.6 ([d742ff5](https://github.com/conductor-is/quickbooks-desktop-node/commit/d742ff582f8a497ef411159e030f2a0fedcda94f))
* **tests:** bump steady to v0.19.7 ([5ea6c55](https://github.com/conductor-is/quickbooks-desktop-node/commit/5ea6c55e950032132e88fae3f7a096aa28bb33ea))

## 14.7.0 (2026-03-20)

Full Changelog: [v14.6.0...v14.7.0](https://github.com/conductor-is/quickbooks-desktop-node/compare/v14.6.0...v14.7.0)
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": "conductor-node",
"version": "14.7.0",
"version": "14.7.1",
"description": "The official TypeScript library for the Conductor API",
"author": "Conductor <support@conductor.is>",
"types": "dist/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/mcp-server/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"dxt_version": "0.2",
"name": "conductor-node-mcp",
"version": "14.7.0",
"version": "14.7.1",
"description": "The official MCP Server for the Conductor API",
"author": {
"name": "Conductor",
Expand Down
3 changes: 2 additions & 1 deletion packages/mcp-server/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "conductor-node-mcp",
"version": "14.7.0",
"version": "14.7.1",
"description": "The official MCP Server for the Conductor API",
"author": "Conductor <support@conductor.is>",
"types": "dist/index.d.ts",
Expand Down Expand Up @@ -41,6 +41,7 @@
"cors": "^2.8.5",
"express": "^5.1.0",
"fuse.js": "^7.1.0",
"minisearch": "^7.2.0",
"jq-web": "https://github.com/stainless-api/jq-web/releases/download/v0.8.8/jq-web.tar.gz",
"pino": "^10.3.1",
"pino-http": "^11.0.0",
Expand Down
16 changes: 7 additions & 9 deletions packages/mcp-server/src/code-tool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -286,15 +286,13 @@ const localDenoHandler = async ({

// Strip null/undefined values so that the worker SDK client can fall back to
// reading from environment variables (including any upstreamClientEnvs).
const opts: ClientOptions = Object.fromEntries(
Object.entries({
baseURL: client.baseURL,
apiKey: client.apiKey,
defaultHeaders: {
'X-Stainless-MCP': 'true',
},
}).filter(([_, v]) => v != null),
) as ClientOptions;
const opts = {
...(client.baseURL != null ? { baseURL: client.baseURL } : undefined),
...(client.apiKey != null ? { apiKey: client.apiKey } : undefined),
defaultHeaders: {
'X-Stainless-MCP': 'true',
},
} satisfies Partial<ClientOptions> as ClientOptions;

const req = worker.request(
'http://localhost',
Expand Down
66 changes: 56 additions & 10 deletions packages/mcp-server/src/docs-search-tool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import { Tool } from '@modelcontextprotocol/sdk/types.js';
import { Metadata, McpRequestContext, asTextContentResult } from './types';
import { getLogger } from './logger';
import type { LocalDocsSearch } from './local-docs-search';

export const metadata: Metadata = {
resource: 'all',
Expand Down Expand Up @@ -43,20 +44,49 @@ export const tool: Tool = {
const docsSearchURL =
process.env['DOCS_SEARCH_URL'] || 'https://api.stainless.com/api/projects/conductor/docs/search';

export const handler = async ({
reqContext,
args,
}: {
reqContext: McpRequestContext;
args: Record<string, unknown> | undefined;
}) => {
let _localSearch: LocalDocsSearch | undefined;

export function setLocalSearch(search: LocalDocsSearch): void {
_localSearch = search;
}

const SUPPORTED_LANGUAGES = new Set(['http', 'typescript', 'javascript']);

async function searchLocal(args: Record<string, unknown>): Promise<unknown> {
if (!_localSearch) {
throw new Error('Local search not initialized');
}

const query = (args['query'] as string) ?? '';
const language = (args['language'] as string) ?? 'typescript';
const detail = (args['detail'] as string) ?? 'verbose';

if (!SUPPORTED_LANGUAGES.has(language)) {
throw new Error(
`Local docs search only supports HTTP, TypeScript, and JavaScript. Got language="${language}". ` +
`Use --docs-search-mode stainless-api for other languages, or set language to "http", "typescript", or "javascript".`,
);
}

return _localSearch.search({
query,
language,
detail,
maxResults: 10,
}).results;
}

async function searchRemote(
args: Record<string, unknown>,
stainlessApiKey: string | undefined,
): Promise<unknown> {
const body = args as any;
const query = new URLSearchParams(body).toString();

const startTime = Date.now();
const result = await fetch(`${docsSearchURL}?${query}`, {
headers: {
...(reqContext.stainlessApiKey && { Authorization: reqContext.stainlessApiKey }),
...(stainlessApiKey && { Authorization: stainlessApiKey }),
},
});

Expand All @@ -75,7 +105,7 @@ export const handler = async ({
'Got error response from docs search tool',
);

if (result.status === 404 && !reqContext.stainlessApiKey) {
if (result.status === 404 && !stainlessApiKey) {
throw new Error(
'Could not find docs for this project. You may need to provide a Stainless API key via the STAINLESS_API_KEY environment variable, the --stainless-api-key flag, or the x-stainless-api-key HTTP header.',
);
Expand All @@ -94,7 +124,23 @@ export const handler = async ({
},
'Got docs search result',
);
return asTextContentResult(resultBody);
return resultBody;
}

export const handler = async ({
reqContext,
args,
}: {
reqContext: McpRequestContext;
args: Record<string, unknown> | undefined;
}) => {
const body = args ?? {};

if (_localSearch) {
return asTextContentResult(await searchLocal(body));
}

return asTextContentResult(await searchRemote(body, reqContext.stainlessApiKey));
};

export default { metadata, tool, handler };
3 changes: 2 additions & 1 deletion packages/mcp-server/src/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ const newServer = async ({
res: express.Response;
}): Promise<McpServer | null> => {
const stainlessApiKey = getStainlessApiKey(req, mcpOptions);
const server = await newMcpServer(stainlessApiKey);
const customInstructionsPath = mcpOptions.customInstructionsPath;
const server = await newMcpServer({ stainlessApiKey, customInstructionsPath });

const authOptions = parseClientAuthHeaders(req, false);

Expand Down
31 changes: 27 additions & 4 deletions packages/mcp-server/src/instructions.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

import fs from 'fs/promises';
import { readEnv } from './util';
import { getLogger } from './logger';

Expand All @@ -12,9 +13,15 @@ interface InstructionsCacheEntry {

const instructionsCache = new Map<string, InstructionsCacheEntry>();

export async function getInstructions(stainlessApiKey: string | undefined): Promise<string> {
export async function getInstructions({
stainlessApiKey,
customInstructionsPath,
}: {
stainlessApiKey?: string | undefined;
customInstructionsPath?: string | undefined;
}): Promise<string> {
const now = Date.now();
const cacheKey = stainlessApiKey ?? '';
const cacheKey = customInstructionsPath ?? stainlessApiKey ?? '';
const cached = instructionsCache.get(cacheKey);

if (cached && now - cached.fetchedAt <= INSTRUCTIONS_CACHE_TTL_MS) {
Expand All @@ -28,12 +35,28 @@ export async function getInstructions(stainlessApiKey: string | undefined): Prom
}
}

const fetchedInstructions = await fetchLatestInstructions(stainlessApiKey);
let fetchedInstructions: string;

if (customInstructionsPath) {
fetchedInstructions = await fetchLatestInstructionsFromFile(customInstructionsPath);
} else {
fetchedInstructions = await fetchLatestInstructionsFromApi(stainlessApiKey);
}

instructionsCache.set(cacheKey, { fetchedInstructions, fetchedAt: now });
return fetchedInstructions;
}

async function fetchLatestInstructions(stainlessApiKey: string | undefined): Promise<string> {
async function fetchLatestInstructionsFromFile(path: string): Promise<string> {
try {
return await fs.readFile(path, 'utf-8');
} catch (error) {
getLogger().error({ error, path }, 'Error fetching instructions from file');
throw error;
}
}

async function fetchLatestInstructionsFromApi(stainlessApiKey: string | undefined): Promise<string> {
// Setting the stainless API key is optional, but may be required
// to authenticate requests to the Stainless API.
const response = await fetch(
Expand Down
Loading
Loading