plsql-test-mcp

plsql-test-mcp

MCP server for IFS Cloud PL/SQL unit testing, enabling check of testability, generation of unit tests, and orchestration of deploy/run steps via ifs-f1-codegen-dev.

Category
访问服务器

README

PL/SQL Test MCP

MCP server for IFS Cloud PL/SQL unit testing — mirrors the architecture of integration-testing-mcp and delegates deploy/run steps to ifs-f1-codegen-dev.

Develop MCP to identify if a function/procedure is unit testable and generate the test.

Workflow

flowchart TD
    A[checkUnitTestability] --> B{Testable?}
    B -->|No| C[annotateIgnoreUnitTest]
    B -->|Yes| D[generateUnitTest]
    D --> E[generate_code / generate_and_deploy via ifs-f1-codegen-dev]
    E --> F[Verify test passes]
    C --> E

Tools

Tool Description
checkUnitTestability Parse .plsql/.plsvc and assess pltst testability
annotateIgnoreUnitTest Add @IgnoreUnitTest <reason> before a method
generateUnitTest Analyze method body, generate deploy-safe mocks, data-driven FOR loops, and assertions
processUnitTestCoverage Batch: annotate all non-testable methods + generate all missing auto-safe tests for one file
runUnitTest Return generate_and_deploy instructions for ifs-f1-codegen-dev
runPlsqlTestWorkflow End-to-end: check → annotate OR generate → run prep
getIgnoreUnitTestRules List supported ignore reasons

Supported @IgnoreUnitTest reasons

Reason When to use
TrivialFunction Simple getter/pass-through
MethodOverride @Override CRUD/framework methods
DMLOperation INSERT/UPDATE/DELETE/MERGE in body
NoOutParams Procedure with no OUT/IN OUT params
DynamicStatement EXECUTE IMMEDIATE / dynamic SQL
BLOBDataType / CLOBDataType Large object types
PLSQLInSQL PL/SQL embedded in SQL views
PipelinedFunction Pipelined table functions

Cursor integration

Add to Cursor MCP settings:

{
  "mcpServers": {
    "plsql-test": {
      "command": "node",
      "args": ["C:/ifsapps-new/plsql-test-mcp/dist/index.js"]
    }
  }
}

Or after publishing:

{
  "mcpServers": {
    "plsql-test": {
      "command": "npx",
      "args": ["-y", "@ifs/plsql-test-mcp@0.1.0"]
    }
  }
}

Development

cd c:/ifsapps-new/plsql-test-mcp
npm install
npm run build
npm start

Deploy-safe generation (v0.1.4)

The generator avoids patterns that break AV_*_TST compilation:

  • No UTF-8 BOM on written .pltst files
  • VARCHAR2(2000) for all generated IS-section locals (bare VARCHAR2 causes PLS-00215)
  • Pre-write validation rejects bare VARCHAR2, BOM, and post-loop generated tests
  • Skips %ROWTYPE return types and SELECT * INTO %ROWTYPE (manual test required)
  • Skips CRUD modify methods using Get_Object_By_Id___ + Unpack___
  • Expression SELECT columns (round(cast(...))) mapped to safe mock column names
  • FOR loop column order matches IFS convention: expected_ | input_param_
  • Not-found cases stay inside the FOR loop (no post-loop statements)
  • Skips @IgnoreUnitTest when the method already has a UNITTEST block
  • Special mocks for Get_Wp_Id, Has_Skills_Assigned_In_Turn, Get_Fault_Id_From_Record_Id, Get_AOS_Days, Get_Hm_Contract_Id_By_Barcode

Batch coverage example

processUnitTestCoverage({
  sourceFile: "C:/ifsapps-new/workspace/adcom/source/adcom/database/AvFault.plsql",
  workspace: "C:/ifsapps-new/workspace",
  jiraKey: "PJZ-12345",
  confirmed: true
})

Example

Analyze McprActivityRelation.plsql:

checkUnitTestability({
  sourceFile: "C:/ifsapps-new/workspace/prjrep/source/prjrep/database/McprActivityRelation.plsql",
  methodName: "Is_Circular_Link___"
})

Generate test:

generateUnitTest({
  sourceFile: ".../McprActivityRelation.plsql",
  methodName: "Is_Circular_Link___",
  workspace: "C:/ifsapps-new/workspace",
  jiraKey: "PJZ-12345",
  confirmed: true
})

Run via ifs-f1-codegen-dev:

generate_and_deploy({
  input_files: [".../McprActivityRelation.plsql", ".../McprActivityRelation.pltst"],
  environment_key: "26r1-dev-lkp",
  workspace: "C:/ifsapps-new/workspace",
  confirmed: true
})

Note on plvst

IFS uses .pltst files for both .plsql and .plsvc unit tests. No separate .plvst extension exists in the codebase — this MCP targets .pltst.

Related

  • integration-testing-mcp — reference MCP architecture
  • ifs-f1-codegen-dev — code generation, SQLcl deploy, live DB inspect

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选