Codepage Bridge MCP
This server provides encoding-transparent file operations for legacy codebases, automatically converting between on-disk legacy encodings (GBK, Big5, Shift-JIS, Windows codepages, UTF-16, etc.) and Unicode for the LLM, based on project-level .encoding-rules files.
Read: Read files from the local filesystem with automatic encoding conversion. Supports text files, images (PNG, JPG, GIF, WebP), PDFs (with page range selection), and Jupyter Notebooks. Supports
offsetandlimitfor partial reads of large files.Grep: Regex-based search across files/directories with legacy encoding transparency. Supports glob/type filters, case-insensitive and multiline matching, context lines, multiple output modes (
content,files_with_matches,count), line numbers, and pagination.Edit: Exact string replacements with read-before-write protection, stale-write detection, and preservation of original encoding, BOM, and line endings. Supports
replace_allfor global replacements.Write: Create new files or fully rewrite existing ones using the encoding defined by
.encoding-rules. Requires a prior read for existing files to prevent unintended overwrites. Fails safely if content cannot be represented in the target encoding, preventing silent data corruption.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Codepage Bridge MCPSearch for 'deprecated' in all .cpp files"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Codepage Bridge MCP
Encoding-transparent file tools for Claude Code and other MCP clients.
Codepage Bridge exposes Read, Grep, Edit, and Write over MCP while transparently converting project files between their on-disk legacy encoding and Unicode text for the LLM. The model sees normal Unicode text; files are written back in the encoding selected by the nearest .encoding-rules.
It is designed for legacy codebases that still use GBK/GB2312/GB18030, Big5, Shift-JIS, EUC-KR, Windows codepages, UTF-16, and other non-UTF-8 encodings.
Recommended install
This is now the single recommended installation path for end users.
Windows
# Remove an older install with the same name first, if one exists.
claude mcp remove codepage-bridge -s user
# Register the npm package once, at user scope. `cmd` is required on Windows.
claude mcp add --scope user codepage-bridge -- cmd /d /s /c "npx -y codepage-bridge-mcp"
claude mcp get codepage-bridgemacOS / Linux
# Remove an older install with the same name first, if one exists.
claude mcp remove codepage-bridge -s user
# Register the npm package once, at user scope.
claude mcp add --scope user codepage-bridge -- npx -y codepage-bridge-mcp
claude mcp get codepage-bridgeWhat this requires locally:
claudenode
What it does not require:
git clonenpm installnpm run builddownloading a GitHub Release package first
Avoid duplicate MCP registrations
Register codepage-bridge in only one scope. Claude Code treats the same server name with different commands as a configuration conflict—for example, an older user-scoped local build and this repository's project-scoped .mcp.json npm command.
Run claude mcp list to diagnose duplicates. Keep the endpoint you want, then remove the other registration:
# Keep the npm command from the user-scoped installation.
claude mcp remove codepage-bridge -s project
# Or keep a project-local configuration and remove a previous user installation.
claude mcp remove codepage-bridge -s userAfter removing a registration, run claude mcp get codepage-bridge again. It must report one endpoint with status Connected.
Large text files
Read and Grep allow individual text files up to 32 MiB by default. To use a different limit, set CODEPAGE_BRIDGE_MAX_TEXT_FILE_MIB to a positive integer before starting Claude Code:
setx CODEPAGE_BRIDGE_MAX_TEXT_FILE_MIB 64Restart Claude Code after changing the variable. Larger files require proportionally more Node.js memory while decoding, splitting lines, and matching regular expressions.
Related MCP server: vulcan-file-ops
Why
Claude Code built-in file tools assume UTF-8 for normal text reads. In legacy projects this can lead to:
unreadable C/C++ comments and string literals;
searches that silently miss text;
edits that corrupt the original codepage;
accidental UTF-8 rewrites of GBK or other legacy files.
Codepage Bridge keeps encoding conversion below the model boundary:
legacy bytes on disk -> decode by .encoding-rules -> Unicode for the LLM
Unicode from the LLM -> strict encode by .encoding-rules -> legacy bytes on diskIf new text cannot be represented in the target encoding, the write fails instead of silently replacing characters with ?.
Required Claude Code configuration
Installing the MCP is not sufficient by itself.
Claude Code may still choose its built-in:
ReadGrepEditWriteNotebookEdit
Those tools bypass .encoding-rules.
Step 1 — merge settings.fragment.json
Merge this into your existing ~/.claude/settings.json:
{
"permissions": {
"allow": [
"mcp__codepage-bridge__Read",
"mcp__codepage-bridge__Grep",
"mcp__codepage-bridge__Edit",
"mcp__codepage-bridge__Write"
],
"deny": [
"Read",
"Grep",
"Edit",
"Write",
"NotebookEdit"
]
}
}Template file:
examples/claude-config/settings.fragment.json
Do not replace your whole settings file unless it is empty. Merge these arrays into your existing configuration.
Step 2 — add a CLAUDE.md policy
Add this to the project CLAUDE.md, or to ~/.claude/CLAUDE.md for a global policy:
## File encoding policy
Use Codepage Bridge for all project file content operations:
- Read with `mcp__codepage-bridge__Read`.
- Search with `mcp__codepage-bridge__Grep`.
- Edit with `mcp__codepage-bridge__Edit`.
- Create or completely rewrite with `mcp__codepage-bridge__Write`.
Do not use built-in Read, Grep, Edit, Write, NotebookEdit, shell commands,
PowerShell commands, or scripts as substitutes for project file content access.
Glob may only be used to discover paths.
Do not manually transcode files or normalize line endings. `.encoding-rules`
is the source of truth.Template file:
examples/minimal-project/CLAUDE.md
Step 3 — add .encoding-rules
.encoding-rules is optional. When it is absent, Codepage Bridge treats the target file's directory as the allowed root and reads/writes using strict UTF-8. Add a rules file whenever the project contains legacy-encoded files or needs a shared project root.
Example:
# Last matching rule wins
*.c gbk
*.cpp gbk
*.h gbk
legacy/**/*.txt windows-1251
assets/**/*.csv shift_jis
**/*.json utf8
# Cancel earlier matches and return to strict UTF-8
!SourceCode/generated/**Template file:
examples/minimal-project/.encoding-rules
Rules:
Empty lines and lines beginning with
#are ignored.*,**, and?use glob semantics.Patterns without
/, such as*.cpp, match basenames at every directory depth.Patterns containing
/are relative to the.encoding-rulesdirectory.The last matching rule wins.
!patterncancels previous matches and selects strict UTF-8.Files with no matching rule use strict UTF-8.
The nearest
.encoding-rulesis used; its directory is the allowed project root.
Verify the setup
1. Check the MCP is connected
claude mcp get codepage-bridgeExpected:
name:
codepage-bridgestatus:
Connected
2. Start a fresh Claude Code session in a legacy project
3. Ask Claude to read or search a legacy-encoded file
Examples:
Read SourceCode/Main.cpp and show the first 10 lines.Search SourceCode for the string 错误码.4. Confirm the model uses Codepage Bridge tools
In a verbose / print-mode session, the tool call should be one of:
mcp__codepage-bridge__Readmcp__codepage-bridge__Grepmcp__codepage-bridge__Editmcp__codepage-bridge__Write
It should not call built-in Read, Grep, Edit, or Write.
Features
Encoding-aware
Read,Grep,Edit, andWritetools.Project-level
.encoding-ruleswith gitignore-like glob behavior.The nearest
.encoding-rulesdefines both the project root and active rules.Last matching rule wins;
!patternresets matching files to strict UTF-8.Basename patterns such as
*.cppmatch at every directory depth.Strict UTF-8 fallback for files not matched by a rule.
GBK/GB2312/GB18030, Big5, Shift-JIS, EUC-KR, Windows codepages, UTF-8, and UTF-16 support.
BOM and dominant line-ending preservation for edits.
Read-before-write protection and stale-write detection using byte hashes.
Atomic temporary-file writes and per-path write locks.
Symlink and project-root boundary checks.
Image, PDF, and Jupyter Notebook reading.
Grep output modes, context lines, glob/type filters, regex flags, and pagination.
Large-file partial edit authorization: the model only needs to read the target lines it wants to edit, not the entire file.
Development
npm install
npm run check
npm test
npm run build
npm startLicense
MIT. See LICENSE.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- FlicenseBqualityDmaintenanceMulti-mode MCP server supporting both Claude Desktop (STDIO) and OpenAI (HTTP/SSE) integrations with file operations including read, write, delete, and search capabilities.3
- AlicenseAqualityCmaintenanceMCP server that gives Claude Desktop and other desktop MCP clients filesystem powers—read, write, edit, and manage files like AI coding assistants.17879MIT
- AlicenseAqualityAmaintenanceMCP server for file operations with non-UTF-8/Unicode encoding: Cyrillic, CP1251, CP1252, ISO-8859, KOI8 auto-detection82021GPL 3.0

ellmos-clatcher-mcpofficial
AlicenseBqualityAmaintenanceUtility-first MCP server that extends Claude Code with file-maintenance capabilities beyond built-in tools. Supports encoding repair, format conversion, duplicate detection, batch renaming, and archive utilities.125111MIT
Related MCP Connectors
Augments MCP Server - A comprehensive framework documentation provider for Claude Code
OCR, transcription, file extraction, and image generation for AI agents via MCP.
Read and write your Fresh Jots notes from Claude, Cursor, and any MCP client.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/skyispainted/codepage-bridge-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server