@ductape/mcp 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -802,6 +802,31 @@ async function loadMcpSdk() {
802
802
  'Or v2 alpha: npm install @modelcontextprotocol/server zod @cfworker/json-schema');
803
803
  process.exit(1);
804
804
  }
805
+ function handleCliFlags() {
806
+ const arg = process.argv[2];
807
+ if (arg === '--version' || arg === '-v') {
808
+ // eslint-disable-next-line @typescript-eslint/no-require-imports
809
+ const { version } = require('../package.json');
810
+ process.stdout.write(version + '\n');
811
+ return true;
812
+ }
813
+ if (arg === '--help' || arg === '-h') {
814
+ process.stdout.write('ductape-mcp — Ductape MCP server\n\n' +
815
+ 'Usage: ductape-mcp\n\n' +
816
+ 'The server communicates over stdio and is meant to be spawned by an MCP\n' +
817
+ 'client (Cursor, Claude Desktop, Claude Code). Run it directly only to\n' +
818
+ 'verify the binary is working.\n\n' +
819
+ 'Options:\n' +
820
+ ' --version, -v Print version and exit\n' +
821
+ ' --help, -h Print this message and exit\n\n' +
822
+ 'Environment:\n' +
823
+ ' DUCTAPE_PUBLISHABLE_KEY Your workspace publishable key. Set this in\n' +
824
+ ' the MCP client env config to avoid passing\n' +
825
+ ' publishable_key on every tool call.\n');
826
+ return true;
827
+ }
828
+ return false;
829
+ }
805
830
  async function main() {
806
831
  const { McpServer, StdioServerTransport } = await loadMcpSdk();
807
832
  const server = new McpServer({ name: 'ductape-mcp', version: '0.1.0' });
@@ -919,7 +944,9 @@ async function main() {
919
944
  }
920
945
  await server.connect(transport);
921
946
  }
922
- main().catch((err) => {
923
- console.error(err);
924
- process.exit(1);
925
- });
947
+ if (!handleCliFlags()) {
948
+ main().catch((err) => {
949
+ console.error(err);
950
+ process.exit(1);
951
+ });
952
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ductape/mcp",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "MCP server that exposes Ductape SDK operations via the backend proxy",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
package/src/index.ts CHANGED
@@ -851,6 +851,34 @@ async function loadMcpSdk(): Promise<{
851
851
  process.exit(1);
852
852
  }
853
853
 
854
+ function handleCliFlags(): boolean {
855
+ const arg = process.argv[2];
856
+ if (arg === '--version' || arg === '-v') {
857
+ // eslint-disable-next-line @typescript-eslint/no-require-imports
858
+ const { version } = require('../package.json') as { version: string };
859
+ process.stdout.write(version + '\n');
860
+ return true;
861
+ }
862
+ if (arg === '--help' || arg === '-h') {
863
+ process.stdout.write(
864
+ 'ductape-mcp — Ductape MCP server\n\n' +
865
+ 'Usage: ductape-mcp\n\n' +
866
+ 'The server communicates over stdio and is meant to be spawned by an MCP\n' +
867
+ 'client (Cursor, Claude Desktop, Claude Code). Run it directly only to\n' +
868
+ 'verify the binary is working.\n\n' +
869
+ 'Options:\n' +
870
+ ' --version, -v Print version and exit\n' +
871
+ ' --help, -h Print this message and exit\n\n' +
872
+ 'Environment:\n' +
873
+ ' DUCTAPE_PUBLISHABLE_KEY Your workspace publishable key. Set this in\n' +
874
+ ' the MCP client env config to avoid passing\n' +
875
+ ' publishable_key on every tool call.\n',
876
+ );
877
+ return true;
878
+ }
879
+ return false;
880
+ }
881
+
854
882
  async function main() {
855
883
  const { McpServer, StdioServerTransport } = await loadMcpSdk();
856
884
  const server = new McpServer({ name: 'ductape-mcp', version: '0.1.0' });
@@ -996,7 +1024,9 @@ async function main() {
996
1024
  await server.connect(transport);
997
1025
  }
998
1026
 
999
- main().catch((err) => {
1000
- console.error(err);
1001
- process.exit(1);
1002
- });
1027
+ if (!handleCliFlags()) {
1028
+ main().catch((err) => {
1029
+ console.error(err);
1030
+ process.exit(1);
1031
+ });
1032
+ }