Sponsored by Deepsite.site

LeanIX MCP Integration

Created By
pavanmadiraju-leanix8 months ago
The LeanIX MCP Integration is a Model Context Protocol server that bridges LeanIX's enterprise architecture platform with AI assistants. It exposes LeanIX's GraphQL API as MCP tools, enabling AI assistants like Claude to query and manage fact sheets using natural language and generate and execute GraphQL queries automatically.
Content

LeanIX MCP Integration

A Model Context Protocol (MCP) server that connects LeanIX to AI assistants. It exposes LeanIX's GraphQL API as MCP tools that AI assistants can use.

Core Functionality

This integration provides five MCP tools for LeanIX operations:

  1. Fact Sheet Overview: Get counts and statistics of fact sheets in your workspace
  2. Search: Find fact sheets by their names
  3. Subscription Management: View who is subscribed to specific fact sheets
  4. Create Fact Sheets: Add new fact sheets to your workspace
  5. Update Fact Sheets: Modify existing fact sheet information

Prerequisites

  • Node.js (v14 or higher)
  • A LeanIX workspace and API token
  • Basic understanding of GraphQL and MCP

Getting Started

  1. Clone this repository
  2. Install dependencies:
    npm install
    
  3. Create a .env file in the root directory with your LeanIX credentials:
    LEANIX_SUBDOMAIN=your-workspace-subdomain
    LEANIX_TOKEN=your-api-token
    

Project Structure

├── server.js            # Main MCP server setup and initialization
├── leanix-client.js     # LeanIX API client implementation
├── api                  # LeanIX API definitions and endpoints
├── mutation            # GraphQL mutation definitions
├── datamodel           # Data models and type definitions
├── .env                # Environment configuration
└── src/
    ├── config/
    │   └── config.js         # Loads and validates environment variables for LeanIX credentials
    ├── graphql/
    │   └── queries/         # GraphQL queries and mutations for LeanIX API
    │       ├── factSheetQueries.js     # Queries for fact sheet operations
    │       └── workspaceQueries.js     # Queries for workspace-level operations
    ├── tools/
    │   └── workspaceTools.js # Defines and registers the five MCP tools
    ├── types/
    │   └── schemas.js       # Zod schemas for validating tool parameters
    └── utils/
        └── responseHandler.js # Formats responses in MCP-compatible structure

Common Pitfalls and Solutions

  1. GraphQL Schema Mismatch: Always check the current LeanIX API schema in their documentation or GraphiQL interface. The schema may change over time.

  2. Response Formatting: All MCP tool responses must follow this format:

    {
      content: [{
        type: "text",
        text: "your response here"
      }]
    }
    
  3. Error Handling: Always wrap your tool implementations with withErrorHandling to ensure proper error responses.

  4. Environment Variables: Make sure to properly load and validate environment variables before making any API calls.

Claude Desktop Configuration

To use this MCP server with Claude Desktop, you need to add the server configuration to Claude's config file. The config file is typically located at:

  • Mac: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json

Add the following configuration:

{
    "mcpServers": {
      "myserver": {
        "command": "node",
        "args": [
          "/path/to/your/lean/server.js"
        ]
      }
    }
}

Replace /path/to/your/lean/server.js with the absolute path to your server.js file. This tells Claude Desktop to:

  1. Start this MCP server when needed
  2. Connect to it for LeanIX operations
  3. Run it using Node.js

Testing Your Integration

  1. Start the server:

    node server.js
    
  2. The server will connect to your LeanIX workspace and make the tools available through MCP.

  3. You can test your tools through any MCP-compatible client (like Claude).

Debugging Tips

  1. Enable debug logging in your configuration file to verify environment variables are loaded correctly.

  2. Use the LeanIX GraphiQL interface to test your queries before implementing them in your tools.

  3. Check the server console for detailed error messages when tools fail.

Resources

License

MIT

Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
WindsurfThe new purpose-built IDE to harness magic
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
Tavily Mcp
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
ChatWiseThe second fastest AI chatbot™
Amap Maps高德地图官方 MCP Server
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
Playwright McpPlaywright MCP server
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
DeepChatYour AI Partner on Desktop
Serper MCP ServerA Serper MCP Server
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
CursorThe AI Code Editor