# MCP Testing Sensei
This project implements an MCP (Model Context Protocol) stdio server designed to enforce and guide agentic coding tools (like Gemini CLI or Claude Code) in adhering to language agnostic unit testing principles.
## Core Principles Enforced
This tool aims to promote the following unit testing principles:
* **Tests should be written before implementation.** (BDD/TDD for the win)
* **Tests should document the behavior of the system under test.**
* **Tests should be small, clearly written, and have a single concern.**
* **Tests should be deterministic and isolated from the side effects of their environment and other tests.**
* **Tests should be written in a declarative manner and never have branching logic.**
## Features
* **`lint_code` tool**: Analyzes provided code snippets for violations of the defined unit testing standards.
* **`get_testing_principles` tool**: Provides the core unit testing principles to guide LLMs in generating better tests.
* **`unit-testing-principles` resource**: Exposes testing principles as an MCP resource.
## Installation
### Option 1: Standalone Executable (No Python Required)
Download the pre-built executable for your platform from the [latest release](https://github.com/kourtni/mcp-testing-sensei/releases/latest):
- **Linux**: `mcp-testing-sensei-linux`
- **macOS**: `mcp-testing-sensei-macos`
- **Windows**: `mcp-testing-sensei-windows.exe`
Make the file executable (Linux/macOS):
```bash
chmod +x mcp-testing-sensei-linux
./mcp-testing-sensei-linux
```
### Option 2: Install from PyPI
If you have Python installed, you can use pip:
```bash
pip install mcp-testing-sensei
```
This installs the `mcp-testing-sensei` command globally.
### Option 3: Install from npm
If you prefer using npm:
```bash
npm install -g @kourtni/mcp-testing-sensei
```
Note: This still requires Python to be installed on your system.
### Option 4: Using Docker
```bash
docker pull kourtni/mcp-testing-sensei
```
### Option 5: Development Setup with Nix
For development or if you want to build from source:
#### Prerequisites
* [Nix](https://nixos.org/download/) (for reproducible development environment)
#### Development Environment Setup
To enter the development environment with all dependencies:
```bash
nix develop
```
### Building the Standalone Executable
To build the standalone executable using Nix, run the following command:
```bash
nix build
```
This will create a `result` symlink in your project root, pointing to the built executable.
### Running the Server
#### Using the Standalone Executable
After building, you can run the MCP stdio server directly from the `result` symlink:
```bash
./result/bin/mcp-testing-sensei
```
This will start the MCP server that communicates via standard input/output.
#### Running from Development Environment
Alternatively, if you are in the `nix develop` shell, you can run the MCP server:
```bash
python mcp_server.py
```
The server communicates via stdio, reading JSON-RPC messages from stdin and writing responses to stdout.
## Using with MCP Clients
The server can be integrated with MCP-compatible clients like Claude Desktop or other tools that support the Model Context Protocol.
### Configuration for Claude Desktop
#### If installed via pip:
```json
{
"mcpServers": {
"testing-sensei": {
"command": "mcp-testing-sensei"
}
}
}
```
#### If installed via npm:
```json
{
"mcpServers": {
"testing-sensei": {
"command": "npx",
"args": ["@kourtni/mcp-testing-sensei"]
}
}
}
```
#### If using Docker:
```json
{
"mcpServers": {
"testing-sensei": {
"command": "docker",
"args": ["run", "-i", "kourtni/mcp-testing-sensei"]
}
}
}
```
#### If running from source:
```json
{
"mcpServers": {
"testing-sensei": {
"command": "python",
"args": ["/path/to/mcp-testing-sensei/mcp_server.py"]
}
}
}
```
### Testing the Server
To verify the server is working correctly, you can use the integration test script:
```bash
# For development testing
python test_mcp_integration.py
```
This will:
- Start the MCP server
- Send test requests to verify the tools are working
- Display the responses
The server itself doesn't have a standalone test mode - it's designed to be used with MCP clients.
## Development
### Running Tests
To run the unit tests locally, first ensure you are in the Nix development environment:
```bash
nix develop
```
Then, execute `pytest`:
```bash
pytest
```
## Project Structure
```
flake.lock
flake.nix
linter.py # Core linting logic
mcp_server.py # MCP stdio server implementation
main.py # Legacy HTTP server (can be removed)
pyproject.toml
test_mcp_integration.py # Integration test script for the MCP server
tests/
test_linter.py # Unit tests for the linter logic
```
## Contributing
Contributions are welcome! Please ensure your changes adhere to the established unit testing principles and project conventions.
## Additional Documentation
- [DISTRIBUTION.md](DISTRIBUTION.md) - Detailed guide for all distribution methods
- [RELEASE.md](RELEASE.md) - Release process and version management
Raw data
{
"_id": null,
"home_page": null,
"name": "mcp-testing-sensei",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": "mcp, testing, linter, sensei, unit-testing",
"author": "Kourtni Marshall",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/35/77/8188333ac610a6d8b1138c2e4919dfb63612bd01bcc1e856ef36d53607fd/mcp_testing_sensei-0.2.1.tar.gz",
"platform": null,
"description": "# MCP Testing Sensei\n\nThis project implements an MCP (Model Context Protocol) stdio server designed to enforce and guide agentic coding tools (like Gemini CLI or Claude Code) in adhering to language agnostic unit testing principles.\n\n## Core Principles Enforced\n\nThis tool aims to promote the following unit testing principles:\n\n* **Tests should be written before implementation.** (BDD/TDD for the win)\n* **Tests should document the behavior of the system under test.**\n* **Tests should be small, clearly written, and have a single concern.**\n* **Tests should be deterministic and isolated from the side effects of their environment and other tests.**\n* **Tests should be written in a declarative manner and never have branching logic.**\n\n## Features\n\n* **`lint_code` tool**: Analyzes provided code snippets for violations of the defined unit testing standards.\n* **`get_testing_principles` tool**: Provides the core unit testing principles to guide LLMs in generating better tests.\n* **`unit-testing-principles` resource**: Exposes testing principles as an MCP resource.\n\n## Installation\n\n### Option 1: Standalone Executable (No Python Required)\n\nDownload the pre-built executable for your platform from the [latest release](https://github.com/kourtni/mcp-testing-sensei/releases/latest):\n\n- **Linux**: `mcp-testing-sensei-linux`\n- **macOS**: `mcp-testing-sensei-macos`\n- **Windows**: `mcp-testing-sensei-windows.exe`\n\nMake the file executable (Linux/macOS):\n```bash\nchmod +x mcp-testing-sensei-linux\n./mcp-testing-sensei-linux\n```\n\n### Option 2: Install from PyPI\n\nIf you have Python installed, you can use pip:\n\n```bash\npip install mcp-testing-sensei\n```\n\nThis installs the `mcp-testing-sensei` command globally.\n\n### Option 3: Install from npm\n\nIf you prefer using npm:\n\n```bash\nnpm install -g @kourtni/mcp-testing-sensei\n```\n\nNote: This still requires Python to be installed on your system.\n\n### Option 4: Using Docker\n\n```bash\ndocker pull kourtni/mcp-testing-sensei\n```\n\n### Option 5: Development Setup with Nix\n\nFor development or if you want to build from source:\n\n#### Prerequisites\n\n* [Nix](https://nixos.org/download/) (for reproducible development environment)\n\n#### Development Environment Setup\n\nTo enter the development environment with all dependencies:\n\n```bash\nnix develop\n```\n\n### Building the Standalone Executable\n\nTo build the standalone executable using Nix, run the following command:\n\n```bash\nnix build\n```\n\nThis will create a `result` symlink in your project root, pointing to the built executable.\n\n### Running the Server\n\n#### Using the Standalone Executable\n\nAfter building, you can run the MCP stdio server directly from the `result` symlink:\n\n```bash\n./result/bin/mcp-testing-sensei\n```\n\nThis will start the MCP server that communicates via standard input/output.\n\n#### Running from Development Environment\n\nAlternatively, if you are in the `nix develop` shell, you can run the MCP server:\n\n```bash\npython mcp_server.py\n```\n\nThe server communicates via stdio, reading JSON-RPC messages from stdin and writing responses to stdout.\n\n## Using with MCP Clients\n\nThe server can be integrated with MCP-compatible clients like Claude Desktop or other tools that support the Model Context Protocol.\n\n### Configuration for Claude Desktop\n\n#### If installed via pip:\n\n```json\n{\n \"mcpServers\": {\n \"testing-sensei\": {\n \"command\": \"mcp-testing-sensei\"\n }\n }\n}\n```\n\n#### If installed via npm:\n\n```json\n{\n \"mcpServers\": {\n \"testing-sensei\": {\n \"command\": \"npx\",\n \"args\": [\"@kourtni/mcp-testing-sensei\"]\n }\n }\n}\n```\n\n#### If using Docker:\n\n```json\n{\n \"mcpServers\": {\n \"testing-sensei\": {\n \"command\": \"docker\",\n \"args\": [\"run\", \"-i\", \"kourtni/mcp-testing-sensei\"]\n }\n }\n}\n```\n\n#### If running from source:\n\n```json\n{\n \"mcpServers\": {\n \"testing-sensei\": {\n \"command\": \"python\",\n \"args\": [\"/path/to/mcp-testing-sensei/mcp_server.py\"]\n }\n }\n}\n```\n\n### Testing the Server\n\nTo verify the server is working correctly, you can use the integration test script:\n\n```bash\n# For development testing\npython test_mcp_integration.py\n```\n\nThis will:\n- Start the MCP server\n- Send test requests to verify the tools are working\n- Display the responses\n\nThe server itself doesn't have a standalone test mode - it's designed to be used with MCP clients.\n\n## Development\n\n### Running Tests\n\nTo run the unit tests locally, first ensure you are in the Nix development environment:\n\n```bash\nnix develop\n```\n\nThen, execute `pytest`:\n\n```bash\npytest\n```\n\n## Project Structure\n\n```\nflake.lock\nflake.nix\nlinter.py # Core linting logic\nmcp_server.py # MCP stdio server implementation\nmain.py # Legacy HTTP server (can be removed)\npyproject.toml\ntest_mcp_integration.py # Integration test script for the MCP server\ntests/\n test_linter.py # Unit tests for the linter logic\n```\n\n## Contributing\n\nContributions are welcome! Please ensure your changes adhere to the established unit testing principles and project conventions.\n\n## Additional Documentation\n\n- [DISTRIBUTION.md](DISTRIBUTION.md) - Detailed guide for all distribution methods\n- [RELEASE.md](RELEASE.md) - Release process and version management\n\n",
"bugtrack_url": null,
"license": null,
"summary": "An MCP server to guide agentic coding tools to use language agnostic testing principles.",
"version": "0.2.1",
"project_urls": {
"Homepage": "https://github.com/kourtni/mcp-testing-sensei",
"Repository": "https://github.com/kourtni/mcp-testing-sensei"
},
"split_keywords": [
"mcp",
" testing",
" linter",
" sensei",
" unit-testing"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "a80d9782d8a0a5e530677a814b4d61474bf73702cf7c3676fcae2f7f2b6f44dc",
"md5": "f1cac74e935a00c81cd6d8f5e113e476",
"sha256": "c87b0e3156ef5a0e65349a739ee69864d7e5e87975a692305583398bcd007e2f"
},
"downloads": -1,
"filename": "mcp_testing_sensei-0.2.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "f1cac74e935a00c81cd6d8f5e113e476",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 10823,
"upload_time": "2025-07-26T05:00:43",
"upload_time_iso_8601": "2025-07-26T05:00:43.688789Z",
"url": "https://files.pythonhosted.org/packages/a8/0d/9782d8a0a5e530677a814b4d61474bf73702cf7c3676fcae2f7f2b6f44dc/mcp_testing_sensei-0.2.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "35778188333ac610a6d8b1138c2e4919dfb63612bd01bcc1e856ef36d53607fd",
"md5": "c422a2d0b1316ed24d0d60ab1553d857",
"sha256": "76dbab4d529f12f753176002cdc45134f6dba2ced0644187345b28106a905f25"
},
"downloads": -1,
"filename": "mcp_testing_sensei-0.2.1.tar.gz",
"has_sig": false,
"md5_digest": "c422a2d0b1316ed24d0d60ab1553d857",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 7963,
"upload_time": "2025-07-26T05:00:44",
"upload_time_iso_8601": "2025-07-26T05:00:44.790894Z",
"url": "https://files.pythonhosted.org/packages/35/77/8188333ac610a6d8b1138c2e4919dfb63612bd01bcc1e856ef36d53607fd/mcp_testing_sensei-0.2.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-26 05:00:44",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "kourtni",
"github_project": "mcp-testing-sensei",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "mcp",
"specs": [
[
">=",
"1.6.0"
]
]
},
{
"name": "pytest",
"specs": [
[
">=",
"7.0.0"
]
]
}
],
"lcname": "mcp-testing-sensei"
}