SAP Note Search MCP Server

SAP Note Search MCP Server

This MCP server allows Cursor AI users to search and retrieve SAP Notes and Knowledge Base articles using SAP Passport authentication and Playwright automation.

Category
访问服务器

README

SAP Note Search MCP Server

MCP server for searching SAP Notes/KB articles using SAP Passport authentication and Playwright automation

License: Apache 2.0 Node.js TypeScript

This Model Context Protocol (MCP) server provides direct access to SAP Notes and Knowledge Base articles through Cursor AI. It uses SAP Passport certificate authentication and Playwright browser automation to retrieve actual note content from SAP's systems.

✨ Features

  • 🔍 Direct SAP Note access - Retrieve full note content and metadata
  • 🎫 SAP Passport authentication - Secure certificate-based authentication
  • 🤖 Playwright automation - Handles complex SAP authentication flows
  • 💾 Smart caching - Authentication tokens cached locally
  • 🔧 Debug-friendly - Comprehensive logging and troubleshooting options
  • 📋 MCP compliant - Works seamlessly with Cursor AI

Live Preview in Cursor

Cursor MCP Server Preview

🚀 Quick Start

Prerequisites

Installation

  1. Clone the repository

    git clone https://github.com/marianfoo/mcp-sap-notes
    cd mcp-sap-notes
    
  2. Install dependencies

    npm install
    
  3. Build the project

    npm run build
    

Setup

  1. Get your SAP Passport certificate - Only possible for S-User

    • Go to SAP Passport
    • Create your certificate
    • Download the .pfx certificate file
  2. Create certificate directory

    mkdir certs
    
  3. Copy your SAP Passport certificate

    • Place your .pfx certificate file in the certs/ directory
    • Name it sap.pfx (or update the path in configuration)
  4. Configure environment

    cp .env.example .env
    

    Edit .env and add your certificate passphrase:

    PFX_PATH=./certs/sap.pfx
    PFX_PASSPHRASE=your_actual_passphrase
    

Connect to Cursor

  1. Open Cursor settings (Cmd/Ctrl + ,)

  2. Add MCP server configuration to your settings.json:

    {
      "mcpServers": {
        "sap-note-search": {
          "command": "node",
          "args": ["/full/path/to/sap-note-search-mcp/dist/mcp-server.js"]
        }
      }
    }
    

    ⚠️ Important: Replace /full/path/to/sap-note-search-mcp with the actual full path to your project directory.

  3. Restart Cursor - The SAP Note tools will appear in your AI assistant

🎯 Usage Examples

Search for a specific SAP Note

Find SAP Note 2744792

Search by keywords

Search for SAP Notes about "OData gateway metadata error"

Get complete note details

Get the full content of SAP Note 2744792

🛠️ Testing & Development

Test Authentication

npm run test:auth

This tests the SAP Passport authentication flow and verifies your certificate setup.

Test API Access

npm run test:api

This tests the SAP Notes API integration and content extraction.

Test Complete MCP Server

npm run test:mcp

This simulates the complete MCP server workflow.

Run All Tests

npm run test

🐛 Troubleshooting

Certificate Issues

Error: "Certificate file not found"

  • Ensure the certificate path in your configuration is correct
  • Use full absolute paths in Cursor's settings.json
  • Verify the certificate file exists and is readable

Error: "Authentication failed"

  • Check your certificate passphrase is correct
  • Ensure your SAP Passport certificate is valid and not expired
  • Try running with HEADFUL=true to see browser authentication

Browser Issues

Error: "Browser launch failed"

# Install Playwright browsers
npx playwright install

Authentication hangs or times out

  • Run with debug mode: HEADFUL=true npm run test:auth
  • Check your network connection to SAP systems
  • Verify your certificate has proper SAP system access

MCP Integration Issues

Tools not appearing in Cursor

  • Restart Cursor completely
  • Check the MCP server path in settings.json is absolute
  • Verify the cwd setting points to your project directory

Error: "MCP server failed to start"

  • Check the console output in Cursor's developer tools
  • Ensure all dependencies are installed: npm install
  • Verify the build completed successfully: npm run build

Debug Mode

Enable debug mode for detailed troubleshooting:

# Set environment variables for debugging
export HEADFUL=true
export LOG_LEVEL=debug

# Run tests with visible browser
npm run test:auth

📁 Project Structure

sap-note-search-mcp/
├── src/
│   ├── mcp-server.ts        # Main MCP server
│   ├── auth.ts              # SAP authentication
│   ├── sap-notes-api.ts     # SAP Notes API client
│   ├── types.ts             # TypeScript definitions
│   └── logger.ts            # Logging configuration
├── test/
│   ├── test-auth.js         # Authentication tests
│   ├── test-sap-api.js      # API tests
│   └── test-mcp-server.js   # Complete server tests
├── dist/                    # Compiled JavaScript
├── certs/                   # Certificate directory
├── .env.example             # Environment template
└── README.md               # This file

⚙️ Configuration

Environment Variables

Variable Required Default Description
PFX_PATH - Path to SAP Passport certificate (.pfx)
PFX_PASSPHRASE - Certificate passphrase
MAX_JWT_AGE_H 12 Token cache lifetime (hours)
HEADFUL false Browser visibility (for debugging)
LOG_LEVEL info Logging level (debug, info, warn, error)

Playwright Configuration

The server automatically installs required Playwright dependencies. For manual installation:

npx playwright install chromium

🔒 Security

  • Certificate Security: Your SAP Passport certificate never leaves your machine
  • Token Caching: Authentication tokens are cached locally and expire automatically
  • No Data Storage: SAP Note content is retrieved on-demand, not stored
  • Secure Communication: All SAP API calls use HTTPS with certificate authentication

📋 Available Tools

sap_note_search

Search SAP Notes and KB articles by note ID or keywords.

Parameters:

  • q (string, required): Query string or Note ID
  • lang (string, optional): Language code ("EN" or "DE"), defaults to "EN"

sap_note_get

Retrieve full content and metadata for a specific SAP Note.

Parameters:

  • id (string, required): SAP Note ID (6-8 digits)
  • lang (string, optional): Language code ("EN" or "DE"), defaults to "EN"

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Commit your changes: git commit -m 'Add amazing feature'
  4. Push to the branch: git push origin feature/amazing-feature
  5. Open a Pull Request

推荐服务器

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 模型以安全和受控的方式获取实时的网络信息。

官方
精选