Content
# PR MCP Builder
## Public Institution Regulation MCP Builder
[](#windows-execution)
[](pyproject.toml)
[](#connecting-ai-program-with-mcp)
[](https://github.com/chrisryugj/kordoc)
[](#processing-structure)
[](LICENSE)
PDF, HWP, HWPX, DOCX format public institution regulations are organized into a structure of **institution → regulation → revised version → chapter, section, article**, and only approved content is included in the search index and MCP response for Windows.
Unlike simple sentence similarity search, it narrows down the regulation name and table of contents, finds the article of the latest effective revised version, and tracks previous revision history if necessary.
## 20-Second Usage Flow
<p align="center">
<img src="docs/assets/pr-mcp-builder-demo.gif" alt="PR MCP Builder demo usage flow from institution selection to MCP connection" width="960" />
</p>
<p align="center"><a href="docs/assets/pr-mcp-builder-demo.gif">View GIF in a new window</a></p>
> [!IMPORTANT]
> This is a publicly available, open-source development version. The Streamlit screen is for local operators, and actual institution deployment requires verification of document format, revision history, output range, and security policies.
## Easiest Execution
### Windows Execution
If using the distribution ZIP, follow these three steps:
1. Unzip `PR-MCP-Builder-Windows-x64-<version>.zip` to a regular folder.
2. Double-click **`PR MCP Builder.exe`** in the folder.
3. Use the local screen that automatically opens in the browser.
Working data is stored in `%LOCALAPPDATA%\PR MCP Builder\data` by default. If port `8501` is in use, the launcher automatically selects the next available port.
### Source Code Execution
After installing Python 3.11 or later, double-click **`START_HERE.bat`** in the project folder. Internet connection is required for virtual environment and package installation during the first execution. The default address is `http://127.0.0.1:8501`.
To start the same execution from the terminal, use the following command:
```powershell
.\.venv\Scripts\python.exe -m streamlit run frontend\streamlit_app.py --server.address 127.0.0.1
```
Source code execution stores working data in `data\` in the project folder. Windows execution uses `%LOCALAPPDATA%\PR MCP Builder\data` as mentioned above.
To check execution conditions only, use the following command:
```powershell
.\START_HERE.bat --check
```
## Processing Structure
```text
Institution selection
→ Regulation file upload
→ Regulation name, revision date, effective date, and revision history recognition
→ Regulation/version/toc/article hierarchical indexing
→ AI proposal review + human original text comparison
→ Approved latest effective version only for search and MCP reflection
→ Codex·Claude local connection or ChatGPT·Claude HTTPS connection
```
- Separate working spaces, waiting files, project storage, approved data, and MCP output by institution.
- Distinguish regulation ID and version ID within the same institution to preserve past revised versions.
- Unapproved chunks are not included in the search index and MCP response.
- Reconstructs the same hierarchical structure when re-uploading all regulations under the same institution name, regulation name, and revision history.
- MCP server name is not fixed; users must input it during the creation screen, and the screen example does not automatically apply.
- Storage location is not fixed; users choose the folder and reflect the absolute path in client settings.
## Screen Usage Sequence
Follow the screens below from institution selection to MCP connection.
### 1. Institution Selection
The first screen only requires the institution name or selecting a registered institution. This stage does not display saved projects, API keys, regulation files, or MCP settings.

After selecting an institution, the document, approval record, search range, and MCP output are limited to the selected institution.

### 2. Regulation Upload and Preprocessing
Select `① Upload document for preprocessing` to choose PDF, HWP, HWPX, or DOCX files. Multiple files can be uploaded at once and sorted by regulation series and revised version.

Automatic recognition prioritizes the `establishment`, `revision`, `total revision`, effective date, and revision history in the document's beginning to determine the regulation name and version.
### Optional: External AI Review
AI review is an optional feature and is disabled by default. When disabled, no external content is sent, and only local parsers and human review are used.
Supported providers include:
| Provider | Input Items | Model Selection |
| --- | --- | --- |
| OpenAI | API key, API address | `gpt-4.1-mini` recommended, other models or custom input |
| Azure OpenAI | Resource endpoint, API key | Enter Azure deployment name |
| Anthropic Claude | API key, API address | Claude model list or custom input |
| OpenAI compatible API | In-house/local API address, optional key | Ollama·in-house gateway model ID direct input |
### 3. Result Confirmation
Confirm the number of structure nodes, chunks, issues, quality scores, and recognized regulation/version information.
### 4. AI and Human Review
Review can be done by chunk or by entire button.
### 5. MCP Range and Connection Target Selection
Select the data range in `④ MCP generation · AI connection`.
### 6. MCP File Bundle Generation
Enter `MCP name to generate` and confirm the save folder.
## Bulk Regulation Progress Display
For integrated documents with 800 pages or 140+ regulations, progress is displayed during tasks.
## Local Connection
Non-developers do not need to directly edit PowerShell scripts or JSON settings.
1. Completely exit the AI app you want to connect.
2. Double-click the batch file of the app to use in the MCP creation folder.
3. Double-click `Check Connection Status.bat` to verify there are no errors.
4. Relaunch the AI app and open a new conversation.
5. In the new conversation or task, call `Show the registered regulation list using the entered MCP.`
| Target | File to Run | Settings Processed by Program |
| --- | --- | --- |
| ChatGPT Desktop (Codex integrated) | `Connect to ChatGPT Desktop.bat` | Backup `%USERPROFILE%\.codex\config.toml` and register plugin MCP's name, command, arguments, and working folder |
| Codex CLI compatible | `Connect to Codex.bat` | Register current MCP server name and actual folder path in user's Codex settings |
| Claude Desktop | `Connect to Claude Desktop.bat` | Backup `%APPDATA%\Claude\claude_desktop_config.json` and then merge |
| Claude Code | `Connect to Claude Code.bat` | Execute local stdio registration in the format of `claude mcp add ...` |
Each app uses the same authorization data but has different settings and registration methods, so the connection buttons are also separate. For integrated ChatGPT Desktop, after completely exiting the app, running the BAT file and restarting will display the entered name and actual execution path in `Settings → Plugins → MCP`. Users do not need to directly input execution commands or arguments.
If you recreate with the same MCP name and run the BAT file, it will not add duplicate entries but replace them with new paths and settings. When creating, it rebundles the currently authorized entire chunk, so additional regulations and revised chunks are also queried with the same MCP name. If you moved the folder, run the connection BAT file again in the new folder.
The `View MCP Usage After Installation.bat` in the creation folder shows client-specific verification commands and the first call sentence with the actual MCP name. Only when automatic registration fails, manually input the values from `Codex Plugin MCP Input.txt` into the integrated ChatGPT Desktop plugin screen.
The meanings of created files, manual inspection commands, and troubleshooting procedures are documented in [MCP Quick Connection Guide](docs/mcp_quickconnect.md).
## ChatGPT Web Connection
The integrated ChatGPT Desktop local plugin connection is different from the ChatGPT web app connection. Custom MCP apps on ChatGPT web require a remote MCP endpoint accessible from the internet. Since `localhost` or local stdio cannot be directly connected to ChatGPT web, use HTTPS deployment or an approved secure tunnel.
In the creation screen's connection method notation, `MCP HTTP - Connect via URL` uses the HTTPS address prepared by the operator, and `OpenAI Secure MCP Tunnel` refers to the secure tunnel flow using the generated `run_openai_secure_tunnel.ps1`.
1. Select `ChatGPT HTTPS` or `ChatGPT Secure Tunnel` on the creation screen.
2. For HTTPS method, enter the public basic address. The screen will display the final `/mcp` address.
3. Deploy the MCP bundle on an authorized server and configure TLS and authentication.
4. Open `Settings` or workspace settings in ChatGPT, then go to `Apps` → `Create`.
5. Enter the generated HTTPS MCP URL and create the app after `Scan tools`.
6. In a new conversation, select the app with the entered MCP name or specify it with `@MCPName`, then call `Show the registered regulation list from MCPName.`

Depending on the plan and workspace administrator policy, developer mode or custom app menus may not be visible. For the latest conditions, refer to OpenAI's official documentation on [Developer mode and custom MCP apps](https://help.openai.com/en/articles/12584461-developer-mode-apps-and-full-mcp-connectors-in-chatgpt-beta) and [Apps in ChatGPT](https://help.openai.com/en/articles/11487775-connectors-in-chatgpt).
## Claude Connection
Claude Desktop and Claude Code on the same PC use the local stdio method, which is the simplest. Just run the batch file from the table above.
For use on Claude web or in a remote environment:
1. Select `Claude HTTPS` on the creation screen and enter the public HTTPS basic address.
2. Deploy the generated MCP bundle on an authorized server.
3. In Claude's `Settings` → `Connectors`, add a custom connector.
4. Register the final `/mcp` URL and necessary authentication information.

Local Claude Desktop settings and remote connector settings are different. Do not put the remote MCP URL into the local stdio section like `claude_desktop_config.json`. For details, refer to Anthropic's official documentation on [Local Claude Desktop MCP](https://support.anthropic.com/en/articles/10949351-getting-started-with-local-mcp-servers-on-claude-desktop) and [Remote custom connectors](https://support.anthropic.com/en/articles/11503834-building-custom-connectors-via-remote-mcp-servers).
## HTTPS Deployment Boundary
The scope of what PR MCP Builder automatically creates includes authorization data, hierarchical search DB, MCP server executable, client settings, and connection scripts. The following items need to be prepared by the organization's IT department according to their operational environment:
- Public or organization-approved domain and DNS
- TLS certificate and HTTPS reverse proxy
- OAuth, mTLS, or bearer token authentication
- Server firewall, audit logs, backups, and secret information management
- Connector approval in ChatGPT/Claude workspace
When using a remote MCP, the authorization regulation content returned by MCP can be transmitted to external AI services. Use it only for publicly available materials or those with separate export approval, and prioritize local stdio or approved internal network MCP for confidential regulations.
## Revision Update Method
For example, if you put `personnel_regulations1.hwp`, `personnel_regulations2.hwp`, and `personnel_regulations3.hwp` from the same organization, they are organized based on the following criteria:
1. Find the regulation name and establishment, revision, and full revision history in the text.
2. Bundle the same organization and normalized regulation name into one regulation series.
3. Distinguish versions by revision date, effective date, and content hash.
4. Use the latest approved version as the currently effective version and preserve previous approved versions as revision history.
5. When querying, narrow down the search from organization → regulation → table of contents/article → latest effective version.
Documents with missing text history or conflicting dates are marked as review items and not automatically confirmed. File names are auxiliary clues and not the sole criterion for final revision judgment.
## Support Scope and Limitations
| Item | Current Scope |
| --- | --- |
| Operating System | Windows 10/11 64-bit priority support |
| Input | PDF, HWP, HWPX, DOCX |
| Structure | Organization → Regulation → Revision Version → Table of Contents/Article → Approved Chunk |
| Local UI | Streamlit, default `127.0.0.1` binding |
| Search | Hierarchical exploration + latest valid version filter + BM25/vector candidate search |
| HWP Table | Basic extraction, then optional reinforcement with Kordoc CLI, requires human verification |
| Scanned PDF | OCR backend and Korean language support require separate configuration |
| External Connection | Approved HTTPS deployment or secure tunnel required |
### Optional Kordoc Reinforcement
To reinforce HWP table extraction, you can separately install the [Kordoc project](https://github.com/chrisryugj/kordoc). PR MCP Builder compares the cell and column structure extracted by Kordoc with the basic parser results and connects tables with sufficient matching degree to the verification candidate.
- Role in this project: Reinforcement focusing on HWP table cell, column position, and merge structure
- Integration method: Calling the separately installed Kordoc CLI by the user as a subprocess
- Distribution scope: PR MCP Builder source and Windows ZIP do not include Kordoc source/executable files
- Verification principle: Leave verification marks on Kordoc table matching, promotion, and mismatch results, and compare with original text before approval
The basic distribution principle is that Kordoc source or executable files are not included.
Kordoc is a separate MIT project disclosed by Chris. Before use, confirm [Kordoc License](https://github.com/chrisryugj/kordoc/blob/main/LICENSE) and this repository's [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md).
## Security Principles
- Do not consider preprocessing itself as a security control.
- Inspection, classification, human approval, audit logs, and blocked index of unapproved chunks are the actual controls.
- Do not commit original regulations, runtime outputs, API keys, tokens, and user local paths to public repositories.
- Apply authentication, tenant isolation by organization, access control, and organizational security policies separately in shared distribution.
- Before public distribution, confirm [SECURITY.md](SECURITY.md) and [Public Repository History Policy](docs/public_repository_history_policy.md).
## Developer Verification and Build
```powershell
python -m unittest discover -s tests -v
python -m build --sdist --wheel
python scripts\audit_release_hygiene.py --workflow-scope available --include-untracked --include-source-path-scan
```
Windows portable ZIP is created with the following command:
```powershell
powershell -ExecutionPolicy Bypass -File scripts\build_windows_portable.ps1 -Version 0.1.0
```
The resulting file is `dist\PR-MCP-Builder-Windows-x64-0.1.0.zip`. Do not commit `data/`, `reports/`, `.tmp/`, `build/`, `dist/`, virtual environments, and actual organization documents to Git.
Refer to [docs](docs/) for detailed design and operational documents. The source code follows the [MIT License](LICENSE), and conditions for external components are listed in [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md).
Connection Info
You Might Also Like
No recommendations available