codepage-bridge-mcp 0.1.0

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.
Files changed (97) hide show
  1. package/.claude-plugin/marketplace.json +19 -0
  2. package/.claude-plugin/plugin.json +15 -0
  3. package/.mcp.json +11 -0
  4. package/LICENSE +21 -0
  5. package/README.md +990 -0
  6. package/README_CN.md +781 -0
  7. package/dist/src/core.d.ts +56 -0
  8. package/dist/src/core.js +166 -0
  9. package/dist/src/core.js.map +1 -0
  10. package/dist/src/diff.d.ts +8 -0
  11. package/dist/src/diff.js +11 -0
  12. package/dist/src/diff.js.map +1 -0
  13. package/dist/src/encoding/codec.d.ts +5 -0
  14. package/dist/src/encoding/codec.js +75 -0
  15. package/dist/src/encoding/codec.js.map +1 -0
  16. package/dist/src/encoding/index.d.ts +3 -0
  17. package/dist/src/encoding/index.js +4 -0
  18. package/dist/src/encoding/index.js.map +1 -0
  19. package/dist/src/encoding/rules.d.ts +4 -0
  20. package/dist/src/encoding/rules.js +70 -0
  21. package/dist/src/encoding/rules.js.map +1 -0
  22. package/dist/src/encoding/types.d.ts +22 -0
  23. package/dist/src/encoding/types.js +2 -0
  24. package/dist/src/encoding/types.js.map +1 -0
  25. package/dist/src/filesystem/atomic.d.ts +6 -0
  26. package/dist/src/filesystem/atomic.js +91 -0
  27. package/dist/src/filesystem/atomic.js.map +1 -0
  28. package/dist/src/filesystem/cache.d.ts +21 -0
  29. package/dist/src/filesystem/cache.js +40 -0
  30. package/dist/src/filesystem/cache.js.map +1 -0
  31. package/dist/src/filesystem/index.d.ts +4 -0
  32. package/dist/src/filesystem/index.js +5 -0
  33. package/dist/src/filesystem/index.js.map +1 -0
  34. package/dist/src/filesystem/mutex.d.ts +5 -0
  35. package/dist/src/filesystem/mutex.js +23 -0
  36. package/dist/src/filesystem/mutex.js.map +1 -0
  37. package/dist/src/filesystem/path.d.ts +9 -0
  38. package/dist/src/filesystem/path.js +53 -0
  39. package/dist/src/filesystem/path.js.map +1 -0
  40. package/dist/src/media/errors.d.ts +14 -0
  41. package/dist/src/media/errors.js +29 -0
  42. package/dist/src/media/errors.js.map +1 -0
  43. package/dist/src/media/image.d.ts +11 -0
  44. package/dist/src/media/image.js +81 -0
  45. package/dist/src/media/image.js.map +1 -0
  46. package/dist/src/media/index.d.ts +5 -0
  47. package/dist/src/media/index.js +6 -0
  48. package/dist/src/media/index.js.map +1 -0
  49. package/dist/src/media/notebook.d.ts +47 -0
  50. package/dist/src/media/notebook.js +122 -0
  51. package/dist/src/media/notebook.js.map +1 -0
  52. package/dist/src/media/pdf.d.ts +25 -0
  53. package/dist/src/media/pdf.js +104 -0
  54. package/dist/src/media/pdf.js.map +1 -0
  55. package/dist/src/media/types.d.ts +14 -0
  56. package/dist/src/media/types.js +2 -0
  57. package/dist/src/media/types.js.map +1 -0
  58. package/dist/src/prompts.d.ts +8 -0
  59. package/dist/src/prompts.js +46 -0
  60. package/dist/src/prompts.js.map +1 -0
  61. package/dist/src/schemas.d.ts +138 -0
  62. package/dist/src/schemas.js +81 -0
  63. package/dist/src/schemas.js.map +1 -0
  64. package/dist/src/server.d.ts +159 -0
  65. package/dist/src/server.js +98 -0
  66. package/dist/src/server.js.map +1 -0
  67. package/dist/src/toolTypes.d.ts +31 -0
  68. package/dist/src/toolTypes.js +2 -0
  69. package/dist/src/toolTypes.js.map +1 -0
  70. package/dist/src/tools/edit.d.ts +3 -0
  71. package/dist/src/tools/edit.js +168 -0
  72. package/dist/src/tools/edit.js.map +1 -0
  73. package/dist/src/tools/grep.d.ts +21 -0
  74. package/dist/src/tools/grep.js +192 -0
  75. package/dist/src/tools/grep.js.map +1 -0
  76. package/dist/src/tools/read.d.ts +3 -0
  77. package/dist/src/tools/read.js +137 -0
  78. package/dist/src/tools/read.js.map +1 -0
  79. package/dist/src/tools/write.d.ts +3 -0
  80. package/dist/src/tools/write.js +80 -0
  81. package/dist/src/tools/write.js.map +1 -0
  82. package/dist/src/validation.d.ts +6 -0
  83. package/dist/src/validation.js +42 -0
  84. package/dist/src/validation.js.map +1 -0
  85. package/examples/claude-config/settings.fragment.json +17 -0
  86. package/examples/minimal-project/.encoding-rules +10 -0
  87. package/examples/minimal-project/.mcp.json +11 -0
  88. package/examples/minimal-project/CLAUDE.md +15 -0
  89. package/install/download-release-unix.sh +72 -0
  90. package/install/download-release-windows.ps1 +61 -0
  91. package/install/install-from-release-unix.sh +18 -0
  92. package/install/install-from-release-windows.ps1 +19 -0
  93. package/install/install-from-source-unix.sh +44 -0
  94. package/install/install-from-source-windows.ps1 +45 -0
  95. package/install/install-this-release-unix.sh +37 -0
  96. package/install/install-this-release-windows.ps1 +36 -0
  97. package/package.json +64 -0
