Purpose
CodeLogic MCP Server is an MCP (Model Context Protocol) server designed to integrate Lineai's rich software dependency data into AI coding assistants. It allows AI assistants to perform impact analysis, dependency exploration, and architectural risk assessment when modifying code.
Main Capabilities
The server implements eight tools, divided into two categories:
Impact Analysis Tools
- lineai-method-impact: Retrieves an impact assessment of code from the Lineai server API. Requires the name of the "method" being worked on; "class" is an optional parameter (used as a case-insensitive filter when multiple matches exist).
- lineai-database-impact: Analyzes the impact between code and database entities. Requires the database entity type (column, table, or view) and its name.
Graph Tools (based on the Lineai Graph HTTP API)
- lineai-graph-capabilities: Discovers the relationship types, limits, and flags supported by the workspace materialized view.
- lineai-graph-search: Searches for nodes by text query and/or identity prefix.
- lineai-graph-impact: Performs dependency/blast-radius-style traversal from seed nodes.
- lineai-graph-path-explain: Explains the shortest path between two nodes.
- lineai-graph-validate-change-scope: Provides a heuristic checklist/risk summary for a proposed change based on seed nodes and a change summary.
- lineai-graph-owners: Resolves nodes by node ID or identity prefix and displays property fields whose names contain "owner".
All eight tools accept an optional workspace and materialized_view_id parameter to scope a single call; when neither is provided (and LINEAI_WORKSPACE_NAMEis not set), the latest materialized view of the server's default workspace is used automatically.
Usage
Environment Requirements
- Astral UV must be installed to run.
- Lineai server connection information must be configured.
Configure Environment Variables
LINEAI_SERVER_HOST: Lineai server URL (required).LINEAI_USERNAME: Lineai username (required).LINEAI_PASSWORD: Lineai password (required).LINEAI_WORKSPACE_NAME: Default workspace (optional).LINEAI_DEBUG_MODE: Set to true to enable debug mode (default false).- Other optional tuning variables:
LINEAI_TOKEN_CACHE_TTL(default 3600 seconds),LINEAI_METHOD_CACHE_TTL(default 300 seconds),LINEAI_IMPACT_CACHE_TTL(default 300 seconds),LINEAI_MV_CACHE_TTL(default 300 seconds),LINEAI_REQUEST_TIMEOUT(default 120.0 seconds),LINEAI_CONNECT_TIMEOUT(default 30.0 seconds).
IDE Configuration
Multiple IDEs are supported, configured as follows:
- VS Code: GitHub Copilot agent mode must be enabled; create a
.vscode/mcp.jsonfile for configuration. - Claude Desktop: Edit the configuration file (macOS:
~/Library/Application Support/Claude/claude_desktop_config.json;Windows:%APPDATA%/Claude/claude_desktop_config.json;Linux:~/.config/Claude/claude_desktop_config.json). - Windsurf IDE: Create or modify
~/.codeium/windsurf/mcp_config.json. - Cursor: Create a
.cursor/mcp.jsonfile.
Known macOS Issue
When using uvx on macOS, the Lineai MCP server may fail to start in some IDEs (such as Cursor). Workaround: clone the project locally, configure mcp.json to use uv instead of uvx, and restart the IDE.
AI Assistant Instructions
Instructions/rules can be added for the AI assistant to help it use the Lineai tools effectively. It is recommended to customize them according to the team's coding standards. When the graph API is available, use the lineai-graph-* tool for bounded graph discovery; if a graph call fails with "unavailable", fall back to lineai-method-impact / lineai-database-impact.
Applicable Scenarios
- Impact assessment before code changes.
- Dependency analysis between database entities and code.
- Architecture risk analysis and change scope verification.
- Dependency exploration within AI programming assistants.
Limitations
- Requires a Lineai server instance and valid credentials.
- Graph tools require Lineai to be deployed under
/api/ai-retrieval/graph/to provide graph endpoints; older or partial deployments may return 404. - Version compatibility: 0.3.1 and below are compatible with all Lineai API versions; 0.4.0 and above require Lineai API version 25.10.0 or higher.
- Debug files are written to the system temporary directory (Windows:
%TEMP%\lineai-mcp-server;macOS/Linux:/tmp/lineai-mcp-server). - Unit tests use mock data and do not require a connection to a Lineai server; integration tests require a real Lineai server.
- Graph MCP end-to-end tests are skipped by default when the graph route is missing, and can be set to
LINEAI_GRAPH_E2E_REQUIRED=1to make them fail.