@docrouter/mcp 0.1.0 → 0.1.1

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.mjs CHANGED
@@ -21,9 +21,83 @@ var ConfigSchema = z.object({
21
21
  timeout: z.number().default(3e4),
22
22
  retries: z.number().default(3)
23
23
  });
24
+ function showTools() {
25
+ const toolNames = tools.map((tool) => tool.name).sort();
26
+ console.log(toolNames.join("\n"));
27
+ }
28
+ function showClaudeMd() {
29
+ try {
30
+ const currentFile = fileURLToPath(import.meta.url);
31
+ const currentDir = dirname(currentFile);
32
+ const claudePath = join(currentDir, "CLAUDE.md");
33
+ const claudeContent = readFileSync(claudePath, "utf-8");
34
+ console.log(claudeContent);
35
+ } catch (error) {
36
+ console.error(`Error reading CLAUDE.md: ${error instanceof Error ? error.message : "Unknown error"}`);
37
+ process.exit(1);
38
+ }
39
+ }
40
+ function showHelp() {
41
+ console.log(`
42
+ DocRouter MCP Server v0.1.0
43
+
44
+ USAGE:
45
+ docrouter-mcp [OPTIONS]
46
+
47
+ DESCRIPTION:
48
+ DocRouter MCP (Model Context Protocol) server that provides access to DocRouter
49
+ document processing, OCR, LLM extraction, and form management capabilities.
50
+
51
+ OPTIONS:
52
+ --url <URL> DocRouter API base URL
53
+ (default: https://app.docrouter.ai/fastapi)
54
+ --org-id <ID> DocRouter organization ID
55
+ --org-token <TOKEN> DocRouter organization API token
56
+ --timeout <MS> Request timeout in milliseconds (default: 30000)
57
+ --retries <COUNT> Number of retry attempts (default: 3)
58
+ --tools List all supported MCP tools
59
+ --claude-md Print CLAUDE.md contents
60
+ -h, --help Show this help message
61
+
62
+ ENVIRONMENT VARIABLES:
63
+ DOCROUTER_API_URL DocRouter API base URL
64
+ DOCROUTER_ORG_ID DocRouter organization ID
65
+ DOCROUTER_ORG_API_TOKEN DocRouter organization API token
66
+
67
+ EXAMPLES:
68
+ # Using command line arguments
69
+ docrouter-mcp --org-id "org123" --org-token "token456"
70
+
71
+ # Using environment variables
72
+ export DOCROUTER_ORG_ID="org123"
73
+ export DOCROUTER_ORG_API_TOKEN="token456"
74
+ docrouter-mcp
75
+
76
+ # With custom API URL
77
+ docrouter-mcp --url "https://custom.docrouter.ai/fastapi" --org-id "org123" --org-token "token456"
78
+
79
+ REQUIRED:
80
+ Either provide --org-id and --org-token as command line arguments,
81
+ or set DOCROUTER_ORG_ID and DOCROUTER_ORG_API_TOKEN environment variables.
82
+
83
+ For more information about DocRouter, visit: https://docrouter.ai
84
+ `);
85
+ }
24
86
  function parseConfig() {
25
87
  const args = process.argv.slice(2);
26
88
  const config = {};
89
+ if (args.includes("--help") || args.includes("-h")) {
90
+ showHelp();
91
+ process.exit(0);
92
+ }
93
+ if (args.includes("--tools")) {
94
+ showTools();
95
+ process.exit(0);
96
+ }
97
+ if (args.includes("--claude-md")) {
98
+ showClaudeMd();
99
+ process.exit(0);
100
+ }
27
101
  for (let i = 0; i < args.length; i += 2) {
28
102
  const key = args[i]?.replace("--", "");
29
103
  const value = args[i + 1];