Metadata-Version: 2.4
Name: sap-search-mcp
Version: 1.1.3
Summary: MCP server for searching SAP test cases using Azure AI Search
Author-email: SAP Search MCP Contributors <support@example.com>
License: MIT
Project-URL: Homepage, https://github.com/yourusername/sap-search-mcp
Project-URL: Repository, https://github.com/yourusername/sap-search-mcp
Keywords: mcp,sap,azure,search,test-cases
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: mcp>=0.5.0
Requires-Dist: azure-search-documents>=11.4.0
Requires-Dist: azure-core>=1.29.0
Requires-Dist: openai>=1.0.0
Requires-Dist: python-dotenv>=1.0.0
Requires-Dist: tenacity>=8.2.0
Requires-Dist: python-docx>=1.0.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: black>=23.0.0; extra == "dev"
Requires-Dist: mypy>=1.0.0; extra == "dev"
Dynamic: license-file

# SAP Search MCP Server v2.0

Enterprise MCP server for semantic search over SAP S/4HANA test cases using Azure AI Search.

## Features

✅ **2-Tool Architecture** - Lightweight summaries + on-demand details  
✅ **Markdown Tables** - Procedure steps in clean table format  
✅ **Auto-Upload** - Documents uploaded automatically on first run  
✅ **Vector Search** - Semantic search using Azure OpenAI embeddings  
✅ **240+ SAP Test Cases** - S/4HANA 2023 FPS02 Business Process Documents

## Quick Start

### 1. Install
```bash
pip install sap-search-mcp
```

### 2. Set Environment Variables

Create a `.env` file:
```bash
# Azure AI Search
AZURE_SEARCH_ENDPOINT=https://your-service.search.windows.net
AZURE_SEARCH_KEY=your_key

# Azure OpenAI (for embeddings)
AZURE_SEARCH_OPENAI_ENDPOINT=https://your-openai.cognitiveservices.azure.com/
AZURE_SEARCH_OPENAI_KEY=your_key

# Optional
INDEX_KNOWLEDGEHOUSE=knowledgehouse-en
INDEX_QUERYTABLE=querytable
EMBEDDING_MODEL=text-embedding-3-large
```

### 3. Use with Claude Desktop

Edit `%APPDATA%\Claude\claude_desktop_config.json`:
```json
{
  "mcpServers": {
    "sap-search": {
      "command": "sap-search-mcp",
      "env": {
        "AZURE_SEARCH_ENDPOINT": "https://your-service.search.windows.net",
        "AZURE_SEARCH_KEY": "your_key",
        "AZURE_SEARCH_OPENAI_ENDPOINT": "https://your-openai.cognitiveservices.azure.com/",
        "AZURE_SEARCH_OPENAI_KEY": "your_key"
      }
    }
  }
}
```

Restart Claude Desktop.

## Tools

### 1. search_sap_test_cases
Search SAP test cases with flexible results.

**Single result (full details):**
```json
{"prompt": "Create purchase order", "top_k": 1}
```

**Multiple summaries:**
```json
{"prompt": "Invoice processing", "top_k": 5}
```

### 2. get_test_case_details
Get full procedure table for a specific test case.

```json
{
  "section_header": "Create Purchase Order - ME21N",
  "original_prompt": "purchase order"
}
```

## Example Usage

```
User: "Show me 5 test cases for sales orders"
→ Returns 5 lightweight summaries

User: "Show me details for option 2"
→ Returns full procedure table in markdown format
```

## Manual Upload (Optional)

Documents are uploaded automatically on first run. To manually re-upload:

```bash
sap-search-upload
```

## Development

```bash
git clone <repo>
cd sap_search_mcp
pip install -e .
python test.py
```

## What's New in v2.0

- 🎯 Simplified 2-tool architecture (was 3 tools)
- 📊 Markdown table formatting for procedures
- 🚀 Auto-upload on server start
- ⚡ Lightweight summaries for multiple results
- 🎨 Better output formatting

## License

MIT
