# SAP Business Technology Platform Documentation MCP Server

> **Bring the entire SAP Business Technology Platform documentation directly into Claude Desktop** - search, explore, and get instant answers without leaving your AI assistant.

[![npm version](https://img.shields.io/npm/v/@contiva/sapbtp-docs-mcp)](https://www.npmjs.com/package/@contiva/sapbtp-docs-mcp)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)

## What is this?

This MCP (Model Context Protocol) server gives Claude Desktop instant access to the **complete SAP Business Technology Platform documentation**, including:

- 📘 **SAP BTP Core** - Platform fundamentals, accounts, security
- 🔌 **Services & Solutions** - All SAP BTP services and capabilities
- 🚀 **Development & Operations** - Best practices, guides, and tutorials

**No more switching between browser tabs.** Ask Claude about SAP BTP directly in your conversation.

---

## Quick Start (2 minutes)

### Step 1: Install via Claude Desktop Config

Add this to your Claude Desktop configuration:

**macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
**Windows**: `%APPDATA%\Claude\claude_desktop_config.json`

```json
{
  "mcpServers": {
    "sapbtp-docs": {
      "command": "npx",
      "args": ["@contiva/sapbtp-docs-mcp"]
    }
  }
}
```

### Step 2: Restart Claude Desktop

That's it! On first launch, the documentation downloads automatically in 1-2 minutes.

### Step 3: Start asking questions

Try these in Claude:

> "Search for OAuth 2.0 authentication in SAP BTP"

> "Show me how to configure subaccounts and entitlements"

> "What are the best practices for SAP BTP security?"

---

## Why Use This?

### ✅ **Instant, Context-Aware Answers**
Instead of searching through help.sap.com manually, Claude can:
- Search across all documentation instantly
- Understand your question contextually
- Combine information from multiple articles
- Give you step-by-step guidance based on official docs

### ✅ **Three Powerful Search Methods**
- **Full-text search** - Find anything across all documentation
- **Title-based search** - Fast fuzzy matching for quick lookups
- **Semantic search** - AI understands what you mean, not just keywords

### ✅ **Works Offline**
All documentation and AI embeddings run locally. No API keys needed, no data leaves your machine.

---

## Real-World Examples

### Example 1: Learning a New Feature

**You:**
> "I need to set up a Cloud Foundry environment in SAP BTP. Show me the steps."

**Claude (with MCP):**
> I'll search the SAP BTP documentation for Cloud Foundry setup...
>
> Based on the official documentation, here are the steps to set up Cloud Foundry:
>
> 1. Create a subaccount in your global account
> 2. Enable the Cloud Foundry environment...
> [Complete step-by-step guide with exact configuration]

---

### Example 2: Troubleshooting

**You:**
> "How do I manage entitlements and quotas in my SAP BTP account?"

**Claude (with MCP):**
> Let me search for entitlement management in the SAP BTP documentation...
>
> Entitlements define the services and resources available in your subaccounts. Here's how to manage them:
>
> [Specific steps and best practices from the docs]

---

### Example 3: Architecture Decisions

**You:**
> "What's the difference between Cloud Foundry and Kyma runtime in SAP BTP?"

**Claude (with MCP):**
> I'll compare both runtime environments from the documentation...
>
> **Cloud Foundry:**
> - Use case: [from docs]
> - Key features: [from docs]
>
> **Kyma:**
> - Use case: [from docs]
> - Key features: [from docs]
>
> **Recommendation:** [Based on official SAP guidance]

---

## Features in Detail

### 🔍 Smart Search Capabilities

```
Claude can now:
├─ Search by keywords (full-text)
├─ Search by topic titles (fuzzy matching)
├─ Search by meaning (semantic AI search)
└─ Combine all three for best results
```

### 📚 Complete Documentation Coverage

- Complete SAP BTP platform documentation
- All services, capabilities, and features
- Development guides, operations, and security best practices
- Automatically updated from [SAP's official repository](https://github.com/SAP-docs/btp-cloud-platform)

### ⚡ Performance

- **Startup**: < 1 second
- **Search**: 100-200ms for full-text, 500ms for semantic
- **Memory**: Efficient resource usage
- **First-time setup**: 1-2 minutes (one-time documentation download)

### 🔒 Privacy-First

- **100% local** - All AI embeddings run on your machine
- **No API keys** - No external services required
- **No data sharing** - Your queries stay private

---

## Available Commands

Once installed, Claude can use these tools automatically:

### 🔍 search_documentation
Search across all documentation with combined search methods.

**Example questions:**
- "Search for SAML authentication in SAP BTP"
- "Find documentation about account management"
- "Show me service configuration examples"

---

### 📖 read_article
Read complete documentation articles.

**Example questions:**
- "Read the full article about SAP BTP security"
- "Show me the complete guide for account setup"

---

### 📑 list_topics
Browse documentation structure hierarchically.

**Example questions:**
- "List all SAP BTP core platform topics"
- "Show me the table of contents for services and solutions"

---

### 🔗 get_related_articles
Find related documentation automatically.

**Example questions:**
- "What else should I read about SAP BTP security?"
- "Find related articles to this account management guide"

---

## Advanced Configuration

### Custom Documentation Path

If you cloned the SAP docs repository locally:

```json
{
  "mcpServers": {
    "sapbtp-docs": {
      "command": "npx",
      "args": ["@contiva/sapbtp-docs-mcp"],
      "env": {
        "MCP_DOCS_PATH": "/path/to/btp-cloud-platform/docs"
      }
    }
  }
}
```

### Cloud Embeddings (Optional)

For faster initial indexing, use cloud-based embeddings:

```json
{
  "mcpServers": {
    "sapbtp-docs": {
      "command": "npx",
      "args": ["@contiva/sapbtp-docs-mcp"],
      "env": {
        "EMBEDDING_PROVIDER": "voyage",
        "VOYAGE_API_KEY": "your-api-key"
      }
    }
  }
}
```

**Note:** Local embeddings (default) are free and work offline. Cloud embeddings reduce first-time indexing from 10-15 minutes to 2-3 minutes but require an API key.

---

## Troubleshooting

### "Documentation not found" error

The first run downloads docs automatically. If it fails:

```bash
# Manual installation
git clone https://github.com/SAP-docs/btp-cloud-platform.git
export MCP_DOCS_PATH=/path/to/btp-cloud-platform/docs
```

Then restart Claude Desktop.

### MCP server not showing up

1. Check your config file path is correct
2. Ensure JSON syntax is valid (use a JSON validator)
3. Restart Claude Desktop completely
4. Check Claude Desktop logs for errors

### Slow semantic search

First-time semantic search builds an AI index (10-15 minutes with local embeddings). This is one-time only - subsequent searches are instant.

---

## Development

### Local Development Setup

```bash
# Clone the MCP server
git clone https://github.com/robertfels/sapbtp-docs-mcp.git
cd sapbtp-docs-mcp

# Clone SAP docs (or it downloads automatically)
git clone https://github.com/SAP-docs/btp-cloud-platform.git

# Install and build
npm install
npm run build

# Test locally
npm start
```

### Publishing Updates

```bash
npm version patch
npm publish --otp=<your-2fa-code>
```

---

## How It Works

```
┌─────────────────┐
│  Claude Desktop │
│                 │
│  "Search for    │
│   Cloud Foundry │
│   setup"        │
└────────┬────────┘
         │
         │ MCP Protocol
         ▼
┌─────────────────────────────────┐
│  @contiva/sapbtp-docs-mcp        │
│                                 │
│  ┌───────────┐  ┌────────────┐ │
│  │ Full-text │  │   Title    │ │
│  │  Search   │  │   Search   │ │
│  └───────────┘  └────────────┘ │
│                                 │
│  ┌───────────────────────────┐ │
│  │   Semantic AI Search      │ │
│  │   (Local Embeddings)      │ │
│  └───────────────────────────┘ │
│                                 │
│  ┌───────────────────────────┐ │
│  │  SAP BTP Documentation    │ │
│  │  (Downloaded from SAP)    │ │
│  └───────────────────────────┘ │
└─────────────────────────────────┘
```

---

## Related Projects

- [Model Context Protocol](https://modelcontextprotocol.io/) - Open protocol for AI-tool integration
- [SAP Business Technology Platform Docs](https://github.com/SAP-docs/btp-cloud-platform) - Official SAP documentation repository
- [Claude Desktop](https://claude.ai/download) - AI assistant with MCP support

---

## Contributing to SAP Documentation

Found an error in the SAP documentation? You can contribute!

This MCP server uses the official [SAP Business Technology Platform documentation repository](https://github.com/SAP-docs/btp-cloud-platform). All contributions to the documentation should be made there.

### How to Contribute

1. Open the relevant guide on [SAP Help Portal](https://help.sap.com/docs/btp)
2. Choose **Feedback** > **Edit page** to suggest changes
3. Or choose **Feedback** > **Create issue** to report problems

See [SAP's Contribution Guidelines](https://help.sap.com/products/open-documentation-initiative/contribution-guidelines/readme.html) for more details.

### Covered Documentation Areas

This MCP server provides access to the complete SAP Business Technology Platform documentation, covering all platform services, features, and capabilities as published in the [official SAP BTP documentation repository](https://github.com/SAP-docs/btp-cloud-platform).

---

## License

This MCP server is licensed under [Apache-2.0](LICENSE).

The SAP documentation content is subject to SAP's licensing terms. See the [SAP documentation repository](https://github.com/SAP-docs/btp-cloud-platform) for details.

---

## Support

- **Issues**: [GitHub Issues](https://github.com/robertfels/sapbtp-docs-mcp/issues)
- **NPM Package**: [@contiva/sapbtp-docs-mcp](https://www.npmjs.com/package/@contiva/sapbtp-docs-mcp)
- **SAP Documentation**: [help.sap.com/btp](https://help.sap.com/docs/btp)

---

**Made with ❤️ for the SAP Business Technology Platform community**

[![REUSE status](https://api.reuse.software/badge/github.com/SAP-docs/btp-cloud-platform)](https://api.reuse.software/info/github.com/SAP-docs/btp-cloud-platform)