@@ -0,0 +1,14 @@
1
+ export interface McpTextBlock {
2
+ type: "text";
3
+ text: string;
4
+ }
5
+ export interface McpImageBlock {
6
+ type: "image";
7
+ data: string;
8
+ mimeType: "image/png" | "image/jpeg" | "image/gif" | "image/webp";
9
+ }
10
+ export type McpContentBlock = McpTextBlock | McpImageBlock;
11
+ export type DecodeBytes = (bytes: Uint8Array) => string;
12
+ export interface BinaryFileReader {
13
+ readFile(path: string): Promise<Uint8Array>;
14
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/media/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,8 @@
1
+ export declare const READ_DESCRIPTION = "Read a file from the local filesystem.";
2
+ export declare const EDIT_DESCRIPTION = "Performs exact string replacements in files.";
3
+ export declare const WRITE_DESCRIPTION = "Write a file to the local filesystem.";
4
+ export declare const READ_PROMPT = "Reads a file from the local filesystem. You can access any file directly by using this tool.\nAssume this tool is able to read all files on the machine. If the User provides a path to a file assume that path is valid. It is okay to read a file that does not exist; an error will be returned.\n\nUsage:\n- The file_path parameter must be an absolute path, not a relative path\n- By default, it reads up to 2000 lines starting from the beginning of the file. Files larger than 256KB will return an error; use offset and limit for larger files\n- When you already know which part of the file you need, only read that part. This can be important for larger files.\n- Results are returned using cat -n format, with line numbers starting at 1\n- This tool allows Claude Code to read images (eg PNG, JPG, etc). When reading an image file the contents are presented visually as Claude Code is a multimodal LLM.\n- This tool can read PDF files (.pdf). For large PDFs (more than 10 pages), you MUST provide the pages parameter to read specific page ranges (e.g., pages: \"1-5\"). Reading a large PDF without the pages parameter will fail. Maximum 20 pages per request.\n- This tool can read Jupyter notebooks (.ipynb files) and returns all cells with their outputs, combining code, text, and visualizations.\n- This tool can only read files, not directories. To read a directory, use an ls command via the Bash tool.\n- You will regularly be asked to read screenshots. If the user provides a path to a screenshot, ALWAYS use this tool to view the file at the path. This tool will work with all temporary file paths.\n- If you read a file that exists but has empty contents you will receive a system reminder warning in place of file contents.";
5
+ export declare const EDIT_PROMPT = "Performs exact string replacements in files.\n\nUsage:\n- You must use your `Read` tool at least once in the conversation before editing. This tool will error if you attempt an edit without reading the file.\n- When editing text from Read tool output, ensure you preserve the exact indentation (tabs/spaces) as it appears AFTER the line number prefix. The line number prefix format is: line number + tab. Everything after that is the actual file content to match. Never include any part of the line number prefix in the old_string or new_string.\n- ALWAYS prefer editing existing files in the codebase. NEVER write new files unless explicitly required.\n- Only use emojis if the user explicitly requests it. Avoid adding emojis to files unless asked.\n- The edit will FAIL if `old_string` is not unique in the file. Either provide a larger string with more surrounding context to make it unique or use `replace_all` to change every instance of `old_string`.\n- Use `replace_all` for replacing and renaming strings across the file. This parameter is useful if you want to rename a variable for instance.";
6
+ export declare const WRITE_PROMPT = "Writes a file to the local filesystem.\n\nUsage:\n- This tool will overwrite the existing file if there is one at the provided path.\n- If this is an existing file, you MUST use the Read tool first to read the file's contents. This tool will fail if you did not read the file first.\n- Prefer the Edit tool for modifying existing files \u2014 it only sends the diff. Only use this tool to create new files or for complete rewrites.\n- NEVER create documentation files (*.md) or README files unless explicitly requested by the User.\n- Only use emojis if the user explicitly requests it. Avoid writing emojis to files unless asked.";
7
+ export declare const GREP_DESCRIPTION = "A powerful search tool built on regular expressions.";
8
+ export declare const GREP_PROMPT = "A powerful search tool for file contents.\n\nUsage:\n- ALWAYS use Grep for search tasks. NEVER invoke grep or rg as a Bash command.\n- Supports full regular expressions, file glob filters, file type filters, context lines, match-only output, multiline matching, pagination, file lists, and per-file counts.\n- Use output_mode=files_with_matches when you only need file paths; this is the default.\n- Use output_mode=content to see matching lines. Line numbers are included by default.\n- Use output_mode=count to see match counts per file.\n- Results are limited to 250 entries by default; use head_limit and offset for pagination.\n- Every file is decoded according to its nearest project .encoding-rules, so legacy encoded content is searched as Unicode transparently.";
@@ -0,0 +1,46 @@
1
+ export const READ_DESCRIPTION = 'Read a file from the local filesystem.';
2
+ export const EDIT_DESCRIPTION = 'Performs exact string replacements in files.';
3
+ export const WRITE_DESCRIPTION = 'Write a file to the local filesystem.';
4
+ export const READ_PROMPT = `Reads a file from the local filesystem. You can access any file directly by using this tool.
5
+ Assume this tool is able to read all files on the machine. If the User provides a path to a file assume that path is valid. It is okay to read a file that does not exist; an error will be returned.
6
+
7
+ Usage:
8
+ - The file_path parameter must be an absolute path, not a relative path
9
+ - By default, it reads up to 2000 lines starting from the beginning of the file. Files larger than 256KB will return an error; use offset and limit for larger files
10
+ - When you already know which part of the file you need, only read that part. This can be important for larger files.
11
+ - Results are returned using cat -n format, with line numbers starting at 1
12
+ - This tool allows Claude Code to read images (eg PNG, JPG, etc). When reading an image file the contents are presented visually as Claude Code is a multimodal LLM.
13
+ - This tool can read PDF files (.pdf). For large PDFs (more than 10 pages), you MUST provide the pages parameter to read specific page ranges (e.g., pages: "1-5"). Reading a large PDF without the pages parameter will fail. Maximum 20 pages per request.
14
+ - This tool can read Jupyter notebooks (.ipynb files) and returns all cells with their outputs, combining code, text, and visualizations.
15
+ - This tool can only read files, not directories. To read a directory, use an ls command via the Bash tool.
16
+ - You will regularly be asked to read screenshots. If the user provides a path to a screenshot, ALWAYS use this tool to view the file at the path. This tool will work with all temporary file paths.
17
+ - If you read a file that exists but has empty contents you will receive a system reminder warning in place of file contents.`;
18
+ export const EDIT_PROMPT = `Performs exact string replacements in files.
19
+
20
+ Usage:
21
+ - You must use your \`Read\` tool at least once in the conversation before editing. This tool will error if you attempt an edit without reading the file.
22
+ - When editing text from Read tool output, ensure you preserve the exact indentation (tabs/spaces) as it appears AFTER the line number prefix. The line number prefix format is: line number + tab. Everything after that is the actual file content to match. Never include any part of the line number prefix in the old_string or new_string.
23
+ - ALWAYS prefer editing existing files in the codebase. NEVER write new files unless explicitly required.
24
+ - Only use emojis if the user explicitly requests it. Avoid adding emojis to files unless asked.
25
+ - The edit will FAIL if \`old_string\` is not unique in the file. Either provide a larger string with more surrounding context to make it unique or use \`replace_all\` to change every instance of \`old_string\`.
26
+ - Use \`replace_all\` for replacing and renaming strings across the file. This parameter is useful if you want to rename a variable for instance.`;
27
+ export const WRITE_PROMPT = `Writes a file to the local filesystem.
28
+
29
+ Usage:
30
+ - This tool will overwrite the existing file if there is one at the provided path.
31
+ - If this is an existing file, you MUST use the Read tool first to read the file's contents. This tool will fail if you did not read the file first.
32
+ - Prefer the Edit tool for modifying existing files — it only sends the diff. Only use this tool to create new files or for complete rewrites.
33
+ - NEVER create documentation files (*.md) or README files unless explicitly requested by the User.
34
+ - Only use emojis if the user explicitly requests it. Avoid writing emojis to files unless asked.`;
35
+ export const GREP_DESCRIPTION = 'A powerful search tool built on regular expressions.';
36
+ export const GREP_PROMPT = `A powerful search tool for file contents.
37
+
38
+ Usage:
39
+ - ALWAYS use Grep for search tasks. NEVER invoke grep or rg as a Bash command.
40
+ - Supports full regular expressions, file glob filters, file type filters, context lines, match-only output, multiline matching, pagination, file lists, and per-file counts.
41
+ - Use output_mode=files_with_matches when you only need file paths; this is the default.
42
+ - Use output_mode=content to see matching lines. Line numbers are included by default.
43
+ - Use output_mode=count to see match counts per file.
44
+ - Results are limited to 250 entries by default; use head_limit and offset for pagination.
45
+ - Every file is decoded according to its nearest project .encoding-rules, so legacy encoded content is searched as Unicode transparently.`;
46
+ //# sourceMappingURL=prompts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompts.js","sourceRoot":"","sources":["../../src/prompts.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,gBAAgB,GAAG,wCAAwC,CAAA;AACxE,MAAM,CAAC,MAAM,gBAAgB,GAAG,8CAA8C,CAAA;AAC9E,MAAM,CAAC,MAAM,iBAAiB,GAAG,uCAAuC,CAAA;AAExE,MAAM,CAAC,MAAM,WAAW,GAAG;;;;;;;;;;;;;8HAamG,CAAA;AAE9H,MAAM,CAAC,MAAM,WAAW,GAAG;;;;;;;;kJAQuH,CAAA;AAElJ,MAAM,CAAC,MAAM,YAAY,GAAG;;;;;;;kGAOsE,CAAA;AAElG,MAAM,CAAC,MAAM,gBAAgB,GAAG,sDAAsD,CAAA;AACtF,MAAM,CAAC,MAAM,WAAW,GAAG;;;;;;;;;0IAS+G,CAAA"}
@@ -0,0 +1,138 @@
1
+ export declare const readInputSchema: {
2
+ readonly type: "object";
3
+ readonly additionalProperties: false;
4
+ readonly required: readonly ["file_path"];
5
+ readonly properties: {
6
+ readonly file_path: {
7
+ readonly type: "string";
8
+ readonly description: "The absolute path to the file to read";
9
+ };
10
+ readonly offset: {
11
+ readonly type: "integer";
12
+ readonly minimum: 0;
13
+ readonly description: "The line number to start reading from. Only provide if the file is too large to read at once";
14
+ };
15
+ readonly limit: {
16
+ readonly type: "integer";
17
+ readonly minimum: 1;
18
+ readonly description: "The number of lines to read. Only provide if the file is too large to read at once.";
19
+ };
20
+ readonly pages: {
21
+ readonly type: "string";
22
+ readonly description: "Page range for PDF files (e.g., \"1-5\", \"3\", \"10-20\"). Only applicable to PDF files. Maximum 20 pages per request.";
23
+ };
24
+ };
25
+ };
26
+ export declare const editInputSchema: {
27
+ readonly type: "object";
28
+ readonly additionalProperties: false;
29
+ readonly required: readonly ["file_path", "old_string", "new_string"];
30
+ readonly properties: {
31
+ readonly file_path: {
32
+ readonly type: "string";
33
+ readonly description: "The absolute path to the file to modify";
34
+ };
35
+ readonly old_string: {
36
+ readonly type: "string";
37
+ readonly description: "The text to replace";
38
+ };
39
+ readonly new_string: {
40
+ readonly type: "string";
41
+ readonly description: "The text to replace it with (must be different from old_string)";
42
+ };
43
+ readonly replace_all: {
44
+ readonly type: "boolean";
45
+ readonly default: false;
46
+ readonly description: "Replace all occurrences of old_string (default false)";
47
+ };
48
+ };
49
+ };
50
+ export declare const writeInputSchema: {
51
+ readonly type: "object";
52
+ readonly additionalProperties: false;
53
+ readonly required: readonly ["file_path", "content"];
54
+ readonly properties: {
55
+ readonly file_path: {
56
+ readonly type: "string";
57
+ readonly description: "The absolute path to the file to write (must be absolute, not relative)";
58
+ };
59
+ readonly content: {
60
+ readonly type: "string";
61
+ readonly description: "The content to write to the file";
62
+ };
63
+ };
64
+ };
65
+ export declare const grepInputSchema: {
66
+ readonly type: "object";
67
+ readonly additionalProperties: false;
68
+ readonly required: readonly ["pattern"];
69
+ readonly properties: {
70
+ readonly pattern: {
71
+ readonly type: "string";
72
+ readonly description: "The regular expression pattern to search for in file contents";
73
+ };
74
+ readonly path: {
75
+ readonly type: "string";
76
+ readonly description: "File or directory to search. Defaults to the current working directory.";
77
+ };
78
+ readonly glob: {
79
+ readonly type: "string";
80
+ readonly description: "Glob pattern used to filter files, for example *.js or **/*.ts";
81
+ };
82
+ readonly type: {
83
+ readonly type: "string";
84
+ readonly description: "File type filter such as js, ts, py, rust, go, or java";
85
+ };
86
+ readonly output_mode: {
87
+ readonly type: "string";
88
+ readonly enum: readonly ["content", "files_with_matches", "count"];
89
+ readonly description: "Output mode. Defaults to files_with_matches.";
90
+ };
91
+ readonly '-i': {
92
+ readonly type: "boolean";
93
+ readonly description: "Case-insensitive search";
94
+ };
95
+ readonly '-n': {
96
+ readonly type: "boolean";
97
+ readonly description: "Show line numbers in content mode. Defaults to true.";
98
+ };
99
+ readonly '-o': {
100
+ readonly type: "boolean";
101
+ readonly description: "Print only matching non-empty parts of each line";
102
+ };
103
+ readonly '-A': {
104
+ readonly type: "integer";
105
+ readonly minimum: 0;
106
+ readonly description: "Show lines after each match";
107
+ };
108
+ readonly '-B': {
109
+ readonly type: "integer";
110
+ readonly minimum: 0;
111
+ readonly description: "Show lines before each match";
112
+ };
113
+ readonly '-C': {
114
+ readonly type: "integer";
115
+ readonly minimum: 0;
116
+ readonly description: "Show lines before and after each match";
117
+ };
118
+ readonly context: {
119
+ readonly type: "integer";
120
+ readonly minimum: 0;
121
+ readonly description: "Alias for -C";
122
+ };
123
+ readonly multiline: {
124
+ readonly type: "boolean";
125
+ readonly description: "Enable multiline matching where dot also matches newlines";
126
+ };
127
+ readonly head_limit: {
128
+ readonly type: "integer";
129
+ readonly minimum: 0;
130
+ readonly description: "Limit returned lines or entries. Defaults to 250; 0 means unlimited.";
131
+ };
132
+ readonly offset: {
133
+ readonly type: "integer";
134
+ readonly minimum: 0;
135
+ readonly description: "Skip the first N result lines or entries";
136
+ };
137
+ };
138
+ };
@@ -0,0 +1,81 @@
1
+ export const readInputSchema = {
2
+ type: 'object',
3
+ additionalProperties: false,
4
+ required: ['file_path'],
5
+ properties: {
6
+ file_path: {
7
+ type: 'string',
8
+ description: 'The absolute path to the file to read',
9
+ },
10
+ offset: {
11
+ type: 'integer',
12
+ minimum: 0,
13
+ description: 'The line number to start reading from. Only provide if the file is too large to read at once',
14
+ },
15
+ limit: {
16
+ type: 'integer',
17
+ minimum: 1,
18
+ description: 'The number of lines to read. Only provide if the file is too large to read at once.',
19
+ },
20
+ pages: {
21
+ type: 'string',
22
+ description: 'Page range for PDF files (e.g., "1-5", "3", "10-20"). Only applicable to PDF files. Maximum 20 pages per request.',
23
+ },
24
+ },
25
+ };
26
+ export const editInputSchema = {
27
+ type: 'object',
28
+ additionalProperties: false,
29
+ required: ['file_path', 'old_string', 'new_string'],
30
+ properties: {
31
+ file_path: {
32
+ type: 'string',
33
+ description: 'The absolute path to the file to modify',
34
+ },
35
+ old_string: { type: 'string', description: 'The text to replace' },
36
+ new_string: {
37
+ type: 'string',
38
+ description: 'The text to replace it with (must be different from old_string)',
39
+ },
40
+ replace_all: {
41
+ type: 'boolean',
42
+ default: false,
43
+ description: 'Replace all occurrences of old_string (default false)',
44
+ },
45
+ },
46
+ };
47
+ export const writeInputSchema = {
48
+ type: 'object',
49
+ additionalProperties: false,
50
+ required: ['file_path', 'content'],
51
+ properties: {
52
+ file_path: {
53
+ type: 'string',
54
+ description: 'The absolute path to the file to write (must be absolute, not relative)',
55
+ },
56
+ content: { type: 'string', description: 'The content to write to the file' },
57
+ },
58
+ };
59
+ export const grepInputSchema = {
60
+ type: 'object',
61
+ additionalProperties: false,
62
+ required: ['pattern'],
63
+ properties: {
64
+ pattern: { type: 'string', description: 'The regular expression pattern to search for in file contents' },
65
+ path: { type: 'string', description: 'File or directory to search. Defaults to the current working directory.' },
66
+ glob: { type: 'string', description: 'Glob pattern used to filter files, for example *.js or **/*.ts' },
67
+ type: { type: 'string', description: 'File type filter such as js, ts, py, rust, go, or java' },
68
+ output_mode: { type: 'string', enum: ['content', 'files_with_matches', 'count'], description: 'Output mode. Defaults to files_with_matches.' },
69
+ '-i': { type: 'boolean', description: 'Case-insensitive search' },
70
+ '-n': { type: 'boolean', description: 'Show line numbers in content mode. Defaults to true.' },
71
+ '-o': { type: 'boolean', description: 'Print only matching non-empty parts of each line' },
72
+ '-A': { type: 'integer', minimum: 0, description: 'Show lines after each match' },
73
+ '-B': { type: 'integer', minimum: 0, description: 'Show lines before each match' },
74
+ '-C': { type: 'integer', minimum: 0, description: 'Show lines before and after each match' },
75
+ context: { type: 'integer', minimum: 0, description: 'Alias for -C' },
76
+ multiline: { type: 'boolean', description: 'Enable multiline matching where dot also matches newlines' },
77
+ head_limit: { type: 'integer', minimum: 0, description: 'Limit returned lines or entries. Defaults to 250; 0 means unlimited.' },
78
+ offset: { type: 'integer', minimum: 0, description: 'Skip the first N result lines or entries' }
79
+ }
80
+ };
81
+ //# sourceMappingURL=schemas.js.map
@@ -0,0 +1 @@
1
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,EAAE,wCAAwC,EAAE;QAC5F,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,WAAW,EAAE,cAAc,EAAE;QACrE,SAAS,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,2DAA2D,EAAE;QACxG,UAAU,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,WAAW,EAAE,sEAAsE,EAAE;QAChI,MAAM,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,WAAW,EAAE,0CAA0C,EAAE;KACjG;CACO,CAAA"}
@@ -0,0 +1,159 @@
1
+ #!/usr/bin/env node
2
+ import { Server } from '@modelcontextprotocol/sdk/server/index.js';
3
+ export declare const toolDefinitions: readonly [{
4
+ readonly name: "Read";
5
+ readonly title: "Read a file from the local filesystem.";
6
+ readonly description: "Reads a file from the local filesystem. You can access any file directly by using this tool.\nAssume this tool is able to read all files on the machine. If the User provides a path to a file assume that path is valid. It is okay to read a file that does not exist; an error will be returned.\n\nUsage:\n- The file_path parameter must be an absolute path, not a relative path\n- By default, it reads up to 2000 lines starting from the beginning of the file. Files larger than 256KB will return an error; use offset and limit for larger files\n- When you already know which part of the file you need, only read that part. This can be important for larger files.\n- Results are returned using cat -n format, with line numbers starting at 1\n- This tool allows Claude Code to read images (eg PNG, JPG, etc). When reading an image file the contents are presented visually as Claude Code is a multimodal LLM.\n- This tool can read PDF files (.pdf). For large PDFs (more than 10 pages), you MUST provide the pages parameter to read specific page ranges (e.g., pages: \"1-5\"). Reading a large PDF without the pages parameter will fail. Maximum 20 pages per request.\n- This tool can read Jupyter notebooks (.ipynb files) and returns all cells with their outputs, combining code, text, and visualizations.\n- This tool can only read files, not directories. To read a directory, use an ls command via the Bash tool.\n- You will regularly be asked to read screenshots. If the user provides a path to a screenshot, ALWAYS use this tool to view the file at the path. This tool will work with all temporary file paths.\n- If you read a file that exists but has empty contents you will receive a system reminder warning in place of file contents.";
7
+ readonly inputSchema: {
8
+ readonly type: "object";
9
+ readonly additionalProperties: false;
10
+ readonly required: readonly ["file_path"];
11
+ readonly properties: {
12
+ readonly file_path: {
13
+ readonly type: "string";
14
+ readonly description: "The absolute path to the file to read";
15
+ };
16
+ readonly offset: {
17
+ readonly type: "integer";
18
+ readonly minimum: 0;
19
+ readonly description: "The line number to start reading from. Only provide if the file is too large to read at once";
20
+ };
21
+ readonly limit: {
22
+ readonly type: "integer";
23
+ readonly minimum: 1;
24
+ readonly description: "The number of lines to read. Only provide if the file is too large to read at once.";
25
+ };
26
+ readonly pages: {
27
+ readonly type: "string";
28
+ readonly description: "Page range for PDF files (e.g., \"1-5\", \"3\", \"10-20\"). Only applicable to PDF files. Maximum 20 pages per request.";
29
+ };
30
+ };
31
+ };
32
+ }, {
33
+ readonly name: "Edit";
34
+ readonly title: "Performs exact string replacements in files.";
35
+ readonly description: "Performs exact string replacements in files.\n\nUsage:\n- You must use your `Read` tool at least once in the conversation before editing. This tool will error if you attempt an edit without reading the file.\n- When editing text from Read tool output, ensure you preserve the exact indentation (tabs/spaces) as it appears AFTER the line number prefix. The line number prefix format is: line number + tab. Everything after that is the actual file content to match. Never include any part of the line number prefix in the old_string or new_string.\n- ALWAYS prefer editing existing files in the codebase. NEVER write new files unless explicitly required.\n- Only use emojis if the user explicitly requests it. Avoid adding emojis to files unless asked.\n- The edit will FAIL if `old_string` is not unique in the file. Either provide a larger string with more surrounding context to make it unique or use `replace_all` to change every instance of `old_string`.\n- Use `replace_all` for replacing and renaming strings across the file. This parameter is useful if you want to rename a variable for instance.";
36
+ readonly inputSchema: {
37
+ readonly type: "object";
38
+ readonly additionalProperties: false;
39
+ readonly required: readonly ["file_path", "old_string", "new_string"];
40
+ readonly properties: {
41
+ readonly file_path: {
42
+ readonly type: "string";
43
+ readonly description: "The absolute path to the file to modify";
44
+ };
45
+ readonly old_string: {
46
+ readonly type: "string";
47
+ readonly description: "The text to replace";
48
+ };
49
+ readonly new_string: {
50
+ readonly type: "string";
51
+ readonly description: "The text to replace it with (must be different from old_string)";
52
+ };
53
+ readonly replace_all: {
54
+ readonly type: "boolean";
55
+ readonly default: false;
56
+ readonly description: "Replace all occurrences of old_string (default false)";
57
+ };
58
+ };
59
+ };
60
+ }, {
61
+ readonly name: "Write";
62
+ readonly title: "Write a file to the local filesystem.";
63
+ readonly description: "Writes a file to the local filesystem.\n\nUsage:\n- This tool will overwrite the existing file if there is one at the provided path.\n- If this is an existing file, you MUST use the Read tool first to read the file's contents. This tool will fail if you did not read the file first.\n- Prefer the Edit tool for modifying existing files — it only sends the diff. Only use this tool to create new files or for complete rewrites.\n- NEVER create documentation files (*.md) or README files unless explicitly requested by the User.\n- Only use emojis if the user explicitly requests it. Avoid writing emojis to files unless asked.";
64
+ readonly inputSchema: {
65
+ readonly type: "object";
66
+ readonly additionalProperties: false;
67
+ readonly required: readonly ["file_path", "content"];
68
+ readonly properties: {
69
+ readonly file_path: {
70
+ readonly type: "string";
71
+ readonly description: "The absolute path to the file to write (must be absolute, not relative)";
72
+ };
73
+ readonly content: {
74
+ readonly type: "string";
75
+ readonly description: "The content to write to the file";
76
+ };
77
+ };
78
+ };
79
+ }, {
80
+ readonly name: "Grep";
81
+ readonly title: "A powerful search tool built on regular expressions.";
82
+ readonly description: "A powerful search tool for file contents.\n\nUsage:\n- ALWAYS use Grep for search tasks. NEVER invoke grep or rg as a Bash command.\n- Supports full regular expressions, file glob filters, file type filters, context lines, match-only output, multiline matching, pagination, file lists, and per-file counts.\n- Use output_mode=files_with_matches when you only need file paths; this is the default.\n- Use output_mode=content to see matching lines. Line numbers are included by default.\n- Use output_mode=count to see match counts per file.\n- Results are limited to 250 entries by default; use head_limit and offset for pagination.\n- Every file is decoded according to its nearest project .encoding-rules, so legacy encoded content is searched as Unicode transparently.";
83
+ readonly inputSchema: {
84
+ readonly type: "object";
85
+ readonly additionalProperties: false;
86
+ readonly required: readonly ["pattern"];
87
+ readonly properties: {
88
+ readonly pattern: {
89
+ readonly type: "string";
90
+ readonly description: "The regular expression pattern to search for in file contents";
91
+ };
92
+ readonly path: {
93
+ readonly type: "string";
94
+ readonly description: "File or directory to search. Defaults to the current working directory.";
95
+ };
96
+ readonly glob: {
97
+ readonly type: "string";
98
+ readonly description: "Glob pattern used to filter files, for example *.js or **/*.ts";
99
+ };
100
+ readonly type: {
101
+ readonly type: "string";
102
+ readonly description: "File type filter such as js, ts, py, rust, go, or java";
103
+ };
104
+ readonly output_mode: {
105
+ readonly type: "string";
106
+ readonly enum: readonly ["content", "files_with_matches", "count"];
107
+ readonly description: "Output mode. Defaults to files_with_matches.";
108
+ };
109
+ readonly '-i': {
110
+ readonly type: "boolean";
111
+ readonly description: "Case-insensitive search";
112
+ };
113
+ readonly '-n': {
114
+ readonly type: "boolean";
115
+ readonly description: "Show line numbers in content mode. Defaults to true.";
116
+ };
117
+ readonly '-o': {
118
+ readonly type: "boolean";
119
+ readonly description: "Print only matching non-empty parts of each line";
120
+ };
121
+ readonly '-A': {
122
+ readonly type: "integer";
123
+ readonly minimum: 0;
124
+ readonly description: "Show lines after each match";
125
+ };
126
+ readonly '-B': {
127
+ readonly type: "integer";
128
+ readonly minimum: 0;
129
+ readonly description: "Show lines before each match";
130
+ };
131
+ readonly '-C': {
132
+ readonly type: "integer";
133
+ readonly minimum: 0;
134
+ readonly description: "Show lines before and after each match";
135
+ };
136
+ readonly context: {
137
+ readonly type: "integer";
138
+ readonly minimum: 0;
139
+ readonly description: "Alias for -C";
140
+ };
141
+ readonly multiline: {
142
+ readonly type: "boolean";
143
+ readonly description: "Enable multiline matching where dot also matches newlines";
144
+ };
145
+ readonly head_limit: {
146
+ readonly type: "integer";
147
+ readonly minimum: 0;
148
+ readonly description: "Limit returned lines or entries. Defaults to 250; 0 means unlimited.";
149
+ };
150
+ readonly offset: {
151
+ readonly type: "integer";
152
+ readonly minimum: 0;
153
+ readonly description: "Skip the first N result lines or entries";
154
+ };
155
+ };
156
+ };
157
+ }];
158
+ export declare function createServer(): Server;
159
+ export declare function main(): Promise<void>;
@@ -0,0 +1,98 @@
1
+ #!/usr/bin/env node
2
+ import { fileURLToPath } from 'node:url';
3
+ import { Server } from '@modelcontextprotocol/sdk/server/index.js';
4
+ import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
5
+ import { CallToolRequestSchema, ListToolsRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
6
+ import { EDIT_DESCRIPTION, EDIT_PROMPT, GREP_DESCRIPTION, GREP_PROMPT, READ_DESCRIPTION, READ_PROMPT, WRITE_DESCRIPTION, WRITE_PROMPT, } from './prompts.js';
7
+ import { editInputSchema, grepInputSchema, readInputSchema, writeInputSchema, } from './schemas.js';
8
+ import { executeEdit, parseEditInput } from './tools/edit.js';
9
+ import { executeGrep, parseGrepInput } from './tools/grep.js';
10
+ import { executeRead, parseReadInput } from './tools/read.js';
11
+ import { executeWrite, parseWriteInput } from './tools/write.js';
12
+ export const toolDefinitions = [
13
+ {
14
+ name: 'Read',
15
+ title: READ_DESCRIPTION,
16
+ description: READ_PROMPT,
17
+ inputSchema: readInputSchema,
18
+ },
19
+ {
20
+ name: 'Edit',
21
+ title: EDIT_DESCRIPTION,
22
+ description: EDIT_PROMPT,
23
+ inputSchema: editInputSchema,
24
+ },
25
+ {
26
+ name: 'Write',
27
+ title: WRITE_DESCRIPTION,
28
+ description: WRITE_PROMPT,
29
+ inputSchema: writeInputSchema,
30
+ }, {
31
+ name: 'Grep',
32
+ title: GREP_DESCRIPTION,
33
+ description: GREP_PROMPT,
34
+ inputSchema: grepInputSchema,
35
+ },
36
+ ];
37
+ async function dispatch(name, input) {
38
+ switch (name) {
39
+ case 'Read':
40
+ return executeRead(parseReadInput(input));
41
+ case 'Edit':
42
+ return executeEdit(parseEditInput(input));
43
+ case 'Write':
44
+ return executeWrite(parseWriteInput(input));
45
+ case 'Grep':
46
+ return executeGrep(parseGrepInput(input));
47
+ default:
48
+ throw new Error(`Unknown tool: ${name}`);
49
+ }
50
+ }
51
+ function toCallToolResult(response) {
52
+ return {
53
+ content: response.content,
54
+ ...(response.isError === undefined ? {} : { isError: response.isError }),
55
+ ...(response.structuredContent === undefined ? {} : { structuredContent: response.structuredContent }),
56
+ };
57
+ }
58
+ export function createServer() {
59
+ const server = new Server({ name: 'codepage-bridge', version: '0.1.0' }, { capabilities: { tools: {} } });
60
+ server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: [...toolDefinitions] }));
61
+ server.setRequestHandler(CallToolRequestSchema, async (request) => {
62
+ try {
63
+ return toCallToolResult(await dispatch(request.params.name, request.params.arguments ?? {}));
64
+ }
65
+ catch (error) {
66
+ const message = error instanceof Error ? error.message : String(error);
67
+ return {
68
+ isError: true,
69
+ content: [{ type: 'text', text: `<tool_use_error>${message}</tool_use_error>` }],
70
+ };
71
+ }
72
+ });
73
+ return server;
74
+ }
75
+ export async function main() {
76
+ const server = createServer();
77
+ const transport = new StdioServerTransport();
78
+ let closing = false;
79
+ const close = async () => {
80
+ if (closing)
81
+ return;
82
+ closing = true;
83
+ await server.close();
84
+ };
85
+ process.stdin.on('end', () => void close());
86
+ process.stdin.on('error', error => {
87
+ console.error(error);
88
+ void close();
89
+ });
90
+ await server.connect(transport);
91
+ }
92
+ if (process.argv[1] && fileURLToPath(import.meta.url) === process.argv[1]) {
93
+ main().catch(error => {
94
+ console.error(error);
95
+ process.exitCode = 1;
96
+ });
97
+ }
98
+ //# sourceMappingURL=server.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/server.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAExC,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAA;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAA;AAChF,OAAO,EACL,qBAAqB,EACrB,sBAAsB,GAEvB,MAAM,oCAAoC,CAAA;AAE3C,OAAO,EACL,gBAAgB,EAChB,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;QACpB,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAA;IACtB,CAAC,CAAC,CAAA;AACJ,CAAC"}
@@ -0,0 +1,31 @@
1
+ export interface ReadInput {
2
+ file_path: string;
3
+ offset?: number;
4
+ limit?: number;
5
+ pages?: string;
6
+ }
7
+ export interface EditInput {
8
+ file_path: string;
9
+ old_string: string;
10
+ new_string: string;
11
+ replace_all?: boolean;
12
+ }
13
+ export interface WriteInput {
14
+ file_path: string;
15
+ content: string;
16
+ }
17
+ export interface TextContent {
18
+ type: 'text';
19
+ text: string;
20
+ }
21
+ export interface ImageContent {
22
+ type: 'image';
23
+ data: string;
24
+ mimeType: string;
25
+ }
26
+ export type ToolContent = TextContent | ImageContent;
27
+ export interface ToolResponse {
28
+ content: ToolContent[];
29
+ isError?: boolean;
30
+ structuredContent?: Record<string, unknown>;
31
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=toolTypes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toolTypes.js","sourceRoot":"","sources":["../../src/toolTypes.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ import type { EditInput, ToolResponse } from '../toolTypes.js';
2
+ export declare function parseEditInput(value: unknown): EditInput;
3
+ export declare function executeEdit(input: EditInput): Promise<ToolResponse>;