Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
580f119
chore(internal): codegen related update
stainless-app[bot] Jan 28, 2026
18bf436
fix(mcp): allow falling back for required env variables
stainless-app[bot] Jan 28, 2026
cc00939
fix(publish): use npm registry directly for trusted publishing support
stainless-app[bot] Jan 29, 2026
eab895b
chore(internal): codegen related update
stainless-app[bot] Jan 29, 2026
2516f9e
fix(docs): fix mcp installation instructions for remote servers
stainless-app[bot] Jan 29, 2026
d6df377
chore(mcp): up tsconfig lib version to es2022
stainless-app[bot] Jan 29, 2026
41501e5
feat(api): api update
stainless-app[bot] Jan 30, 2026
9a0ae30
fix(client): avoid memory leak with abort signals
stainless-app[bot] Feb 3, 2026
72b0e71
chore(client): do not parse responses with empty content-length
stainless-app[bot] Feb 3, 2026
2a7bba1
chore(internal): support oauth authorization code flow for MCP servers
stainless-app[bot] Feb 3, 2026
5c034e0
chore(client): restructure abort controller binding
stainless-app[bot] Feb 5, 2026
c5a7d72
chore(internal): refactor flag parsing for MCP servers and add debug …
stainless-app[bot] Feb 5, 2026
5f74578
feat(mcp): add initial server instructions
stainless-app[bot] Feb 5, 2026
2e1b9c5
fix(client): avoid removing abort listener too early
stainless-app[bot] Feb 6, 2026
eecad0a
chore(internal): fix pagination internals not accepting option promises
stainless-app[bot] Feb 6, 2026
7eab85a
chore(internal): add health check to MCP server when running in HTTP …
stainless-app[bot] Feb 7, 2026
4cac71f
release: 14.6.0
stainless-app[bot] Feb 7, 2026
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 @@
{
".": "14.5.0"
".": "14.6.0"
}
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-235b86151cc83acadb1123adb78fd2b383f97a96daa1b19f36d5be77f546fce0.yml
openapi_spec_hash: fb2c7bfec6572f694f9a2f53e44e67a8
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/conductor%2Fconductor-c92c78f67f08c9b7c4d6925584c54690ae2381d4d5033cecff3a47e68ff1eb08.yml
openapi_spec_hash: cdd305329a64f2c49890863045f79e66
config_hash: 89303a38c78d93021ba8a584462375bd
31 changes: 31 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,36 @@
# Changelog

## 14.6.0 (2026-02-07)

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

### Features

