cbt-query


Namecbt-query JSON
Version 0.5.0 PyPI version JSON
download
home_pageNone
SummaryCBT Query MCP Server with cross-platform support
upload_time2025-08-29 06:22:03
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10
licenseNone
keywords coverage mcp query tensorrt testing
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # CBT Query MCP Server

A simple Model Context Protocol (MCP) server for querying TensorRT test coverage and case mapping data.

## Features

- Query all test cases and files
- Get coverage mapping by case name
- Query cases by files and/or functions
- Simple HTTP client with proper error handling
- Minimal logging and clean code structure

## Installation

### Prerequisites

- Python 3.10 or later
- pip package manager

### Installation

#### installed from pypi
```bash
pip install cbt_query

```
### Configuration for Cursor

Add the following configuration to your `~/.cursor/mcp.json` file:
```
# ~/.cursor/mcp.json
{
  "mcpServers": {
    "trt_query": {
      "command": "python",
      "args": [
        "-m",
        "cbt_query"
      ],
      "env": {
        "CBT_SERVER_URL": "http://your_server_name:12345/"
      }
    }
  }
}
```

## Available Tools

The MCP server provides the following tools:

- `query_all_cases`: Get all test cases from the server
- `query_all_files`: Get all files from the server  
- `query_by_case`: Get coverage mapping by case name
- `query`: Query cases by files and/or functions
- `query_test_similarity`: Compare test coverage similarity between two test lists

## API Examples

```python
# Get all cases
await query_all_cases()

# Get all files
await query_all_files()

# Get coverage by case
await query_by_case("test_case_name")

# Query by file
await query(file_name="example.cpp")

# Query by function
await query(funcs="example_function")

# Query by file and function
await query(file_name="example.cpp", funcs="example_function")

# Compare test coverage similarity
await query_test_similarity("L0", "L1")
await query_test_similarity(["test1", "test2"], ["test3", "test4"])
await query_test_similarity("trt_mod_test", "infer_test", filter_test_list=True)
await query_test_similarity("turtle_test1", "turtle_test2", use_turtle_names=True)
```

## Development

uv init new_project
cd new_project

# Create virtual environment and activate it
uv venv
source .venv/bin/activate

# Install dependencies
uv add "mcp[cli]" httpx requests pip


## Environment Setup

Make sure to set the `CBT_SERVER_URL` environment variable:

```bash
export CBT_SERVER_URL="http://your-server:12345"
```

### Debug Mode

To enable debug mode with detailed logging, set the `CBT_DEBUG` environment variable:

```bash
export CBT_DEBUG=1
# or
export CBT_DEBUG=true
```

## Troubleshooting

### Common Issues

1. **CBT_SERVER_URL not set**: Make sure the environment variable is set
2. **Import errors**: Verify all dependencies are installed in the active environment
3. **Connection errors**: Check that the CBT server is running and accessible

### Logging

