python-mcp-as400 MCP server
2026년 10월 24일 커밋AI 어시스턴트를 IBM i (AS/400) 시스템에 연결하여 Db2 쿼리, 소스 코드 읽기, 프로그램 컴파일 및 스풀 파일 분석을 안전하게 수행합니다.
다른 이름 LorenteFacundo/python-mcp-as400
- 스타
- 2
- Tools
- 5
- 다운로드, 30일
- —
- 최신 버전
- —
- 마지막 커밋
- 2026년 10월 24일
- 라이선스
- MIT
python-mcp-as400 MCP란?
python-mcp-as400은(는) MCP server입니다. AI 어시스턴트를 IBM i (AS/400) 시스템에 연결하여 Db2 쿼리, 소스 코드 읽기, 프로그램 컴파일 및 스풀 파일 분석을 안전하게 수행합니다. 5개 도구를 제공합니다. 예: execute_sql, execute_cl_command, read_source_member.
프로젝트 README에서 생성된 요약
python-mcp-as400 MCP server 정보
이 MCP server는 안전한 분석과 개발을 위해 AI 어시스턴트를 IBM i 시스템에 연결합니다. 개발자는 Claude 또는 Cursor와 같은 클라이언트를 사용하여 Db2 for i와 상호작용하고, RPG, COBOL 또는 CL 소스 코드를 읽으며, 컴파일 작업을 관리할 수 있습니다. 대규모 언어 모델과 레거시 비즈니스 로직 사이의 간극을 메워줌으로써, 팀이 수천 개의 테이블에 걸친 영향 분석을 수동 점검보다 훨씬 빠르게 수행할 수 있도록 지원합니다.
서버는 stdio를 통해 로컬에서 작동하며 Python 3.10 이상, IBM i Access ODBC Driver, 그리고 환경 변수로 제공되는 유효한 데이터베이스 자격 증명이 필요합니다. 데이터 파괴보다 분석을 우선시하는 엄격한 보안 모델로 설계되었습니다. 검증 레이어를 사용하여 SQL 쿼리가 읽기 전용으로 유지되도록 보장하며, CL 명령은 특정 허용 목록으로 제한하여 실수로 인한 데이터 수정이나 객체 삭제를 방지합니다.
개발자는 시스템 테이블 쿼리를 위한 execute_sql, 코드 검사를 위한 read_source_member, RPG 또는 C 프로그램 빌드를 위한 compile_program과 같은 특정 도구를 사용할 수 있습니다. 또한 작업 로그와 컴파일 목록을 검토할 수 있는 read_spoolfile 기능도 포함되어 있어, 복잡한 IBM i 환경을 유지 관리하고 이해하는 데 종합적인 도구 역할을 합니다.
활용 사례
- 1레거시 소스 코드 검사AI에게 특정 RPG 또는 COBOL 멤버 내의 로직을 설명하도록 요청할 수 있습니다.
- 2컴파일 오류 디버깅어시스턴트가 프로그램을 컴파일한 후 생성된 스풀 파일을 읽어 실패 원인을 진단할 수 있습니다.
- 3시스템 메타데이터 쿼리개발자는 읽기 전용 SQL 명령을 사용하여 특정 컬럼이나 테이블 구조를 찾을 수 있습니다.
프로젝트의 README를 바탕으로 작성되었습니다. 모든 활용 사례는 해당 내용의 인용문과 대조하여 확인합니다.
python-mcp-as400 MCP 도구 5
README에서 감지됨execute_sqlexecute_cl_commandread_source_membercompile_programread_spoolfile
| execute_sql | — | |
| execute_cl_command | — | |
| read_source_member | — | |
| compile_program | — | |
| read_spoolfile | — |
구성
DB_HOSTDB_PASSDB_USER
| 이름 | 설명 | 유형 |
|---|---|---|
| DB_HOST | — | |
| DB_PASS | — | |
| DB_USER | — |
자동 검사
2026년 11월 14일에 실행됨전체 보고서 →아직 인증되지 않았습니다. 서버는 80점 이상의 점수, 심각한 결함 없음, 그리고 검사에 충분한 데이터를 갖추어야 합니다. 검사 방식
- 소스 저장소 연결 및 접근 가능lorentefacundo/python-mcp-as400 is public and reachablegithub.com/lorentefacundo/python-mcp-as400 ↗통과
- 패키지가 이 저장소를 소스로 지정검사되지 않음
- 빌드 출처(Sigstore 증명)검사되지 않음
- 오픈 소스 라이선스 (OSI)MITspdx.org/licenses/MIT.html ↗통과
- 최근 1년 내 커밋 또는 릴리스Last commit or release 2026-10-24github.com/lorentefacundo/python-mcp-as400 ↗통과
- OpenSSF Scorecard검사되지 않음
- 패키지 이름이 인기 패키지와 유사하지 않음검사되지 않음
- 패키지와 의존성에 심각한 보안 권고 없음검사되지 않음
- 모델에 대한 숨겨진 지침 없음5 tool descriptions and the README read; no override phrases, credential paths or hidden characters통과
- 파괴적인 도구에 라벨 표시됨검사되지 않음
- 원격 endpoint가 MCP 핸드셰이크에 응답검사되지 않음
README
GitHub에서 보기AS/400 MCP Server
English · Español
An MCP server that lets AI assistants (Claude, Cursor, any MCP client) work with IBM i (AS/400) systems: query Db2 for i, read RPG/COBOL/CL source, compile programs and read spooled files. Every input goes through strict validation, so the assistant can analyze everything without being able to break anything.
Why I built it
A lot of critical business logic still runs on IBM i, and the people who know it are few and busy. Understanding the impact of a change means reading thousands of tables and programs by hand. I wanted an AI assistant to do that reading for me, but connecting an LLM to a production system is only acceptable if it cannot change data or objects. This server is that bridge.
Results
I presented it at BDT Global, where it was approved as a billable initiative and piloted with a client:
| Manual | With the MCP server | |
|---|---|---|
| Task estimated by a senior developer | 5 days | 3 hours (13x) |
| Impact analysis across 6,000+ tables | 6 hours | 20 minutes (18x), and it found 2 tables missed by hand |
Tools
| Tool | What it does | Example |
|---|---|---|
execute_sql |
Read-only SQL (SELECT, WITH, VALUES) |
SELECT * FROM QSYS2.SYSTABLES FETCH FIRST 5 ROWS ONLY |
execute_cl_command |
Allow-listed CL commands | DSPFD FILE(MYLIB/MYFILE) OUTPUT(*OUTFILE) OUTFILE(QTEMP/FDA) |
read_source_member |
Reads a source member | biblioteca='MYLIB', archivo_fuente='QRPGLESRC', miembro='MYPGM' |
compile_program |
Compiles RPG, CL, COBOL or C | library='DEVLIB', source_file='QRPGLESRC', member='MYPGM' |
read_spoolfile |
Lists or reads spooled files (compile listings, job logs) | program_name='MYPGM' |
Security model
The philosophy: analysis and compilation yes, destruction never. Validation lives in validation.py, has no dependencies, and is covered by 72 tests that run in CI on every push.
Read-only SQL
- Only
SELECT,WITHandVALUES; no;, so no statement stacking. - Blocks data-change table references hidden inside a
SELECT(SELECT * FROM FINAL TABLE (DELETE ...)). - Blocks Db2 for i functions with side effects:
QCMDEXC(runs any CL command),HTTP_*/HTTP*CLOB(data exfiltration),IFS_WRITE*,END_JOBand others. - Ignores string literals and quoted identifiers when checking keywords, so
WHERE MSG = 'DELETE'or aLAST_UPDATEcolumn still work. - Adds
FETCH FIRST 1000 ROWS ONLYwhen there is no limit.
CL commands: strict allow list
- Allowed:
DSP*,WRK*,CHKOBJ, compilation (CRTBNDRPG,CRTSQLRPGI,CRTBNDCBL, ...), library list and overrides. - Everything else is rejected:
DLTOBJ,DLTLIB,CLRPFM,RUNSQLSTM,SBMJOB,CALL,GRTOBJAUT, ... - Qualified commands (
QSYS/DLTLIB) are rejected. OUTFILE(...)must point toQTEMP, soDSP*commands cannot create or replace files in real libraries.
Everything else
- Library, file, member, user and spooled-file names are validated against the IBM i naming rules before they reach any SQL.
- Error messages never include credentials or connection strings.
Defense in depth. These checks reduce risk, they don't replace IBM i security. Connect with a user profile that only has the authorities it needs (ideally
*USEon the data and a development library for compiles).
Found by the tests
Writing the test suite (v1.1) exposed real gaps in v1.0, now fixed:
read_spoolfileconcatenateduserandspoolfile_nameinto SQL. Combined withQSYS2.QCMDEXC, that allowed running any CL command.execute_sqlacceptedVALUES QSYS2.QCMDEXC(...),FINAL TABLE (DELETE ...)andHTTP_POST(...).DSP*commands could write theirOUTFILEto any library.
Getting started
Requirements: Python 3.10+, the IBM i Access ODBC Driver, and a user on an IBM i system.
git clone https://github.com/LorenteFacundo/python-mcp-as400.git
cd python-mcp-as400
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -e .
cp .env.example .env # then fill in DB_HOST, DB_USER, DB_PASS
The server talks MCP over stdio. Add it to your client, for example Claude Desktop (claude_desktop_config.json):
{
"mcpServers": {
"as400": {
"command": "python",
"args": ["/path/to/python-mcp-as400/server.py"],
"env": {
"DB_HOST": "your-ibmi-host.com",
"DB_USER": "YOUR_USER",
"DB_PASS": "YOUR_PASSWORD"
}
}
}
}
Or with Claude Code: claude mcp add as400 -- python /path/to/python-mcp-as400/server.py
Example prompts
- "Which tables in MYLIB have a column called CUSTNO?" →
execute_sqloverQSYS2.SYSCOLUMNS - "Which programs use the file CUSTOMERS?" →
DSPPGMREF ... OUTFILE(QTEMP/REFS)+execute_sql - "Explain what CALCPRICE does" →
read_source_member - "Compile CALCPRICE and tell me what failed" →
compile_program+read_spoolfile
Development
pip install -e ".[dev]"
pytest
| File | Purpose |
|---|---|
server.py |
MCP tools and the ODBC connection |
validation.py |
Security checks (no dependencies) |
tests/ |
Tests for every check, including real attack strings |
License
python-mcp-as400 MCP 질문
python-mcp-as400 MCP는 어떤 도구를 제공하나요?
5개 도구를 제공합니다. 예: execute_sql, execute_cl_command, read_source_member, compile_program, read_spoolfile.
AI 어시스턴트가 IBM i 시스템의 데이터를 수정할 수 있나요?
아니요, 이 MCP server는 분석 및 컴파일 전용으로 설계되었습니다. 데이터 파괴를 방지하기 위해 읽기 전용 SQL을 사용하며 CL 명령에 대해 엄격한 허용 목록(allow-list)을 적용합니다.