mcp-server-leanix

abd-salam-shaikh/mcp-server-leanix

3.2

If you are the rightful owner of mcp-server-leanix and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

This repository hosts a Docker-based MCP server application designed to integrate seamlessly with the LeanIX API, providing a robust platform for data fetching and processing.

MCP Server for LeanIX

This repository contains a Docker-based MCP server application that integrates with the LeanIX API.

Features

  • LeanIX Integration: Connects to the LeanIX API to fetch and process data.
  • RESTful API: Exposes REST endpoints for interacting with the server.
  • Swagger/OpenAPI: Provides interactive API documentation.
  • Docker Support: Includes a Dockerfile and docker-compose.yml for easy deployment.
  • CI/CD: Automated build, test, and deployment pipelines using GitHub Actions.
  • Mock Mode: Supports a mock mode for local development and testing without a live LeanIX instance.

Getting Started

Prerequisites

  • Docker
  • Docker Compose
  • Python 3.10+

Installation

  1. Clone the repository:

    git clone https://github.com/your-username/mcp-server-leanix.git
    cd mcp-server-leanix
    
  2. Set up environment variables:

    Create a .env file in the root of the project and add the following variables:

    LEANIX_API_TOKEN="your-leanix-api-token"
    LEANIX_WORKSPACE_ID="your-leanix-workspace-id"
    LEANIX_API_BASE_URL="https://your-instance.leanix.net/services/mtm/v1"
    LEANIX_MOCK=false
    
  3. Build and run the application:

    docker-compose up --build
    
  4. Access the API:

    The API will be available at http://localhost:8000.

    • Swagger UI: http://localhost:8000/docs
    • Health Check: http://localhost:8000/health

Usage

API Endpoints

  • GET /health: Health check endpoint.
  • GET /fact-sheets: Get a list of fact sheets.
  • GET /fact-sheets/{id}: Get a single fact sheet by ID.
  • POST /mcp/query: Submit a query to the MCP server.

Mock Mode

To run the application in mock mode, set the LEANIX_MOCK environment variable to true. In this mode, the application will return static mocked JSON responses instead of connecting to the LeanIX API.

Testing

To run the tests, use the following command:

docker-compose run --rm app pytest

CI/CD

The repository is configured with GitHub Actions for CI/CD. The following workflows are included:

  • build-and-test: Builds the application and runs the tests on every push and pull request.
  • lint: Lints the code using flake8.
  • build-and-push: Builds and pushes the Docker image to a container registry on every release.

Contributing

Contributions are welcome! Please read the CONTRIBUTING.md file for more information.