Skip to main content
Glama
Nidhideep

SAP Clean Core MCP Server

by Nidhideep
README.md
# SAP Clean Core MCP Server

An MCP (Model Context Protocol) server that classifies SAP ABAP objects against SAP's official Clean Core release catalog. Built for architects, developers, and consultants working on S/4HANA implementations.

## What it does

Instantly classify any SAP object (BAPI, function module, CDS view, BDEF, table) against SAP's [abap-atc-cr-cv-s4hc](https://github.com/SAP/abap-atc-cr-cv-s4hc) dataset — the same catalog that ATC (ABAP Test Cockpit) uses during transport checks.

```
> Classify BAPI_GOODSMVT_CREATE for PCE

BAPI_GOODSMVT_CREATE → Level C | Not in catalog | ATC Priority 2
I_PURCHASEORDER      → Level C | notToBeReleasedStable | ATC Priority 2  ← the trap
I_BUSINESSPARTNER    → Level A | released | Use freely ✓
```

## Clean Core Levels

| Level | State | ATC | Meaning |
|-------|-------|-----|---------|
| **A** | `released` | None | Released API — use freely |
| **B** | `classicAPI` / `deprecated` | Priority 3 | Classic API — migration path exists |
| **C** | `notToBeReleased` / `notToBeReleasedStable` | Priority 2 | Internal — exemption required |
| **D** | `noAPI` | Priority 1 | No API exists — redesign required |
| **C** | Not in catalog | Priority 2 | Defaults to C per SAP rule 3.3.4.3.3 |

## Tools

| Tool | Description |
|------|-------------|
| `cc_classify_objects` | Classify a list of objects — returns level, ATC priority, and recommended action |
| `cc_lookup_object` | Full detail lookup for a single object including successors |
| `cc_find_successors` | Find the released replacement API for a blocked object |
| `cc_search_objects` | Wildcard/prefix search across 44,000+ objects |
| `cc_semantic_search` | Natural language search ("goods movement posting API") |
| `cc_search_by_component` | Find all released APIs in a software/application component |
| `cc_get_statistics` | Dataset stats — level distribution, object types, top components |
| `cc_list_object_types` | All object types in the catalog with counts |
| `cc_partner_objects` | Query partner-extended release catalog |
| `cc_explain_level` | Explain what a Clean Core level means and what to do about it |

## Deployment Targets

- **PCE** — S/4HANA Private Cloud Edition (default)
- **PUBLIC** — S/4HANA Public Cloud
- **BTP** — BTP ABAP Environment

## Dataset

Backed by SAP's official open-source release catalog:
[github.com/SAP/abap-atc-cr-cv-s4hc](https://github.com/SAP/abap-atc-cr-cv-s4hc)

- **44,541 objects** across S4CORE, SAP_ABA, SAP_BASIS and partner namespaces
- Updated with each SAP release
- Loaded at startup, cached in-memory — no database required

## Quick Start

```bash
git clone https://github.com/Nidhideep/sap-clean-core-mcp
cd sap-clean-core-mcp
npm install
npm run build
npm run setup    # creates .env and .mcp.json
```

Register with Claude Code:

```bash
claude mcp add --scope user sap-clean-core -- node /path/to/sap-clean-core-mcp/dist/src/index.js
```

Or add to your `.mcp.json`:

```json
{
  "mcpServers": {
    "sap-clean-core": {
      "command": "node",
      "args": ["/path/to/sap-clean-core-mcp/dist/src/index.js"],
      "env": {
        "DEFAULT_TARGET": "PCE"
      }
    }
  }
}
```

## Environment Variables

| Variable | Default | Description |
|----------|---------|-------------|
| `DEFAULT_TARGET` | `PCE` | Default deployment target (PCE/PUBLIC/BTP) |
| `DISABLE_EMBEDDINGS` | `false` | Set `true` to skip semantic search index |
| `FETCH_TIMEOUT_MS` | `60000` | GitHub dataset fetch timeout |
| `LOG_LEVEL` | `info` | Set `debug` for verbose logs |

## Requirements

- Node.js 18+
- Internet access at startup (fetches SAP dataset from GitHub)

## License

MIT

TDQS

A4.2/5.0

Scored across 10 tools

Disambiguation5/5

Each tool targets a distinct operation: bulk classification, level explanation, successor search, statistics, object type listing, single lookup, partner search, component-based search, pattern search, and semantic search. There is no overlap or ambiguity.

Naming Consistency4/5

All tools share the 'cc_' prefix and most follow a verb_noun pattern (e.g., classify_objects, list_object_types). However, a few like 'partner_objects' and 'semantic_search' deviate from this pattern, introducing minor inconsistency.

Tool Count5/5

With 10 tools covering classification, search, statistics, and partner objects, the count is well-scoped for the SAP Clean Core compliance domain. Each tool serves a clear purpose without redundancy.

Completeness5/5

The tool set provides comprehensive coverage for Clean Core compliance: bulk and single object classification, level explanation, successor discovery, statistics, multiple search methods (exact, pattern, semantic, by component, by partner), and object type listing. No obvious gaps are present.

Maintenance

ActivityInactive
ResponsivenessNo issues