* **api:** api update ([41501e5](https://github.com/conductor-is/quickbooks-desktop-node/commit/41501e5022e1793cb7d36515bc268618130410d6))
* **mcp:** add initial server instructions ([5f74578](https://github.com/conductor-is/quickbooks-desktop-node/commit/5f74578d5dbe787f25d2011e209b9d87f132937a))


### Bug Fixes

* **client:** avoid memory leak with abort signals ([9a0ae30](https://github.com/conductor-is/quickbooks-desktop-node/commit/9a0ae30854381b1c3b07652bfb67ef029faa352c))
* **client:** avoid removing abort listener too early ([2e1b9c5](https://github.com/conductor-is/quickbooks-desktop-node/commit/2e1b9c5e93654917092150027d10a07b0e1603a6))
* **docs:** fix mcp installation instructions for remote servers ([2516f9e](https://github.com/conductor-is/quickbooks-desktop-node/commit/2516f9e33a560d6c924e6d774a4523e0f260c9c3))
* **mcp:** allow falling back for required env variables ([18bf436](https://github.com/conductor-is/quickbooks-desktop-node/commit/18bf436df5d8b92e6260aa9e6aef39aa1dd174b7))
* **publish:** use npm registry directly for trusted publishing support ([cc00939](https://github.com/conductor-is/quickbooks-desktop-node/commit/cc009396fa45f6e1d4928a8b5dffa16812879b34))


### Chores

* **client:** do not parse responses with empty content-length ([72b0e71](https://github.com/conductor-is/quickbooks-desktop-node/commit/72b0e710e3397f9905f6fc1c2aaf6eafdab11e6e))
* **client:** restructure abort controller binding ([5c034e0](https://github.com/conductor-is/quickbooks-desktop-node/commit/5c034e00d9864143df9bc2d75be9f6d2cb6d4909))
* **internal:** add health check to MCP server when running in HTTP mode ([7eab85a](https://github.com/conductor-is/quickbooks-desktop-node/commit/7eab85a38a977eb1e4c951bd211d46fe7ebbc91f))
* **internal:** codegen related update ([eab895b](https://github.com/conductor-is/quickbooks-desktop-node/commit/eab895b51ed13a73b634fa6e09c3d14b2248a225))
* **internal:** codegen related update ([580f119](https://github.com/conductor-is/quickbooks-desktop-node/commit/580f11903dcdaf98c586992fea5f2299b0eb1093))
* **internal:** fix pagination internals not accepting option promises ([eecad0a](https://github.com/conductor-is/quickbooks-desktop-node/commit/eecad0af408fc55c6d9192bd84c8be85fa23739c))
* **internal:** refactor flag parsing for MCP servers and add debug flag ([c5a7d72](https://github.com/conductor-is/quickbooks-desktop-node/commit/c5a7d722f04e6ac3646e17d1587ff481729b6964))
* **internal:** support oauth authorization code flow for MCP servers ([2a7bba1](https://github.com/conductor-is/quickbooks-desktop-node/commit/2a7bba1e7391fb78af3b9e5859e22a5e79100ef6))
* **mcp:** up tsconfig lib version to es2022 ([d6df377](https://github.com/conductor-is/quickbooks-desktop-node/commit/d6df37726aa33b46988d69c51d9da34a935af96e))

## 14.5.0 (2026-01-27)

Full Changelog: [v14.4.0...v14.5.0](https://github.com/conductor-is/quickbooks-desktop-node/compare/v14.4.0...v14.5.0)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ The REST API documentation can be found on [docs.conductor.is](https://docs.cond

Use the Conductor MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.

[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=conductor-node-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsImNvbmR1Y3Rvci1ub2RlLW1jcCJdfQ)
[![Install in VS Code](https://img.shields.io/badge/_-Add_to_VS_Code-blue?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCA0MCA0MCI+PHBhdGggZmlsbD0iI0VFRSIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMzAuMjM1IDM5Ljg4NGEyLjQ5MSAyLjQ5MSAwIDAgMS0xLjc4MS0uNzNMMTIuNyAyNC43OGwtMy40NiAyLjYyNC0zLjQwNiAyLjU4MmExLjY2NSAxLjY2NSAwIDAgMS0xLjA4Mi4zMzggMS42NjQgMS42NjQgMCAwIDEtMS4wNDYtLjQzMWwtMi4yLTJhMS42NjYgMS42NjYgMCAwIDEgMC0yLjQ2M0w3LjQ1OCAyMCA0LjY3IDE3LjQ1MyAxLjUwNyAxNC41N2ExLjY2NSAxLjY2NSAwIDAgMSAwLTIuNDYzbDIuMi0yYTEuNjY1IDEuNjY1IDAgMCAxIDIuMTMtLjA5N2w2Ljg2MyA1LjIwOUwyOC40NTIuODQ0YTIuNDg4IDIuNDg4IDAgMCAxIDEuODQxLS43MjljLjM1MS4wMDkuNjk5LjA5MSAxLjAxOS4yNDVsOC4yMzYgMy45NjFhMi41IDIuNSAwIDAgMSAxLjQxNSAyLjI1M3YuMDk5LS4wNDVWMzMuMzd2LS4wNDUuMDk1YTIuNTAxIDIuNTAxIDAgMCAxLTEuNDE2IDIuMjU3bC04LjIzNSAzLjk2MWEyLjQ5MiAyLjQ5MiAwIDAgMS0xLjA3Ny4yNDZabS43MTYtMjguOTQ3LTExLjk0OCA5LjA2MiAxMS45NTIgOS4wNjUtLjAwNC0xOC4xMjdaIi8+PC9zdmc+)](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22conductor-node-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22conductor-node-mcp%22%5D%7D)
[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=conductor-node-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsImNvbmR1Y3Rvci1ub2RlLW1jcCJdLCJlbnYiOnsiQ09ORFVDVE9SX1NFQ1JFVF9LRVkiOiJza19jb25kdWN0b3JfLi4uIn19)
[![Install in VS Code](https://img.shields.io/badge/_-Add_to_VS_Code-blue?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCA0MCA0MCI+PHBhdGggZmlsbD0iI0VFRSIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMzAuMjM1IDM5Ljg4NGEyLjQ5MSAyLjQ5MSAwIDAgMS0xLjc4MS0uNzNMMTIuNyAyNC43OGwtMy40NiAyLjYyNC0zLjQwNiAyLjU4MmExLjY2NSAxLjY2NSAwIDAgMS0xLjA4Mi4zMzggMS42NjQgMS42NjQgMCAwIDEtMS4wNDYtLjQzMWwtMi4yLTJhMS42NjYgMS42NjYgMCAwIDEgMC0yLjQ2M0w3LjQ1OCAyMCA0LjY3IDE3LjQ1MyAxLjUwNyAxNC41N2ExLjY2NSAxLjY2NSAwIDAgMSAwLTIuNDYzbDIuMi0yYTEuNjY1IDEuNjY1IDAgMCAxIDIuMTMtLjA5N2w2Ljg2MyA1LjIwOUwyOC40NTIuODQ0YTIuNDg4IDIuNDg4IDAgMCAxIDEuODQxLS43MjljLjM1MS4wMDkuNjk5LjA5MSAxLjAxOS4yNDVsOC4yMzYgMy45NjFhMi41IDIuNSAwIDAgMSAxLjQxNSAyLjI1M3YuMDk5LS4wNDVWMzMuMzd2LS4wNDUuMDk1YTIuNTAxIDIuNTAxIDAgMCAxLTEuNDE2IDIuMjU3bC04LjIzNSAzLjk2MWEyLjQ5MiAyLjQ5MiAwIDAgMS0xLjA3Ny4yNDZabS43MTYtMjguOTQ3LTExLjk0OCA5LjA2MiAxMS45NTIgOS4wNjUtLjAwNC0xOC4xMjdaIi8+PC9zdmc+)](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22conductor-node-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22conductor-node-mcp%22%5D%2C%22env%22%3A%7B%22CONDUCTOR_SECRET_KEY%22%3A%22sk_conductor_...%22%7D%7D)

> Note: You may need to set environment variables in your MCP client.

Expand Down
1 change: 1 addition & 0 deletions bin/publish-npm
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,5 @@ fi
npm install --prefix ../oidc/ npm@11.6.2

# Publish with the appropriate tag
export npm_config_registry='https://registry.npmjs.org'
../oidc/node_modules/.bin/npm publish --tag "$TAG"
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.5.0",
"version": "14.6.0",
"description": "The official TypeScript library for the Conductor API",
"author": "Conductor <support@conductor.is>",
"types": "dist/index.d.ts",
Expand Down
6 changes: 3 additions & 3 deletions packages/mcp-server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,22 +37,22 @@ For clients with a configuration JSON, it might look something like this:
If you use Cursor, you can install the MCP server by using the button below. You will need to set your environment variables
in Cursor's `mcp.json`, which can be found in Cursor Settings > Tools & MCP > New MCP Server.

[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=conductor-node-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsImNvbmR1Y3Rvci1ub2RlLW1jcCJdLCJlbnYiOnsiQ09ORFVDVE9SX1NFQ1JFVF9LRVkiOiJTZXQgeW91ciBDT05EVUNUT1JfU0VDUkVUX0tFWSBoZXJlLiJ9fQ)
[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=conductor-node-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsImNvbmR1Y3Rvci1ub2RlLW1jcCJdLCJlbnYiOnsiQ09ORFVDVE9SX1NFQ1JFVF9LRVkiOiJza19jb25kdWN0b3JfLi4uIn19)

### VS Code

If you use MCP, you can install the MCP server by clicking the link below. You will need to set your environment variables
in VS Code's `mcp.json`, which can be found via Command Palette > MCP: Open User Configuration.

[Open VS Code](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22conductor-node-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22conductor-node-mcp%22%5D%2C%22env%22%3A%7B%22CONDUCTOR_SECRET_KEY%22%3A%22Set%20your%20CONDUCTOR_SECRET_KEY%20here.%22%7D%7D)
[Open VS Code](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22conductor-node-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22conductor-node-mcp%22%5D%2C%22env%22%3A%7B%22CONDUCTOR_SECRET_KEY%22%3A%22sk_conductor_...%22%7D%7D)

### Claude Code

If you use Claude Code, you can install the MCP server by running the command below in your terminal. You will need to set your
environment variables in Claude Code's `.claude.json`, which can be found in your home directory.

```
claude mcp add conductor_node_mcp_api --env CONDUCTOR_SECRET_KEY="Your CONDUCTOR_SECRET_KEY here." -- npx -y conductor-node-mcp
claude mcp add conductor_node_mcp_api --env CONDUCTOR_SECRET_KEY="sk_conductor_..." -- npx -y conductor-node-mcp
```

## Code Mode
Expand Down
7 changes: 6 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.5.0",
"version": "14.6.0",
"description": "The official MCP Server for the Conductor API",
"author": "Conductor <support@conductor.is>",
"types": "dist/index.d.ts",
Expand Down Expand Up @@ -34,10 +34,13 @@
"@cloudflare/cabidela": "^0.2.4",
"@modelcontextprotocol/sdk": "^1.25.2",
"@valtown/deno-http-worker": "^0.0.21",
"cookie-parser": "^1.4.6",
"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",
"morgan": "^1.10.0",
"morgan-body": "^2.6.9",
"qs": "^6.14.1",
"typescript": "5.8.3",
"yargs": "^17.7.2",
Expand All @@ -50,9 +53,11 @@
},
"devDependencies": {
"@anthropic-ai/mcpb": "^2.1.2",
"@types/cookie-parser": "^1.4.10",
"@types/cors": "^2.8.19",
"@types/express": "^5.0.3",
"@types/jest": "^29.4.0",
"@types/morgan": "^1.9.10",
"@types/qs": "^6.14.0",
"@types/yargs": "^17.0.8",
"@typescript-eslint/eslint-plugin": "8.31.1",
Expand Down
12 changes: 8 additions & 4 deletions packages/mcp-server/src/code-tool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

import { McpTool, Metadata, ToolCallResult, asErrorResult, asTextContentResult } from './types';
import { Tool } from '@modelcontextprotocol/sdk/types.js';
import { readEnv, readEnvOrError } from './server';
import { readEnv, requireValue } from './server';
import { WorkerInput, WorkerOutput } from './code-tool-types';
import { Conductor } from 'conductor-node';

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

Expand Down Expand Up @@ -55,7 +56,7 @@ export function codeTool(): McpTool {
required: ['code'],
},
};
const handler = async (_: unknown, args: any): Promise<ToolCallResult> => {
const handler = async (client: Conductor, args: any): Promise<ToolCallResult> => {
const code = args.code as string;
const intent = args.intent as string | undefined;

Expand All @@ -71,8 +72,11 @@ export function codeTool(): McpTool {
...(stainlessAPIKey && { Authorization: stainlessAPIKey }),
'Content-Type': 'application/json',
client_envs: JSON.stringify({
CONDUCTOR_SECRET_KEY: readEnvOrError('CONDUCTOR_SECRET_KEY'),
CONDUCTOR_BASE_URL: readEnv('CONDUCTOR_BASE_URL'),
CONDUCTOR_SECRET_KEY: requireValue(
readEnv('CONDUCTOR_SECRET_KEY') ?? conductor.apiKey,
'set CONDUCTOR_SECRET_KEY environment variable or provide apiKey client option',
),
CONDUCTOR_BASE_URL: readEnv('CONDUCTOR_BASE_URL') ?? conductor.baseURL ?? undefined,
}),
},
body: JSON.stringify({
Expand Down
4 changes: 3 additions & 1 deletion packages/mcp-server/src/headers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { IncomingMessage } from 'node:http';
import { ClientOptions } from 'conductor-node';

export const parseAuthHeaders = (req: IncomingMessage): Partial<ClientOptions> => {
export const parseAuthHeaders = (req: IncomingMessage, required?: boolean): Partial<ClientOptions> => {
if (req.headers.authorization) {
const scheme = req.headers.authorization.split(' ')[0]!;
const value = req.headers.authorization.slice(scheme.length + 1);
Expand All @@ -15,6 +15,8 @@ export const parseAuthHeaders = (req: IncomingMessage): Partial<ClientOptions> =
'Unsupported authorization scheme. Expected the "Authorization" header to be a supported scheme (Bearer).',
);
}
} else if (required) {
throw new Error('Missing required Authorization header; see WWW-Authenticate header for details.');
}

const apiKey =
Expand Down
47 changes: 34 additions & 13 deletions packages/mcp-server/src/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,27 @@

import { McpServer } from '@modelcontextprotocol/sdk/server/mcp';
import { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/streamableHttp.js';

import express from 'express';
import morgan from 'morgan';
import morganBody from 'morgan-body';
import { McpOptions } from './options';
import { ClientOptions, initMcpServer, newMcpServer } from './server';
import { parseAuthHeaders } from './headers';

const newServer = ({
const newServer = async ({
clientOptions,
req,
res,
}: {
clientOptions: ClientOptions;
req: express.Request;
res: express.Response;
}): McpServer | null => {
const server = newMcpServer();
}): Promise<McpServer | null> => {
const server = await newMcpServer();

try {
const authOptions = parseAuthHeaders(req);
initMcpServer({
const authOptions = parseAuthHeaders(req, false);
await initMcpServer({
server: server,
clientOptions: {
...clientOptions,
Expand All @@ -45,7 +46,7 @@ const newServer = ({
const post =
(options: { clientOptions: ClientOptions; mcpOptions: McpOptions }) =>
async (req: express.Request, res: express.Response) => {
const server = newServer({ ...options, req, res });
const server = await newServer({ ...options, req, res });
// If we return null, we already set the authorization error.
if (server === null) return;
const transport = new StreamableHTTPServerTransport();
Expand Down Expand Up @@ -75,32 +76,52 @@ const del = async (req: express.Request, res: express.Response) => {

export const streamableHTTPApp = ({
clientOptions = {},
mcpOptions = {},
mcpOptions,
debug,
}: {
clientOptions?: ClientOptions;
mcpOptions?: McpOptions;
mcpOptions: McpOptions;
debug: boolean;
}): express.Express => {
const app = express();
app.set('query parser', 'extended');
app.use(express.json());

if (debug) {
morganBody(app, {
logAllReqHeader: true,
logAllResHeader: true,
logRequestBody: true,
logResponseBody: true,
});
} else {
app.use(morgan('combined'));
}

app.get('/health', async (req: express.Request, res: express.Response) => {
res.status(200).send('OK');
});
app.get('/', get);
app.post('/', post({ clientOptions, mcpOptions }));
app.delete('/', del);

return app;
};

export const launchStreamableHTTPServer = async (options: McpOptions, port: number | string | undefined) => {
const app = streamableHTTPApp({ mcpOptions: options });
const server = app.listen(port);
export const launchStreamableHTTPServer = async (params: {
mcpOptions: McpOptions;
debug: boolean;
port: number | string | undefined;
}) => {
const app = streamableHTTPApp({ mcpOptions: params.mcpOptions, debug: params.debug });
const server = app.listen(params.port);
const address = server.address();

if (typeof address === 'string') {
console.error(`MCP Server running on streamable HTTP at ${address}`);
} else if (address !== null) {
console.error(`MCP Server running on streamable HTTP on port ${address.port}`);
} else {
console.error(`MCP Server running on streamable HTTP on port ${port}`);
console.error(`MCP Server running on streamable HTTP on port ${params.port}`);
}
};
6 changes: 5 additions & 1 deletion packages/mcp-server/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ async function main() {
await launchStdioServer();
break;
case 'http':
await launchStreamableHTTPServer(options, options.port ?? options.socket);
await launchStreamableHTTPServer({
mcpOptions: options,
debug: options.debug,
port: options.port ?? options.socket,
});
break;
}
}
Expand Down
27 changes: 15 additions & 12 deletions packages/mcp-server/src/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { hideBin } from 'yargs/helpers';
import z from 'zod';

export type CLIOptions = McpOptions & {
debug: boolean;
transport: 'stdio' | 'http';
port: number | undefined;
socket: string | undefined;
Expand All @@ -15,32 +16,33 @@ export type McpOptions = {

export function parseCLIOptions(): CLIOptions {
const opts = yargs(hideBin(process.argv))
.option('tools', {
.option('debug', { type: 'boolean', description: 'Enable debug logging' })
.option('no-tools', {
type: 'string',
array: true,
choices: ['code', 'docs'],
description: 'Use dynamic tools or all tools',
description: 'Tools to explicitly disable',
})
.option('no-tools', {
.option('port', {
type: 'number',
default: 3000,
description: 'Port to serve on if using http transport',
})
.option('socket', { type: 'string', description: 'Unix socket to serve on if using http transport' })
.option('tools', {
type: 'string',
array: true,
choices: ['code', 'docs'],
description: 'Do not use any dynamic or all tools',
description: 'Tools to explicitly enable',
})
.option('transport', {
type: 'string',
choices: ['stdio', 'http'],
default: 'stdio',
description: 'What transport to use; stdio for local servers or http for remote servers',
})
.option('port', {
type: 'number',
description: 'Port to serve on if using http transport',
})
.option('socket', {
type: 'string',
description: 'Unix socket to serve on if using http transport',
})
.env('MCP_SERVER')
.version(true)
.help();

const argv = opts.parseSync();
Expand All @@ -56,6 +58,7 @@ export function parseCLIOptions(): CLIOptions {

return {
...(includeDocsTools !== undefined && { includeDocsTools }),
debug: !!argv.debug,
transport,
port: argv.port,
socket: argv.socket,
Expand Down
Loading
Loading