Skip to main content
Glama
nickels

SAP AI Core Documentation MCP Server

by nickels
README.md
# SAP AI Core Documentation MCP Server

A Model Context Protocol (MCP) server providing semantic search and intelligent access to SAP AI Core documentation.

## Overview

This MCP server enables AI assistants like Claude to search, retrieve, and understand SAP AI Core documentation efficiently. It provides semantic search capabilities across the entire AI Core documentation repository from [SAP-docs/sap-artificial-intelligence](https://github.com/SAP-docs/sap-artificial-intelligence).

## Features

- **Semantic Search**: Intelligent search across all SAP AI Core documentation
- **Category Filtering**: Search within specific areas (administration, development, integration, concepts)
- **Document Retrieval**: Get complete documentation pages with table of contents
- **Topic-Specific Documentation**: Quick access to documentation for specific AI Core topics
- **Relevance Scoring**: Results ranked by relevance to your query

## Installation

### Prerequisites

- Node.js 20.0.0 or higher
- npm or yarn

### Quick Start

1. Clone this repository:
```bash
git clone <repository-url>
cd dlwr-dnl-ai-core-documentation-mcp
```

2. Install dependencies:
```bash
source ~/.zshrc && nvm use
npm install
```

3. Clone the SAP AI Core documentation as a git submodule:
```bash
git submodule add https://github.com/SAP-docs/sap-artificial-intelligence.git docs/sap-artificial-intelligence
git submodule update --init --recursive
```

4. Build the server:
```bash
npm run build
```

## Configuration

### Claude Desktop

Add to your Claude Desktop configuration (`~/Library/Application Support/Claude/claude_desktop_config.json`):

```json
{
  "mcpServers": {
    "sap-ai-core-docs": {
      "command": "node",
      "args": [
        "/absolute/path/to/dlwr-dnl-ai-core-documentation-mcp/build/index.js"
      ]
    }
  }
}
```

### Custom Documentation Path

To use a different documentation location:

```json
{
  "mcpServers": {
    "sap-ai-core-docs": {
      "command": "node",
      "args": [
        "/absolute/path/to/dlwr-dnl-ai-core-documentation-mcp/build/index.js"
      ],
      "env": {
        "SAP_AI_CORE_DOCS_PATH": "/path/to/custom/docs"
      }
    }
  }
}
```

## Available Tools

### 1. search_ai_core_docs

Semantically search SAP AI Core documentation.

**Parameters:**
- `query` (required): Search query string
- `category` (optional): Filter by category ('all', 'administration', 'development', 'integration', 'concepts')
- `limit` (optional): Maximum results (1-50, default: 10)

**Example:**
```
Search for "model training deployment best practices"
```

### 2. get_ai_core_document

Retrieve complete content of a specific documentation page.

**Parameters:**
- `path` (required): Relative path to document (from search results)

**Example:**
```
Get document at path "docs/sap-ai-core/getting-started.md"
```

### 3. get_ai_core_topic

Get comprehensive documentation for a specific SAP AI Core topic.

**Parameters:**
- `topic_name` (required): Name of the AI Core topic

**Example:**
```
Get documentation for "Model Training"
```

### 4. list_ai_core_categories

List all available documentation categories and top documents.

**Example:**
```
Show all available documentation categories
```

## Development

### Project Structure

```
dlwr-dnl-ai-core-documentation-mcp/
├── src/
│   ├── index.ts              # Entry point
│   ├── server.ts             # MCP server implementation
│   ├── types/
│   │   └── index.ts          # TypeScript type definitions
│   ├── indexer/
│   │   ├── markdown-parser.ts    # Markdown document parser
│   │   └── document-index.ts     # Document indexing & search
│   └── tools/
│       ├── search.ts             # Search tool implementation
│       ├── get-document.ts       # Document retrieval tool
│       ├── get-topic.ts          # Topic documentation tool
│       └── list-categories.ts    # Category listing tool
├── docs/
│   └── sap-artificial-intelligence/  # SAP AI Core docs (git submodule)
├── build/                     # Compiled JavaScript output
├── package.json
├── tsconfig.json
└── README.md
```

### Build Commands

```bash
# Build once
npm run build

# Build and watch for changes
npm run watch

# Run the server directly
npm run dev
```

### Testing

Test the server using the MCP Inspector:

```bash
npx @modelcontextprotocol/inspector node build/index.js
```

## Architecture

### Document Indexing

The server indexes all markdown files from the SAP AI Core documentation repository on startup:

1. **Parsing**: Uses `unified` and `remark` to parse markdown with frontmatter
2. **Extraction**: Extracts metadata, headings, sections, and keywords
3. **Indexing**: Creates a searchable index using Fuse.js for fuzzy semantic search
4. **Categorization**: Automatically categorizes documents based on folder structure

### Search Strategy

- **Multi-field search**: Searches across titles, headings, content, and keywords
- **Weighted scoring**: Titles and keywords weighted higher than content
- **Fuzzy matching**: Handles typos and partial matches
- **Context extraction**: Returns relevant excerpts around matched terms

## Use Cases

### For delaware Netherlands Team

- **AI Core Implementations**: Quick access to AI Core documentation during client projects
- **Training**: Support for AI/ML enablement programs
- **Solution Design**: Research AI Core capabilities and best practices
- **Troubleshooting**: Find solutions for specific AI Core issues

### For AI Agents (ConnectedBrain 2.0)

- **Semantic Module**: Integrate as a knowledge module in multi-agent orchestration
- **Context Provider**: Supply AI Core-specific context for solution generation
- **Code Assistant**: Help generate AI Core-compliant code and configurations

## SAP AI Core Topics Covered

- **Model Training**: Training ML models using SAP AI Core
- **Model Deployment**: Deploying and serving models
- **AI API**: REST API for AI Core services
- **Configuration Management**: Managing AI Core configurations
- **Resource Management**: Managing compute resources and artifacts
- **Integration**: Integrating AI Core with SAP BTP services
- **Security**: Authentication, authorization, and data protection
- **Monitoring**: Logging, metrics, and observability

## Performance

- **Initial Index Build**: ~5-10 seconds (depending on documentation size)
- **Search Queries**: <100ms (in-memory search)
- **Memory Usage**: ~50-100MB (indexed documents)

## Roadmap

### Phase 2 Enhancements
- Vector embeddings for improved semantic search
- Code sample extraction and indexing
- AI Core API pattern recognition
- Auto-update mechanism for documentation

### Phase 3 Advanced Features
- Graph database for AI Core service relationships
- Context caching for frequently accessed docs
- Integration with SAP Help Portal
- Multi-language support

## Contributing

This is a delaware Netherlands internal tool. For questions or contributions, contact the Data & AI team.

## License

MIT License - Internal delaware Netherlands use

## Support

For issues or questions:
- Internal: delaware Netherlands Data & AI team
- Documentation: [SAP AI Core Official Docs](https://help.sap.com/docs/AI_CORE)
- GitHub: [SAP AI Core Documentation Repository](https://github.com/SAP-docs/sap-artificial-intelligence)

---

**Built with ❤️ by delaware Netherlands Data & AI Team**

*Part of our "platform-first, cloud-native" AI-empowered operations initiative*

TDQS

A3.5/5.0

Scored across 4 tools

Disambiguation4/5

The tools have mostly distinct purposes: get_ai_core_document retrieves a specific page by path, get_ai_core_topic fetches comprehensive topic documentation, list_ai_core_categories lists categories for exploration, and search_ai_core_docs performs semantic searches. However, get_ai_core_document and get_ai_core_topic could be slightly confusing as both retrieve documentation content, though they differ in input specificity (path vs. topic).

Naming Consistency5/5

All tools follow a consistent verb_noun pattern with 'ai_core' as a prefix: get_ai_core_document, get_ai_core_topic, list_ai_core_categories, and search_ai_core_docs. This uniformity makes the tool set predictable and easy to understand, with no deviations in naming conventions.

Tool Count4/5

Four tools are reasonable for a documentation server, covering key operations like retrieval, listing, and searching. It is slightly thin but well-scoped for the domain, as it includes essential functions without unnecessary bloat. A few more tools (e.g., for metadata or filtering) could enhance it, but it's not a significant gap.

Completeness4/5

The tool set covers core documentation workflows: browsing (list_ai_core_categories), retrieving by path or topic (get_ai_core_document, get_ai_core_topic), and searching (search_ai_core_docs). Minor gaps exist, such as no tools for updating documentation or handling user-specific queries, but agents can work around these with the provided tools for most use cases.

Maintenance

ActivityInactive
ResponsivenessNo issues