|
| 1 | +########## |
| 2 | +MCP Server |
| 3 | +########## |
| 4 | + |
| 5 | +The PyUCIS MCP server lets AI assistants (such as Claude) query your coverage |
| 6 | +databases using natural language. Instead of memorizing command syntax, you |
| 7 | +can ask questions like: |
| 8 | + |
| 9 | +* *"What is the overall coverage of my regression?"* |
| 10 | +* *"Which covergroups have the lowest coverage?"* |
| 11 | +* *"Show me all bins that were never hit."* |
| 12 | +* *"Compare today's run to yesterday's baseline and report any regressions."* |
| 13 | +* *"Export coverage as LCOV and tell me what genhtml command to run."* |
| 14 | + |
| 15 | +The server uses the `Model Context Protocol (MCP) <https://modelcontextprotocol.io/>`_, |
| 16 | +a standard interface for connecting AI tools to external data sources. |
| 17 | + |
| 18 | +Installation |
| 19 | +============ |
| 20 | + |
| 21 | +.. code-block:: bash |
| 22 | +
|
| 23 | + pip install pyucis[dev] |
| 24 | +
|
| 25 | +This installs the ``pyucis-mcp-server`` command and its dependencies. |
| 26 | + |
| 27 | +Configuring Claude Desktop |
| 28 | +========================== |
| 29 | + |
| 30 | +1. Find your Claude Desktop config file: |
| 31 | + |
| 32 | + * **macOS**: ``~/Library/Application Support/Claude/claude_desktop_config.json`` |
| 33 | + * **Linux**: ``~/.config/Claude/claude_desktop_config.json`` |
| 34 | + * **Windows**: ``%APPDATA%\Claude\claude_desktop_config.json`` |
| 35 | + |
| 36 | +2. Add the PyUCIS server entry: |
| 37 | + |
| 38 | + .. code-block:: json |
| 39 | +
|
| 40 | + { |
| 41 | + "mcpServers": { |
| 42 | + "pyucis": { |
| 43 | + "command": "pyucis-mcp-server" |
| 44 | + } |
| 45 | + } |
| 46 | + } |
| 47 | +
|
| 48 | +3. Restart Claude Desktop. |
| 49 | + |
| 50 | +The PyUCIS tools are now available in your conversations. |
| 51 | + |
| 52 | +Example Session |
| 53 | +=============== |
| 54 | + |
| 55 | +Once connected, open a coverage database by telling Claude the file path, then ask |
| 56 | +questions in plain English: |
| 57 | + |
| 58 | +.. code-block:: text |
| 59 | +
|
| 60 | + You: Open /path/to/regression.xml and give me a coverage summary. |
| 61 | +
|
| 62 | + Claude: The database has 78.4% overall coverage across 142 covergroups. |
| 63 | + Functional coverage is 81.2%; code coverage is 74.6%. |
| 64 | + There are 23 covergroups below 50%. |
| 65 | +
|
| 66 | + You: Which covergroups have zero coverage? |
| 67 | +
|
| 68 | + Claude: The following 8 covergroups have 0% coverage: ... |
| 69 | +
|
| 70 | + You: Compare this to /path/to/baseline.xml and report regressions. |
| 71 | +
|
| 72 | + Claude: Compared to baseline, 3 items regressed: ... |
| 73 | +
|
| 74 | +Available Operations |
| 75 | +==================== |
| 76 | + |
| 77 | +The MCP server provides tools for: |
| 78 | + |
| 79 | +* Opening, listing, and closing databases |
| 80 | +* Coverage summary, gaps, and metrics |
| 81 | +* Covergroup, coverpoint, and bin details |
| 82 | +* Design hierarchy navigation |
| 83 | +* Test execution history |
| 84 | +* Database comparison (regression detection) |
| 85 | +* Hotspot analysis |
| 86 | +* Code coverage export (LCOV, Cobertura, JaCoCo, Clover) |
| 87 | +* Assertion and toggle coverage |
| 88 | + |
| 89 | +Starting the Server Manually |
| 90 | +============================ |
| 91 | + |
| 92 | +The server communicates via stdin/stdout and is normally started by the MCP |
| 93 | +client automatically. To start it manually for testing: |
| 94 | + |
| 95 | +.. code-block:: bash |
| 96 | +
|
| 97 | + pyucis-mcp-server |
| 98 | +
|
| 99 | +See the `MCP specification <https://modelcontextprotocol.io/>`_ for client |
| 100 | +integration details beyond Claude Desktop. |
0 commit comments