The server logs to stderr with INFO level by default.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "cbt-query",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "coverage, mcp, query, tensorrt, testing",
    "author": null,
    "author_email": "CBT Team <cbt-team@example.com>",
    "download_url": "https://files.pythonhosted.org/packages/ec/03/27d314985bc06b8d7ecde8ea4c4f1e8686edcc19a583b63e93882574c31f/cbt_query-0.5.0.tar.gz",
    "platform": null,
    "description": "# CBT Query MCP Server\n\nA simple Model Context Protocol (MCP) server for querying TensorRT test coverage and case mapping data.\n\n## Features\n\n- Query all test cases and files\n- Get coverage mapping by case name\n- Query cases by files and/or functions\n- Simple HTTP client with proper error handling\n- Minimal logging and clean code structure\n\n## Installation\n\n### Prerequisites\n\n- Python 3.10 or later\n- pip package manager\n\n### Installation\n\n#### installed from pypi\n```bash\npip install cbt_query\n\n```\n### Configuration for Cursor\n\nAdd the following configuration to your `~/.cursor/mcp.json` file:\n```\n# ~/.cursor/mcp.json\n{\n  \"mcpServers\": {\n    \"trt_query\": {\n      \"command\": \"python\",\n      \"args\": [\n        \"-m\",\n        \"cbt_query\"\n      ],\n      \"env\": {\n        \"CBT_SERVER_URL\": \"http://your_server_name:12345/\"\n      }\n    }\n  }\n}\n```\n\n## Available Tools\n\nThe MCP server provides the following tools:\n\n- `query_all_cases`: Get all test cases from the server\n- `query_all_files`: Get all files from the server  \n- `query_by_case`: Get coverage mapping by case name\n- `query`: Query cases by files and/or functions\n- `query_test_similarity`: Compare test coverage similarity between two test lists\n\n## API Examples\n\n```python\n# Get all cases\nawait query_all_cases()\n\n# Get all files\nawait query_all_files()\n\n# Get coverage by case\nawait query_by_case(\"test_case_name\")\n\n# Query by file\nawait query(file_name=\"example.cpp\")\n\n# Query by function\nawait query(funcs=\"example_function\")\n\n# Query by file and function\nawait query(file_name=\"example.cpp\", funcs=\"example_function\")\n\n# Compare test coverage similarity\nawait query_test_similarity(\"L0\", \"L1\")\nawait query_test_similarity([\"test1\", \"test2\"], [\"test3\", \"test4\"])\nawait query_test_similarity(\"trt_mod_test\", \"infer_test\", filter_test_list=True)\nawait query_test_similarity(\"turtle_test1\", \"turtle_test2\", use_turtle_names=True)\n```\n\n## Development\n\nuv init new_project\ncd new_project\n\n# Create virtual environment and activate it\nuv venv\nsource .venv/bin/activate\n\n# Install dependencies\nuv add \"mcp[cli]\" httpx requests pip\n\n\n## Environment Setup\n\nMake sure to set the `CBT_SERVER_URL` environment variable:\n\n```bash\nexport CBT_SERVER_URL=\"http://your-server:12345\"\n```\n\n### Debug Mode\n\nTo enable debug mode with detailed logging, set the `CBT_DEBUG` environment variable:\n\n```bash\nexport CBT_DEBUG=1\n# or\nexport CBT_DEBUG=true\n```\n\n## Troubleshooting\n\n### Common Issues\n\n1. **CBT_SERVER_URL not set**: Make sure the environment variable is set\n2. **Import errors**: Verify all dependencies are installed in the active environment\n3. **Connection errors**: Check that the CBT server is running and accessible\n\n### Logging\n\nThe server logs to stderr with INFO level by default.\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "CBT Query MCP Server with cross-platform support",
    "version": "0.5.0",
    "project_urls": {
        "Documentation": "https://github.com/example/cbt-query/blob/main/README.md",
        "Homepage": "https://github.com/example/cbt-query",
        "Issues": "https://github.com/example/cbt-query/issues",
        "Repository": "https://github.com/example/cbt-query.git"
    },
    "split_keywords": [
        "coverage",
        " mcp",
        " query",
        " tensorrt",
        " testing"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "1a02d99248217f9fe2a34562a6fba3cca6717adfb2cfd1533f7db6e4336db2e1",
                "md5": "77929b6d7326b1d07281f54c86d5347a",
                "sha256": "f14e4521fedf64d0d4a4bd8cdad44aa53a672e5640e30179d5d69bb4db43576a"
            },
            "downloads": -1,
            "filename": "cbt_query-0.5.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "77929b6d7326b1d07281f54c86d5347a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 5930,
            "upload_time": "2025-08-29T06:22:02",
            "upload_time_iso_8601": "2025-08-29T06:22:02.843104Z",
            "url": "https://files.pythonhosted.org/packages/1a/02/d99248217f9fe2a34562a6fba3cca6717adfb2cfd1533f7db6e4336db2e1/cbt_query-0.5.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "ec0327d314985bc06b8d7ecde8ea4c4f1e8686edcc19a583b63e93882574c31f",
                "md5": "05a2e613652214f15c7711f09a13f55a",
                "sha256": "c3ad00717f333887cc0bc6213ede179d954ffa4bfd383c28eaf42f1f69f9a5b8"
            },
            "downloads": -1,
            "filename": "cbt_query-0.5.0.tar.gz",
            "has_sig": false,
            "md5_digest": "05a2e613652214f15c7711f09a13f55a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 4779,
            "upload_time": "2025-08-29T06:22:03",
            "upload_time_iso_8601": "2025-08-29T06:22:03.822002Z",
            "url": "https://files.pythonhosted.org/packages/ec/03/27d314985bc06b8d7ecde8ea4c4f1e8686edcc19a583b63e93882574c31f/cbt_query-0.5.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-29 06:22:03",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "example",
    "github_project": "cbt-query",
    "github_not_found": true,
    "lcname": "cbt-query"
}
        
Elapsed time: 1.92956s