lineai-mcp-server
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
An MCP Server to utilize Lineai's rich software dependency data in your AI programming assistant.
Documentation
Code-derived architecture documentation lives in docs/ (added in
LIN-737; updated for the LIN-699 changes — PR #61 / neo4cape #1860):
- docs/architecture.md — full architecture analysis: module map, tool surface and the Lineai /api/... endpoints each tool calls, auth flow, caching, error-handling taxonomy, configuration, packaging/release, and findings.
- docs/architecture-diagrams.md — Mermaid diagram set (ecosystem, module map, call sequence, auth/caching, error taxonomy).
- docs/rendered-diagrams/ — committed SVG renders of every diagram.
Components
Tools
The server implements **eight** tools: two impact tools plus six **graph** tools backed by the Lineai graph HTTP API.
Code Analysis Tools
- **lineai-method-impact**: Pulls an impact assessment from the Lineai server's APIs for your code.
- Takes the given "method" that you're working on; "class" is optional (a case-insensitive filter used when several matches exist).
- **lineai-database-impact**: Analyzes impacts between code and database entities.
- Takes the database entity type (column, table, or view) and its name.
All eight tools also accept optional workspace and materialized_view_id arguments to scope a single call; when neither is given (and LINEAI_WORKSPACE_NAME is unset) the server's default workspace's latest materialized view is used automatically.
Graph API tools
These call POST / GET endpoints under /api/ai-retrieval/graph/ on the same host as LINEAI_SERVER_HOST, using the same session auth as other MCP tools. If graph routes are not deployed, the server returns a clear “graph not available” style message (often after HTTP 404).
- **lineai-graph-capabilities**: GET — discover supported relationship types, limits, and flags for the workspace materialized view (materializedViewId resolved like every other tool: explicit id → workspace argument → LINEAI_WORKSPACE_NAME → server default).
- **lineai-graph-search**: Search nodes by text query / q and/or identity_prefix; optional scan_space, limit, etc.
- **lineai-graph-impact**: Dependency / blast-radius style traversal from seed_node_ids.
- **lineai-graph-path-explain**: Shortest-path style explanation between from_node_id and to_node_id.
- **lineai-graph-validate-change-scope**: Heuristic checklist / risk summary for a proposed change given seed nodes and proposed_change_summary.
- **lineai-graph-owners**: Resolve a node by node_id or identity_prefix and surface property fields whose names contain "owner".
Tool arguments accept **snake_case** aliases (for example materialized_view_id, seed_node_ids) where noted in the MCP schema; request bodies sent to Lineai use **camelCase** JSON keys.
Install
Pre Requisites
The MCP server relies upon Astral UV to run, please install
MacOS Workaround for uvx
There is a known issue with uvx on **MacOS** where the Lineai MCP server may fail to launch in certain IDEs (such as Cursor), resulting in errors like:
See issue #11
This appears to be a problem with Astral uvx running on MacOS. The following can be used as a workaround:
1. Clone this project locally.
2. Configure your mcp.json to use uv instead of uvx. For example:
3. Restart Cursor.
4. Ensure the Cursor Global Rule for Lineai is in place.
5. Open the MCP tab in Cursor and refresh the lineai-mcp-server.
6. Ask Cursor to make a code change in an existing class. The MCP server should now run the impact analysis successfully.
Configuration for Different IDEs
Visual Studio Code Configuration
To configure this MCP server in VS Code:
1. First, ensure you have GitHub Copilot agent mode enabled in VS Code.
2. Create a .vscode/mcp.json file in your workspace with the following configuration:
> **Note:** On some systems, you may need to use the full path to the uvx executable instead of just "uvx". For example: /home/user/.local/bin/uvx on Linux/Mac or C:\Users\username\AppData\Local\astral\uvx.exe on Windows.