{
  "markdown": "# lineai-mcp-server\n\nAn [MCP Server](https://modelcontextprotocol.io/introduction) to utilize Lineai's rich software dependency data in your AI programming assistant.\n\n## Components\n\n### Tools\n\nThe server implements **eight** tools: two impact tools plus six **graph** tools backed by the Lineai graph HTTP API.\n\n#### Code Analysis Tools\n- **lineai-method-impact**: Pulls an impact assessment from the Lineai server's APIs for your code.\n  - Takes the given \"method\" that you're working on and its associated \"class\".\n- **lineai-database-impact**: Analyzes impacts between code and database entities.\n  - Takes the database entity type (column, table, or view) and its name.\n\n#### Graph API tools\n\nThese 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).\n\n- **lineai-graph-capabilities**: `GET` — discover supported relationship types, limits, and flags for the workspace materialized view (`materializedViewId` defaults from `LINEAI_WORKSPACE_NAME` like other tools).\n- **lineai-graph-search**: Search nodes by text `query` / `q` and/or `identity_prefix`; optional `scan_space`, `limit`, etc.\n- **lineai-graph-impact**: Dependency / blast-radius style traversal from `seed_node_ids`.\n- **lineai-graph-path-explain**: Shortest-path style explanation between `from_node_id` and `to_node_id`.\n- **lineai-graph-validate-change-scope**: Heuristic checklist / risk summary for a proposed change given seed nodes and `proposed_change_summary`.\n- **lineai-graph-owners**: Resolve a node by `node_id` or `identity_prefix` and surface property fields whose names contain `\"owner\"`.\n\nTool 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.\n\n### Install\n\n#### Pre Requisites\n\nThe MCP server relies upon Astral UV to run, please [install](https://docs.astral.sh/uv/getting-started/installation/)\n\n### MacOS Workaround for uvx\n\nThere 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:\nSee [issue #11](https://github.com/lineai-intelligence/lineai-mcp-server/issues/11)\n```\nFailed to connect client closed\n```\n\nThis appears to be a problem with Astral `uvx` running on MacOS. The following can be used as a workaround:\n\n1. Clone this project locally.\n2. Configure your `mcp.json` to use `uv` instead of `uvx`. For example:\n\n```json\n{\n  \"mcpServers\": {\n    \"lineai-mcp-server\": {\n      \"type\": \"stdio\",\n      \"command\": \"<PATH_TO_UV>/uv\",\n      \"args\": [\n        \"--directory\",\n        \"<PATH_TO_THIS_REPO>/lineai-mcp-server-main\",\n        \"run\",\n        \"lineai-mcp-server\"\n      ],\n      \"env\": {\n        \"LINEAI_SERVER_HOST\": \"<url to the server e.g. https://myco.app.lineai.net>\",\n        \"LINEAI_USERNAME\": \"<my username>\",\n        \"LINEAI_PASSWORD\": \"<my password>\",\n        \"LINEAI_WORKSPACE_NAME\": \"<my workspace>\",\n        \"LINEAI_DEBUG_MODE\": \"true\"\n      }\n    }\n  }\n}\n```\n\n3. Restart Cursor.\n4. Ensure the Cursor Global Rule for Lineai is in place.\n5. Open the MCP tab in Cursor and refresh the `lineai-mcp-server`.\n6. Ask Cursor to make a code change in an existing class. The MCP server should now run the impact analysis successfully.\n\n## Configuration for Different IDEs\n\n### Visual Studio Code Configuration\n\nTo configure this MCP server in VS Code:\n\n1. First, ensure you have GitHub Copilot agent mode enabled in VS Code.\n\n2. Create a `.vscode/mcp.json` file in your workspace with the following configuration:\n\n```json\n{\n  \"servers\": {\n    \"lineai-mcp-server\": {\n      \"type\": \"stdio\",\n      \"command\": \"uvx\",\n      \"args\": [\n        \"lineai-mcp-server@latest\"\n      ],\n      \"env\": {\n        \"LINEAI_SERVER_HOST\": \"<url to the server e.g. https://myco.app.lineai.net>\",\n        \"LINEAI_USERNAME\": \"<my username>\",\n        \"LINEAI_PASSWORD\": \"<my password>\",\n        \"LINEAI_WORKSPACE_NAME\": \"<my workspace>\",\n        \"LINEAI_DEBUG_MODE\": \"true\"\n      }\n    }\n  }\n}\n```\n\n> **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.\n\n3. Alternatively, you can run the `MCP: Add Server` command from the Command Palette and provide the server information.\n\n4. To manage your MCP servers, use the `MCP: List Servers` command from the Command Palette.\n\n5. Once configured, the server's tools will be available to Copilot agent mode. You can toggle specific tools on/off as needed by clicking the Tools button in the Chat view when in agent mode.\n\n6. To use the Lineai tools in agent mode, you can specifically ask about code impacts or database relationships, and the agent will utilize the appropriate tools.\n\n### Claude Desktop Configuration\n\nConfigure Claude Desktop by editing the configuration file:\n\n- On MacOS: `~/Library/Application\\ Support/Claude/claude_desktop_config.json`\n- On Windows: `%APPDATA%/Claude/claude_desktop_config.json`\n- On Linux: `~/.config/Claude/claude_desktop_config.json`\n\nAdd the following to your configuration file:\n\n```json\n\"mcpServers\": {\n  \"lineai-mcp-server\": {\n    \"command\": \"uvx\",\n    \"args\": [\n      \"lineai-mcp-server@latest\"\n    ],\n    \"env\": {\n      \"LINEAI_SERVER_HOST\": \"<url to the server e.g. https://myco.app.lineai.net>\",\n      \"LINEAI_USERNAME\": \"<my username>\",\n      \"LINEAI_PASSWORD\": \"<my password>\",\n      \"LINEAI_WORKSPACE_NAME\": \"<my workspace>\"\n    }\n  }\n}\n```\n\n> **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.\n\nAfter adding the configuration, restart Claude Desktop to apply the changes.\n\n### Windsurf IDE Configuration\n\nTo run this MCP server with [Windsurf IDE](https://codeium.com/windsurf):\n\n**Configure Windsurf IDE**:\n\nTo configure Windsurf IDE, you need to create or modify the `~/.codeium/windsurf/mcp_config.json` configuration file.\n\nAdd the following configuration to your file:\n\n```json\n\"mcpServers\": {\n  \"lineai-mcp-server\": {\n    \"command\": \"uvx\",\n    \"args\": [\n      \"lineai-mcp-server@latest\"\n    ],\n    \"env\": {\n      \"LINEAI_SERVER_HOST\": \"<url to the server e.g. https://myco.app.lineai.net>\",\n      \"LINEAI_USERNAME\": \"<my username>\",\n      \"LINEAI_PASSWORD\": \"<my password>\",\n      \"LINEAI_WORKSPACE_NAME\": \"<my workspace>\"\n    }\n  }\n}\n```\n\n> **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.\n\nAfter adding the configuration, restart Windsurf IDE or refresh the tools to apply the changes.\n\n### Cursor Configuration\n\nTo configure the Lineai MCP server in Cursor:\n\n1. Configure the MCP server by creating a `.cursor/mcp.json` file:\n\n```json\n{\n  \"mcpServers\": {\n    \"lineai-mcp-server\": {\n      \"command\": \"uvx\",\n      \"args\": [\n        \"lineai-mcp-server@latest\"\n      ],\n      \"env\": {\n        \"LINEAI_SERVER_HOST\": \"<url to the server e.g. https://myco.app.lineai.net>\",\n        \"LINEAI_USERNAME\": \"<my username>\",\n        \"LINEAI_PASSWORD\": \"<my password>\",\n        \"LINEAI_WORKSPACE_NAME\": \"<my workspace>\",\n        \"LINEAI_DEBUG_MODE\": \"true\"\n      }\n    }\n  }\n}\n```\n\n> **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.\n\n2. Restart Cursor to apply the changes.\n\nThe Lineai MCP server tools will now be available in your Cursor workspace.\n\n## AI Assistant Instructions/Rules\n\nTo help the AI assistant use the Lineai tools effectively, you can add the following instructions/rules to your client's configuration. We recommend customizing these instructions to align with your team's specific coding standards, best practices, and workflow requirements:\n\nWhen the graph API is available on your Lineai host, extend your rules with the same guidance the server already advertises in its MCP `instructions`: use **`lineai-graph-*`** tools (search, impact, path-explain, validate-change-scope, owners, capabilities) for bounded graph discovery; if graph calls fail with “not available”, fall back to **lineai-method-impact** / **lineai-database-impact**.\n\n### VS Code (GitHub Copilot) Instructions\n\nCreate a `.vscode/copilot-instructions.md` file with the following content:\n\n```markdown\n# Lineai MCP Server Instructions\n\nWhen modifying existing code methods:\n- Use lineai-method-impact to analyze code changes\n- Use lineai-database-impact for database modifications\n- When the Lineai graph API is available, use lineai-graph-* tools (search, impact, path-explain, validate-change-scope, owners, capabilities) for bounded graph discovery; otherwise rely on method/database impact tools\n- Highlight impact results for the modified methods\n\nWhen modifying SQL code or database entities:\n- Always use lineai-database-impact to analyze potential impacts\n- Highlight impact results for the modified database entities\n\nTo use the Lineai tools effectively:\n- For code impacts: Ask about specific methods or functions\n- For database relationships: Ask about tables, views, or columns\n- For graph discovery: Prefer lineai-graph-* tools when available\n- Review the impact results before making changes\n- Consider both direct and indirect impacts\n```\n\n### Claude Desktop Instructions\n\nCreate a file `~/.claude/instructions.md` with the following content:\n\n```markdown\n# Lineai MCP Server Instructions\n\nWhen modifying existing code methods:\n- Use lineai-method-impact to analyze code changes\n- Use lineai-database-impact for database modifications\n- When the Lineai graph API is available, use lineai-graph-* tools (search, impact, path-explain, validate-change-scope, owners, capabilities) for bounded graph discovery; otherwise rely on method/database impact tools\n- Highlight impact results for the modified methods\n\nWhen modifying SQL code or database entities:\n- Always use lineai-database-impact to analyze potential impacts\n- Highlight impact results for the modified database entities\n\nTo use the Lineai tools effectively:\n- For code impacts: Ask about specific methods or functions\n- For database relationships: Ask about tables, views, or columns\n- For graph discovery: Prefer lineai-graph-* tools when available\n- Review the impact results before making changes\n- Consider both direct and indirect impacts\n```\n\n### Windsurf IDE Rules\n\nCreate or modify the `~/.codeium/windsurf/memories/global_rules.md` markdown file with the following content:\n\n```markdown\nWhen modifying existing code methods:\n- Use lineai-method-impact to analyze code changes\n- Use lineai-database-impact for database modifications\n- When the Lineai graph API is available, use lineai-graph-* tools (search, impact, path-explain, validate-change-scope, owners, capabilities) for bounded graph discovery; otherwise rely on method/database impact tools\n- Highlight impact results for the modified methods\n\nWhen modifying SQL code or database entities:\n- Always use lineai-database-impact to analyze potential impacts\n- Highlight impact results for the modified database entities\n\nTo use the Lineai tools effectively:\n- For code impacts: Ask about specific methods or functions\n- For database relationships: Ask about tables, views, or columns\n- For graph discovery: Prefer lineai-graph-* tools when available\n- Review the impact results before making changes\n- Consider both direct and indirect impacts\n```\n\n### Cursor Global Rule\n\nTo configure Lineai rules in Cursor:\n\n1. Open Cursor Settings\n2. Navigate to the \"Rules\" section\n3. Add the following content to \"User Rules\":\n\n```markdown\n# Lineai MCP Server Rules\n## Codebase\n- The Lineai MCP Server is for java, javascript, typescript, and C# dotnet codebases\n- don't run the tools on python or other non supported codebases\n## AI Assistant Behavior\n- When modifying existing code methods:\n  - Use lineai-method-impact to analyze code changes\n  - Use lineai-database-impact for database modifications\n  - When the Lineai graph API is available, use lineai-graph-* tools (search, impact, path-explain, validate-change-scope, owners, capabilities) for bounded graph discovery; otherwise rely on method/database impact tools\n  - Highlight impact results for the modified methods\n- When modifying SQL code or database entities:\n  - Always use lineai-database-impact to analyze potential impacts\n  - Highlight impact results for the modified database entities\n- To use the Lineai tools effectively:\n  - For code impacts: Ask about specific methods or functions\n  - For database relationships: Ask about tables, views, or columns\n  - Review the impact results before making changes\n  - Consider both direct and indirect impacts\n```\n\n## Environment Variables\n\nThe following environment variables can be configured to customize the behavior of the server:\n\n- `LINEAI_SERVER_HOST`: The URL of the Lineai server.\n- `LINEAI_USERNAME`: Your Lineai username.\n- `LINEAI_PASSWORD`: Your Lineai password.\n- `LINEAI_WORKSPACE_NAME`: The name of the workspace to use.\n- `LINEAI_DEBUG_MODE`: Set to `true` to enable debug mode. When enabled, additional debug files such as `timing_log.txt` and `impact_data*.json` will be generated. Defaults to `false`.\n\n**Tests only**\n\n- `LINEAI_GRAPH_E2E_REQUIRED`: Set to `1` when running graph MCP integration tests if you want missing graph APIs (HTTP 404 / “Graph API not available”) to **fail** the suite instead of **skipping** those tests.\n\n### Example Configuration\n\n```json\n\"env\": {\n  \"LINEAI_SERVER_HOST\": \"<url to the server e.g. https://myco.app.lineai.net>\",\n  \"LINEAI_USERNAME\": \"<my username>\",\n  \"LINEAI_PASSWORD\": \"<my password>\",\n  \"LINEAI_WORKSPACE_NAME\": \"<my workspace>\",\n  \"LINEAI_DEBUG_MODE\": \"true\"\n}\n```\n\n### Pinning the version\n\ninstead of using the **latest** version of the server, you can pin to a specific version by changing the **args** field to match the version in [pypi](https://pypi.org/project/lineai-mcp-server/) e.g.\n\n```json\n    \"args\": [\n      \"lineai-mcp-server@0.2.2\"\n    ],\n```\n\n### Version Compatibility\n\nThis MCP server has the following version compatibility requirements:\n\n- Version 0.3.1 and below: Compatible with all Lineai API versions\n- Version 0.4.0 and above: Requires Lineai API version 25.10.0 or greater\n\nIf you're upgrading, make sure your Lineai server meets the minimum API version requirement.\n\n**Graph tools**: Require your Lineai deployment to serve the graph endpoints under `/api/ai-retrieval/graph/`. Older or partial deployments may return 404; the MCP tools surface that as a clear error instead of opaque failures.\n\n## Debug Logging\n\nWhen `LINEAI_DEBUG_MODE=true`, debug files are written to the system temporary directory:\n\n- **Windows**: `%TEMP%\\lineai-mcp-server` (typically `C:\\Users\\{username}\\AppData\\Local\\Temp\\lineai-mcp-server`)\n- **macOS**: `/tmp/lineai-mcp-server` (or `$TMPDIR/lineai-mcp-server` if set)  \n- **Linux**: `/tmp/lineai-mcp-server` (or `$TMPDIR/lineai-mcp-server` if set)\n\n**Debug files include**:\n- `timing_log.txt` - Performance timing information\n- `impact_data_*.json` - Raw impact analysis data for troubleshooting\n\n**Finding your log directory**:\n```python\nimport tempfile\nimport os\nprint(\"Log directory:\", os.path.join(tempfile.gettempdir(), \"lineai-mcp-server\"))\n```\n\n## Testing\n\n### Running Unit Tests\n\nThe project uses unittest for testing. You can run unit tests without any external dependencies:\n\n```bash\npython -m unittest discover -s test -p \"unit_*.py\"\n```\n\nUnit tests use mock data and don't require a connection to a Lineai server.\n\n### Integration Tests (Optional)\n\nIf you want to run integration tests that connect to a real Lineai server:\n\n1. Copy `test/.env.test.example` to `test/.env.test` and populate with your Lineai server details\n2. Run the integration tests:\n\n```bash\npython -m unittest discover -s test -p \"integration_*.py\"\n```\n\nNote: Integration tests require access to a Lineai server instance.\n\n### Graph MCP end-to-end tests\n\n`test/integration_test_graph.py` drives the real MCP handler path (`handle_call_tool`) for **`lineai-graph-capabilities`** and a chained flow (search → impact → path → validate → owners) against `LINEAI_SERVER_HOST`. Configure credentials the same way as other integration tests (`test/.env.test` from `test/.env.test.example`).\n\n- If the host does not expose graph routes, tests **skip** by default.\n- Set **`LINEAI_GRAPH_E2E_REQUIRED=1`** to turn missing graph APIs into hard failures (useful in CI when graph must be present).\n\nFrom the repo root:\n\n```bash\n./scripts/run_graph_e2e.sh\n```\n\nEquivalent:\n\n```bash\nuv run python -m unittest test.integration_test_graph -v\n```\n\n## Validation for Official MCP Registry\n\nmcp-name: io.github.lineai-intelligence/lineai-mcp-server\n",
  "bytes": 17189,
  "sha": "0720b575aea5e7dcff7623f8c691711973c84b9e683390f776cc75c22650f146",
  "repo_slug": "codelogicincengineering/codelogic-mcp-server",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_codelogicincengineering_codelo_ac4ef555/readme"
}